Attribute Values Matching Rows =============================== .. code-block:: http /api/repositories/{repository}/entities/{entity}/attributes/{attribute}/values/matchingrows .. csv-table:: :header: Parameter, Type, Purpose :widths: 20, 20, 60 :stub-columns: 1 repository, string, The :doc:`repository ` name entity, int, The :doc:`entity ` ID attribute, int, The :doc:`attribute ` ID Only POST requests are supported for this endpoint. .. http:post:: /api/repositories/(string:repository)/entities/(int:entityID)/attributes/(int:attributeID)/values/matchingrows :synopsis: Get a paged list of matching rows for an attribute Get a page of matching rows for an attribute .. code-block:: http POST /api/repositories/jupiter/entities/1/attributes/55/values/matchingrows HTTP/1.1 Content-Type: application/json { "command": "get", "options": { "pageStart": 1, "pageSize": 32 }, "data": [ ["BUSINESS CREDIT - NJ", "42"], ["PNC BUSINESS CREDIT-PITTSBURGH", "25"] ] } This endpoint retrieves a list of rows where the specified attribute matches the value(s) in ``data``. Each element in the ``data`` array is an array containing the value and frequency count to match against. The response is a :doc:`standard-response`, but the contents of the ``columns`` and ``rows`` arrays depend on the entity. The first element in the ``columns`` array will be: .. code-block:: json { "columnisedName": ":rowid:", "humanisedName": "Row", "description": "The row number for this row" } Export ~~~~~~~ Some or all of the rows may be exported as a scheduled task. .. code-block:: http POST /api/repositories/jupiter/entities/1/attributes/2/values/matchingrows HTTP/1.1 Content-Type: application/json { "command": "export", "data": [ ["BUSINESS CREDIT - NJ", "42"], ["PNC BUSINESS CREDIT-PITTSBURGH", "25"] ], "exportData": { "filename": "filename.csv", "filetype": "csv", "encoding": "utf-8" }, "options": { "where": "Frequency = 3" } } .. csv-table:: :header: Response Code, Reason :widths: 25, 75 200, No error 400, Invalid data passed with request 500, Server error The request packet must contain the ``command``, ``data``, and ``exportData`` 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 ``exportData`` 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" }