This document describes the NBIA representational state transfer application programming interface (REST API) implementation for Release 6.0 and up. The API is designed for use by image analysis and data mining tools to directly query the public and private resources of NBIA and retrieve information into their applications. The API complements the existing web interface but eliminates the need for users to visit the NBIA web pages to select and download images and then upload them into their viewing and analysis applications.
The API is a RESTful interface, accessed through web URLs. There is no software that an application needs to download to use the API. The application can build its own access routines using only the API documentation provided here. The interface employs predefined query functions (see NBIA REST API Guide, REST Search APIs, and User Administration APIs) that access NBIA databases.
Each API has a public and private version, used to access public or private data. |
If you are interested in using the API and have questions, contact .
NBIA v1 API URL and Format to Access Public DataThe full API for public resources consists of a base URL followed by the API and query parameters, in that order. The base URL to access public data is https://[installation location]/nbia-api/services/v1/. For example, in the following URL:
With the exception of the Example Call to Access Public DataThe following is an example call using curl to access public data using an API from the NBIA REST API Guide.
NBIA v1 API URL and Format to Access Private DataAccess to restricted data using an NBIA v1 API requires a token and a different base URL, https://[installation location]/nbia-api/services/v2/. More information about how to request a token is at Accessing Private Resources with NBIA REST Services. NBIA v1 API Directory
Return Values for NBIA v1 APIsThis section lists and explains the return values of the NBIA v1 REST APIs.
|
|
Use of NBIA Search APIs requires a token. More information about how to request a token is at Accessing Private Resources with NBIA REST Services. Advanced Search APIThe advanced search API is used in the portal to create queries for the advanced search. The Advanced Search API is bound to the NBIA configuration DataSourceItem.xml and is like a map of tables and columns. Developers who want to use the API should focus on:
Developers should also familiarize themselves with the available operators.
The queries consist of two main items:
Example Advanced Search Query
Since the API is for programmatic use, JSON is returned, providing the information returned in the initial search screen.
Note that the series identifiers are those that fulfill the search criteria. Body Part Values and Counts APIThe Body Part Values and Counts API will return the modality values plus the body part count for the modality it takes the following parameters optionally
Example Body Part Values and Counts Query
The API returns the body parts and their counts
Collection Description APIThe Collection Description API retrieves Collection Descriptions The API optionally takes one argument:
Example Collection Description Query
The API returns the Search Criteria Descriptions.
Collection Values and Counts APIThe Collection Values and Counts API returns the collections and the subject count for each collection. Example Collection Values and Counts Query
The API returns the collections with their counts.
Create Saved Cart APIThe Create Saved Cart API creates a saved cart. The API takes four arguments:
Example Create Saved Cart Query
Delete Saved Cart APIThe Delete Saved Cart API deletes a saved cart. The API takes one argument:
Example Delete Saved Cart Query
Drill Down APIThe Drill Down API provides the functionality in the portal where the user drills down the studies and series associated with a given user. The API simply takes a list of series to query, using the parameter "list," that is repeated for each series you want to retrieve. Example Drill Down Query
The Drill Down API returns JSON with the information to populate the drill down to study screen. There can be multiple studies.
Drill Down Using Series UIDs APIThe Drill Down Using Series UIDs API provides the functionality in the portal where the user drills down the studies and series associated with a given user. The API takes a list of Series UIDs to query, using the parameter "list", that is repeated for each Series UID you want to retrieve. Example Drill Down Using Series UIDs Query
The Drill Down Using Series UIDs API returns JSON with the information to populate the drill down to study screen. You can include multiple studies in the query.
Drill Down to Images APIThe Drill Down to Images API allows the developer to drill down to the images in a series and have the information available to create a WADO call that can retrieve the images themselves. This API is used to create the Thumbnails screen in the portal. The API takes a list of series to query, using the parameter "list," which repeats for each series for which you want to retrieve images. Example Drill Down to Images Query
The API returns the information needed to populate the Thumbnails screen.
The information needed to create a WADO call is the following snippet from this code:
Extended Simple Search APIThe Extended Simple Search API adds two new fields to the return values. Example Extended Simple Search Query
The API returns the simple search with additional information.
Host Name APIThe Host Name returns a short host name used by the client to display which machine in a load-balanced environment is running. Example Host Name Query
The API returns a short host name.
Manifest APIThe Manifest API allows the creation of a manifest file that can be used to execute the Downloader App. The API takes two arguments:
Example Manifest Query
The API returns text that can be used as a manifest file for the Downloader App.
Manifest API from Saved CartThe Manifest API from Saved Cart allows the creation of a manifest file that can be used to execute the NBIA Data Retriever. The API takes two arguments:
Example Manifest from Saved Cart Query
The API returns text that can be used as a manifest file for the NBIA Data Retriever.
Manifest API from JNLP DataThe Manifest API from JNLP data allows the creation of a manifest file that can be used to execute the Downloader App. The API takes two arguments:
Example Manifest from JNLP Data Query
The API returns text that can be used as a manifest file for the Downloader App.
Manufacturer Values and Counts APIThe Manufacturer Values and Counts API returns modality values plus manufacturer count for the modality. It optionally takes the following parameters:
Example Manufacturer Values and Counts Query
The API returns the manufacturer and their counts.
Manufacturer Tree APIThe Manufacturer Tree API will return the manufacturer and software in a structure that allows the build of a tree. Example Manufacturer Values and Counts Query
The API returns the manufacturer and their counts.
Modality Values and Counts APIThe Modality Values and Counts API will return the modality values plus the subject count for the modality it takes the following parameters optionally
Example Modality Values and Counts Query
The API returns the modalities and their counts
Series Metadata APIThe Series Metadata API allows returns the metadata needed by the Client for a set of series as CSV The API takes one argument:
Example Series Metadata Query
The API returns ok if successful, and the error if one occurs.
Series Metadata Returning Spreadsheet APIThe Series Metadata Returning Spreadsheet API allows returns the metadata needed by the Client for a set of series as CSV in the form of a spreadsheet. The API takes one argument:
Example Series Metadata Returning Spreadsheet Query
The API returns "ok" if successful and the error if one occurs.
Shared List Data APIThe Shared List Data API retrieves the data associated with a Shared List The API takes one argument:
Example Shared List Data Query
The API will send back the Shared List data.
Simple Search APIThe Simple Search API is used to run queries for the Simple search in NBIA, the Simple Search API uses a variety of criteria as seen in the Simple Search Screen. The available criteria types include and their components are:
Since the Simple Search API can take an unlimited number of criteria each of the criteria items is appended with a number signifying its order in the query, starting with 0. Example Simple Search Query
The Simple Search API returns the same JSON as the Advanced Search API. Submission APIThe Submission API allows images to be imported into the NBIA database and text index without being submitted through CTP. Note the API does not create thumbnails as it is assumed that they have already been created. The API takes up to seven arguments:
Example Submission Query
The API returns "ok" if successful and the error if one occurs. Text Search APIThe text search API is used to run queries for Text Search in the portal. The text search takes an argument, textValue. Example Text Search Query
Note that the returned JSON now includes the "hit" that was found by the Solr search engine.
|
This section describes the group of APIs used internally by NBIA's User Authorization Tool (UAT). The user administration information is considered a private resource and is protected by NBIA's OAauth 2 API server, which allows access only by authorized users. For details on accessing private resources using the NBIA REST service, see NBIA REST API Guide.
Assuming the user has been authenticated and has received the OAuth token for the HTTP headers of the API calls, that user can refer to the following table for the parameters for each query endpoint in the UAT APIs. The server returns either the status of the operation or the data requested in the format specified in the query parameter. However, the query parameter for format is optional. If it is not provided, the response returns data in JSON format.
Access to the user administration APIs requires a token and a different base URL, https://imaging.nci.nih.gov/nbia-api/services/v3.
Resource | QueryEndpoint | Query Parameters All query parameters are optional unless stated otherwise. | Return | Description |
---|---|---|---|---|
v3/ | assignDataSetToPG | projAndSite(R) PGName(R) | The status of operation | Assign a combination of Project and Site to a Protection Group |
v3/ | assignGroupToPGWithRoles | groupName(R) PGName(R) roleNames(R) | The status of operation | Assign a group to a protection group with a role |
v3/ | assignPEsToPG | PENames(R) PGName(R) | The status of operation | Assign a list of combination of Project and Site to a Protection Group |
v3/ | assignUserToPGWithRoles | loginName(R) PGName(R) roleNames(R) | The status of operation | Assign an user to a protection group with a role |
v3/ | createProtecionGroup | PGName(R) description | The status of operation | Create a new Protection Group |
v3/ | createUser | loginName(R) email(R) active(R) | The status of operation | Create a new user |
v3/ | deassignDataSetFromPG | projAndSite(R) PGName(R) | The status of operation | De-assign a combination of Project and Site from a Protection Group |
v3/ | deassignPEsFromPG | PENames(R) PGName(R) | The status of operation | De-assign a list of combination of Project and Site from a Protection Group |
v3/ | deassignUserFromPGWithRoles | loginName(R) PGName(R) roleNames(R) | The status of operation | De-assign an user from a protection group with a role |
v3/ | deleteGroup | GroupName(R) | The status of operation | Delete a Group |
v3/ | deleteProtecionGroup | PGName(R) | The status of operation | Delete a Protection Group |
v3/ | getAllGroupsWithPGs | format | CSV/HTML/XML/JSON | Get all groups with associated protection groups |
v3/ | getAllPGsWithPEs | format | CSV/HTML/XML/JSON | Get all protection groups with associated protection elements |
v3/ | getAllPGsWithRolesForUser | loginName(R) format | CSV/HTML/XML/JSON | Get protection group and roles associated with given user |
v3/ | getAllUsersWithRolesForPG | format | CSV/HTML/XML/JSON | Get all users with associated protection group and roles |
v3/ | getAvailablePEsForPG | PGName (R) format | CSV/HTML/XML/JSON | Get the list of protection element names associated with a given protection group |
v3/ | getAvailablePGsForGroup | groupName (R) format | CSV/HTML/XML/JSON | Get the list of protection element associated with the given group name |
v3/ | getAvailablePGsForUser | loginName (R) format | CSV/HTML/XML/JSON | Get the list of protection group associated with the given user |
v3/ | getGroupList | format | CSV/HTML/XML/JSON | Get all group names |
v3/ | getIncludedPEsForPG | PGName (R) format | CSV/HTML/XML/JSON | Get the list of protection element in the given protection group |
v3/ | getProjSiteList | format | CSV/HTML/XML/JSON | Get the list of <Project Name>//<Site Name> |
v3/ | getProtectionEleNameList | format | CSV/HTML/XML/JSON | Get all protection elements |
v3/ | getProtectionGrpList | format | CSV/HTML/XML/JSON | Get all protection group objects |
v3/ | getProtectionGrpNameList | format | CSV/HTML/XML/JSON | Get all protection group names |
v3/ | getRoleList | format | CSV/HTML/XML/JSON | Get all role names |
v3/ | getUserList | format | CSV/HTML/XML/JSON | Get all user objects |
v3/ | getUserNameList | format | CSV/HTML/XML/JSON | Get all user login names |
v3/ | modifyProtecionGroup | PGName(R) Description(R) | The status of operation | Modify the description of a given Protection Group |
v3/ | modifyRolesOfGroupForPG | groupName(R) PGName(R) roleNames(R) | The status of operation | Modify a group’s roles with a given Protection Group |
v3/ | modifyRolesOfUserForPG | loginName(R) PGName(R) roleNames(R) | The status of operation | Modify a user’s roles win a given Protection Group |
v3/ | modifyUser | loginName(R) email(R) active(R) | The status of operation | Modify the given user’s email and/or active status |
v3/ | removeGroupFromPG | groupName(R) PGName(R) | The status of operation | Remove a group from a protection Group |
v3/ | removeUserFromPG | loginName(R) PGName(R) | The status of operation | Remove a user from a Protection Group |