Library Entity Associated Entities ================================== .. code-block:: http /api/repositories/{repository}/library/entities/{libraryID}/associatedentities .. csv-table:: :header: Parameter, Type, Purpose :widths: 20, 20, 60 :stub-columns: 1 repository, string, The name of the :doc:`repository` libraryID, int, The ID of the library entity Show All ~~~~~~~~~ .. http:get:: /api/repositories/(string:repository)/library/entities/(int:libraryID)/associatedentities :synopsis: Returns a list of all entities associated with a library entity Returns a list of all :doc:`entities` associated with a :doc:`libraryentity`. .. code-block:: http GET /api/repositories/jupiter/library/entities/2/associatedentities HTTP/1.1 Accept: application/json .. csv-table:: :header: Response Code, Reason :widths: 25, 75 200, No error 400, Invalid data passed with request 404, Server error 500, Server error The response will be a :doc:`standard-response`, with a list of the :doc:`entities` associated with the :doc:`libraryentity`; See :doc:`entities` for details of the contents of the response. Show Some ~~~~~~~~~~ .. http:post:: /api/repositories/(string:repository)/library/entities/(int:libraryID)/associatedentities :synopsis: Lists attributes of an entity that match various criteria Lists all :doc:`entities` associated with a :doc:`libraryentity` that match various criteria :jsonparam body: The request body .. code-block:: http POST /api/repositories/jupiter/library/entities/2/associatedentities HTTP/1.1 Content-Type: application/json { "command": "get", "options": { "pageSize":"25", "pageStart":"1" } } .. csv-table:: :header: Response Code, Reason :widths: 25, 75 200, Success 400, Invalid data passed with request 404, Server error 500, Server error The request requires a :doc:`standard-request` packet. The response will be a :doc:`standard-response`, same as described for the above get request, with a list of :doc:`entities` associated with the :doc:`libraryentity` that match the given criteria. Export ~~~~~~~ Some or all of the rows may be exported as a scheduled task. .. code-block:: http POST /api/repositories/jupiter/library/entities/2/associatedentities HTTP/1.1 Content-Type: application/json { "command": "export", "data": { "filename": "filename.csv", "filetype": "csv", "encoding": "utf-8" }, "options": { "columns": ["_humanised_name", "ENTITY_ID"], "where": "Ref = 1" } } .. csv-table:: :header: Response Code, Reason :widths: 25, 75 200, No error 400, Invalid data passed with request 404, Server error 500, Server error The request packet must contain the ``command`` and ``data`` elements. The ``options`` element is not required, but may specify the columns to export, and/or the rows to filter. The following table shows which fields are required in the ``data`` element: .. csv-table:: :header: Field, Required :widths: 20, 10 filename, Y filetype, N encoding, N If ``filetype`` is not specified, it defaults to csv. If ``encoding`` is not specified, it defaults to the server native encoding. 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" }