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
| Feature | Details |
|---|---|
| Purpose | Authenticate your account and generate an access token. |
| Endpoint | One POST endpoint, /token/oauth. |
| Credentials | Your username and password, sent with HTTP Basic authentication. |
| Token | A signed JSON Web Token (JWT), used as a Bearer token. |
| Token lifetime | 60 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
- Prepare your credentials. Combine your username and password as
username:password, and Base64-encode them. - Request a token. Send them in a
POSTrequest to the token endpoint. - Use the token. Send it as a
Bearertoken in theAuthorizationheader of each request to the other APIs. - Refresh it. When the token expires, request a new one.
In This Guide
| Section | What You'll Find |
|---|---|
| Getting Started | The workflow for getting your first token. |
| Core Concepts | Credentials, tokens and token lifetime. |
| Get an Access Token | Request a token and read the response. |
| Manage Tokens | Reuse tokens, track expiry and refresh them. |
| Quick Lookup | Reference for API Inputs and Error Messages. |
| FAQs | Answers to common questions. |
| Troubleshooting | Fixes for common problems. |
Related APIs
Every other Direct Web Services API needs the token that this API provides.
- Universe API to retrieve your entitled universe.
- Investment Details API and Investment Details Feed API for detailed investment data.
- Investment List API for tabular, list-based data.
- Time Series API for historical data.
- Screener APIs to find investments by criteria.
- Portfolio X-Ray API for portfolio analysis.