Authentication API

Generate access tokens that authorize API calls.

Authentication API

The Authentication API is where you get the access token that every other Direct Web Services API requires. You send your credentials once, receive a signed token, and include the token in each request to the other APIs.

New to the API? Start with Getting Started.

At a Glance

FeatureDetails
PurposeAuthenticate your account and generate an access token.
EndpointOne POST endpoint, /token/oauth.
CredentialsYour username and password, sent with HTTP Basic authentication.
TokenA signed JSON Web Token (JWT), used as a Bearer token.
Token lifetime60 minutes. A token can be reused for any number of requests.

Key Capabilities

  • Authenticate with your credentials and receive a token in one request.
  • Use the same token for any number of requests to the other Direct Web Services APIs during its lifetime.
  • Get the time to expiry with every token, so that you can refresh it before it expires.

How It Works

  1. Prepare your credentials. Combine your username and password as username:password, and Base64-encode them.
  2. Request a token. Send them in a POST request to the token endpoint.
  3. Use the token. Send it as a Bearer token in the Authorization header of each request to the other APIs.
  4. Refresh it. When the token expires, request a new one.

In This Guide

SectionWhat You'll Find
Getting StartedThe workflow for getting your first token.
Core ConceptsCredentials, tokens and token lifetime.
Get an Access TokenRequest a token and read the response.
Manage TokensReuse tokens, track expiry and refresh them.
Quick LookupReference for API Inputs and Error Messages.
FAQsAnswers to common questions.
TroubleshootingFixes for common problems.

Every other Direct Web Services API needs the token that this API provides.