Skip to main content
Use OAuth 2.0 Client Credentials to authenticate machine-to-machine API requests from your systems to Bango DVM™. Bango provisions your integration credentials. Your systems retrieve access tokens, cache them, and send them with supported API requests. OAuth 2.0 Client Credentials is the default and recommended authentication method for enterprise DVM integrations. Use the authentication method supported by your API and configured for your integration.

Before you start

  • Bango provisions DVM OAuth 2.0 credentials for your integration during the onboarding process.
  • Obtain the client_id and client_secret for the environment you are connecting to.
  • Use the token endpoint for the same environment as the DVM API you intend to call.
  • Your application is responsible for requesting and managing its access tokens.
For credential provisioning, contact Bango through your onboarding process. See DVM onboarding and Set up authentication.
Do not mix Sandbox and Production credentials, tokens, or API endpoints. Keep client secrets and access tokens out of source code, URLs, logs, and client-side applications.

Token endpoints

Request an access token

Send an HTTPS POST request to the token endpoint with an application/x-www-form-urlencoded body containing these fields: Example using Sandbox:
Use the Production token endpoint and Production credentials for Production.
The values in angle brackets are placeholders, not valid credentials.

Handle the token response

A successful token request returns HTTP 200 OK with an access token, token type, and validity period.
The value 3599 is illustrative, not a fixed token lifetime. Use the expires_in value in each token response to calculate when that token expires.

Use the token with DVM APIs

Include the access token in the Authorization header of requests to DVM APIs that support OAuth 2.0:
You can use the same OAuth 2.0 access token when calling these DVM API service families, subject to the permissions configured for your integration:
  • Entitlements API
  • Products and Offers API
  • Consumer Offers API
  • Billing Public API
  • Partner Services Eligibility API
A token does not grant access to every API operation. Your configured integration and API permissions still determine what you can call. Use the endpoint and contract for the relevant API family.

Cache and renew tokens

Cache the access token rather than requesting one for every DVM API call. Track its remaining lifetime from the expires_in value.
  1. Reuse your cached token while it has at least one minute of validity remaining.
  2. When the remaining validity is less than one minute, request another token.
  3. Replace the cached token with the token returned and update its expiry information.
The token service returns the existing access token while it remains valid for at least 60 seconds. When fewer than 60 seconds remain, the service issues a new token. Use the token returned by the service whether it is reused or newly issued; a token request does not necessarily produce a different token.

Handle token errors

The token endpoint returns the following HTTP errors and response codes:

Test in Sandbox

  1. Obtain Sandbox credentials through your DVM integration setup.
  2. Request a token from the Sandbox OAuth 2.0 endpoint.
  3. Confirm that the response contains a Bearer token and expires_in.
  4. Call an API operation enabled for your integration with Authorization: Bearer <ACCESS_TOKEN>.
  5. Confirm that your application reuses its cached token and renews it before expiry.
Before moving to Production environment, confirm that your application uses Production credentials and endpoints, handles token errors without exposing credentials, and meets the testing requirements for its integration. For broader API environment and integration conventions, see Working with DVM APIs. For human access to DVM applications, see Set up authentication.