Authentication

Oracle Intelligent Track and Trace uses application token and access token based authentication.

The application token service provided by Oracle Intelligent Track and Trace is a mechanism that enables you to use a secured token to access Oracle Intelligent Track and Trace REST endpoints.

Generate the Application Token From Oracle Intelligent Track and Trace UI

A registered user of Oracle Intelligent Track and Trace can obtain an application token . See Generate an Application Token.

Obtain an Access Token

To obtain an access token, use the REST endpoint /accesstoken with the application token.

curl -k -X POST -H "Content-type:
      application/json"  -d '{"applicationToken": "your-application-token"}'
        "https://oitt-application-url/bca/api/userManagement/v1/networks/local/accessTokens"

Where:

  • your-application-token is the application token generated in the Oracle Intelligent Track and Trace UI as mentioned in the preceding section
  • oitt-application-url is your Oracle Intelligent Track and Trace instance URL

For example:

curl -k -X POST -H "Content-type:application/json" 
               -d '("applicationToken": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwczovL3ByYXNlbjEtdGVzdC5mcmFkZXYuYmNhZGV2Lm9yYWNsEA==")'
                    "https://accountname.iad.bca.ocs.oraclecloud.com/bca/api/bca/api/userManagement/v1/networks/local/accessTokens"

The following shows an example of the response returned.

{           "accessToken":
        "eyJ4NXQjUzI1NiI6IlkwbzJPVUpkVklIV1BnbzNXZjNDWnhSSVVpMklIb3lCNzdSVEdDd1....V4VFUiLCJ4NXQiO",
          "applicationToken":
        "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwczovL3ByYXNlbj.....EtdGVzdC5mWNsEA==",
          "expiresIn": 3599         }

Note:

The token string is truncated in the examples. You should copy the entire token string (within the quotation marks) as shown in your response.

Use the Access Token in Oracle Intelligent Track and Trace REST API Requests

After you obtain an access token, you provide the token in a bearer token header of the Oracle Intelligent Track and Trace REST request.

curl -i -X GET -H "Authorization: Bearer token-string" "https://primary-audience/rest-endpoint-path"

Where:

  • token-string is the access token you obtained
  • primary-audience is the Oracle Intelligent Track and Trace instance URL
  • rest-endpoint-path is the relative path that defines the Oracle Intelligent Track and Trace REST resource

For example, the following cURL command submits a document.

curl -i -X POST -H "Content-type: Application/JSON" -H "Authorization: Bearer eyJ7NXQ...fMf46Q0yKopDxQ" -d "@document.json" "https://accountname.iad.bca.ocs.oraclecloud.com/bca/api/documentReceiver/v1/networks/local/flows/12/steps/3."