API Example

📘

BEARER TOKEN LIFESPAN

The lifespan of a Bearer token is one hour (3600 seconds) for both sandbox and production environments.

To try our APIs, you can either use your own development platform/tool or the Try It interface in our developer portal.

Using your own development platform/tool

Run the following in your platform with your sandbox credentials provided by Optum.

curl --request POST \
     --url https://sandbox-apigw.optum.com/apip/auth/v2/token \
     --header 'accept: */*' \
     --header 'content-type: application/json' \
     --data '
{
  "client_id": "your client ID",
  "client_secret": "your secret",
  "grant_type": "client_credentials"
}

Here is an example output:

Using interactive Try It interface

  1. Go to API reference's Try It page.
  2. For example, to generate a Bearer token, click API Tools in the developer portal.
  3. Click /apip/auth/v2/token.
  4. Use your sandbox client Id and client secret provided by Optum in their respective fields, and use client_credentials in the grant_type field and click Try It.
2174

Try It Feature

Related Topics