Generate a Bearer Token

📘

BEARER TOKEN LIFESPAN

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

We recommend automating transactions to use the tokens generated over the token lifespan. Obtaining tokens for each transaction is less efficient and does not improve the security criteria for any transactions.

Content-Type: application/json
Authorization: Bearer <Your-Access-Token>

Generate a Bearer token

In interactive Try It! interface

Use the API reference's Try It interface as shown below by using our sandbox predefined values to familiarize yourself with our APIs.

  1. For example, to generate an API Bearer token in the developer portal, go to API Tools.
  2. Click /apip/auth/v2/token.
  3. Use your sandbox credentials provided in the client Id and client secret fields and enter client_credentials in the grant_type field and click Try It.
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"
}'
2174

Generate Bearer Token Try It Feature Example

In your development platform

  1. Download and import our OpenAPI Spec into your platform.
  2. Under the Prior Authorization V1 folder, click the Generate JWT token with payload - Medical Network endpoint.
  3. Click the Body tab and enter your specific API credentials provided by Optum.
  • client_id: your client_id
  • client_secret: your client_secret
  • grant_type: client_credentials
  1. Run the request to generate the Bearer token.

Related Topics


Did this page help you?