Data Rows ========= .. code-block:: http /api/repositories/{repository}/entities/{entity}/rows .. csv-table:: :header: Parameter, Type, Purpose :widths: 20, 20, 60 :stub-columns: 1 repository, string, the name of the :doc:`repository` entity, int, The ID of the entity to view All Rows ~~~~~~~~ .. http:get:: /api/repositories/(string:repository)/entities/(int:entity)/rows :synopsis: Lists data rows in an entity Lists data rows in an :doc:`entity` :jsonparam body: The request body .. code-block:: http GET /api/repositories/jupiter/entities/1/rows HTTP/1.1 Accept: application/json .. csv-table:: :header: Response Code, Reason :widths: 25, 75 200, No error 500, Server error :ref:`Paging ` is supported for this GET request using :doc:`standard-url-query-string`. The underlying data rows can be returned in a :ref:`JSON key/value pair ` by setting the :ref:`external JSON format ` parameter. This allows access by different external tools that requires the JSON data in a key/value pair instead of standard array of row data with columns names defined separately. The response will be a :doc:`standard-response`, with a list of records in the corresponding :doc:`entity`. If :ref:`external JSON format ` parameter was set then a list of records in a :ref:`JSON key/value pair ` format will be returned. The ``columns`` array will contain the list of columns for each data row. data row will contain the list of records of the corresponding :doc:`entity`: If there are no records in the :doc:`entity`, ``rows`` will be an empty string. Page Rows ~~~~~~~~~ .. http:post:: /api/repositories/(string:repository)/entities/(int:entity)/rows :synopsis: Get a page of rows from an entity Get a page of rows from an :doc:`entity` :jsonparam body: The request body .. code-block:: http POST /api/repositories/(string:repository)/entities/(int:entity)/rows HTTP/1.1 Content-Type: application/json { "command": "get", "options": { "pageStart": "1", "pageSize": "50" } } .. csv-table:: :header: Response Code, Reason :widths: 25, 75 204, No error 400, Invalid data passed with request 500, Server error The underlying data rows can be returned in a :ref:`JSON key/value pair ` by setting the :ref:`external JSON format ` parameter. This allows access by different external tools that requires the JSON data in a key/value pair instead of standard array of row data with columns names defined separately. The request requires a :doc:`standard-request` packet. Available commands are: .. csv-table:: :header: Command, Description :widths: 30, 70 get, Pages data rows of an entity The request packet must contain the ``command`` and ``options`` elements. The ``data`` element is not required. The response will be a :doc:`standard-response`, with a list of records in the corresponding :doc:`entity`. If :ref:`external JSON format ` parameter was set then a list of records in a :ref:`JSON key/value pair ` format will be returned. The ``columns`` array will contain the list of columns for each data row. data row will contain the list of records of the corresponding :doc:`entity`: If there are no records in the :doc:`entity`, ``rows`` will be an empty string. Export Rows ~~~~~~~~~~~ Some or all of the rows may be exported as a scheduled task. .. code-block:: http POST /api/repositories/(string:repository)/entities/(int:entity)/rows HTTP/1.1 Content-type:: application/json { "command": "export", "options": { "where": "where clause" }, "data": { "filename": "filename.csv" } } When export is required, the filename for the exported file must be specified. The file will be exported in CSV format using the native encoding of the server. .. csv-table:: :header: Response Code, Reason :widths: 25, 75 200, No error 500, Server error The response will contain the URL of the scheduled task and the link to download the exported file. .. code-block:: json { "job": "/api/repositories/jupiter/scheduler/1", "file": "/api/repositories/jupiter/download/filename.csv" }