Contents:
Post A Search To The XNAT Search Engine
This REST endpoint assumes you have built a valid XML search. You can download the XML of any existing data table in XNAT and use that as a starting point, or you can build your own. See How to Query the XNAT Search Engine with REST API.
POST - /data/search
Parameters:
format | Optional querystring parameter. Specifies the format of the returned data
|
---|---|
body | Required search definition. Can be included in the body, or in a supplied XML file |
Response: A valid search will return a formatted search result, showing data that the user has permission to see.
You can also create a stored search out of a valid XML search. See Stored Search API
Get A List Of Available Data Elements
This REST endpoint displays a list of all installed data types in your XNAT, regardless of whether there is available data of that type.
GET - /data/search/elements
Parameters:
format | Optional querystring parameter. Specifies the format of the returned data
|
---|
Response:
Showing JSON formatted results. Note that the ELEMENT_NAME field corresponds with the XNAT xsiType for that data type.
{ "ResultSet": { "Result": [ { "SINGULAR": "Project", "SECURED": "true", "ELEMENT_NAME": "xnat:projectData", "COUNT": "10", "PLURAL": "Projects" }, { "SINGULAR": "Subject", "SECURED": "true", "ELEMENT_NAME": "xnat:subjectData", "COUNT": "39", "PLURAL": "Subjects" }, { "SINGULAR": "MR Session", "SECURED": "true", "ELEMENT_NAME": "xnat:mrSessionData", "COUNT": "36", "PLURAL": "MR Sessions" }, { "SINGULAR": "PET Session", "SECURED": "true", "ELEMENT_NAME": "xnat:petSessionData", "COUNT": "7", "PLURAL": "PET Sessions" }, ... ], "title": "Data-Types" } }
Get A List Of Queryable Fields For A Given Data Type
From the list of available elements, supply an xsiType to get a list of columns you can search on.
GET - /data/search/elements/{xsiType}
Parameters
{xsiType} | Required path parameter. |
---|---|
format | Optional querystring parameter. Specifies the format of the returned data
|
Response
Displaying JSON-formatted result for a search on /data/search/elements/xnat:subjectData
Get A List Of Search Report Versions For A Data Type
In the Advanced Search UI, you will notice a set of options when joining two data types together, whether you want to join a "Brief" or "Detailed" view of the data. These are two defined search report versions for a given data type. There are also other defined versions that may be shown in various contexts. This REST endpoint returns a full list of those versions.
GET - /data/search/elements/{xsiType}/versions
Parameters
{xsiType} | Required path parameter. |
---|---|
format | Optional querystring parameter. Specifies the format of the returned data
|
Response:
Displays just the contents of the "versions" object in the xsiType search example listed above