Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
titleStructure of a Request for a Token
curl -d "username=USERNAME&password=PASSWORD&client_id=NBIA&grant_type=password" -X POST -k https://services.cancerimagingarchive.net/nbia-api/oauth/token

If you don't have a TCIA account and want to test an API, you can access public data using the NBIA guest account with no password, as follows.

Code Block
titleNBIA REST API Call for Testing an API without a Token
curl -d "username=nbia_guest&password=&client_id=NBIA&grant_type=password" -X POST -k https://services.cancerimagingarchive.net/nbia-api/oauth/token

Request a token by interacting with the application in the following way.

Request a token by interacting with the application in the following way.

  1. The application requests credentials. The credentials you pass are different depending on if you want to access public or restricted data (see above).
  2. The application sends a request to the service using the credentials you provided as a query string for the body. 

    • grant_type=password
    • username
    • password
  3. The service responds with access token details and expiration information.

    • access_token
    • expires_in
    • token_type

    The application makes a request for resources using the returned access token. All APIs listed for

  4. The application requests credentials. The credentials you pass are different depending on if you want to access public or restricted data (see above).
  5. The application sends a request to the service using the credentials you provided as a query string for the body. 

    • grant_type=password
    • username
    • password
  6. The service responds with access token details and expiration information.

    • access_token
    • expires_in
    • token_type

    The application makes a request for resources using the returned access token. All APIs listed for accessing public data also support secure access to restricted data with an additional parameter for the access token. 

Testing an API with Public Data

If you don't have a TCIA account and want to test an API, you can access public data using the NBIA guest account with no password, as follows.

Code Block
titleNBIA REST API Call for Testing an API without a Token
curl -d "username=nbia_guest&password=&client_id=NBIA&grant_type=password" -X POST -k https://services.cancerimagingarchive.net/nbia-api/oauth/token

How a Token is Returned/Granted/Given

...