Authentication

Credentials

To get access to the API and authorize, you need the following credentials: client_id, client_secret, username, password.

All these credentials will be provided to you by the The Downtown Travel API support team. Please contact [email protected] to request a set of credentials.

Authorization

To get access to the Core APIs methods, please use the Token endpoint from the Authentication section. It allows to get or refresh user access token.

User Access Tokens: Usage, Expiry, and Refresh Strategies

Optimize Token Usage

Reuse Access Tokens until they expire. Avoid requesting a new token for every call to save time and reduce authorization server load.

Handle Token Expiry

  • Error Handling: If you receive a 401 error, the token is expired or invalid. Refresh it immediately.
  • Expiration Tracking: Use the expires_in value from the token response to track its lifespan and refresh before it expires to ensure smooth operations.

Refresh Tokens Efficiently

Refresh expired Access Tokens using Refresh Tokens instead of creating new Access Tokens each time. This minimizes risks and improves performance. Each Refresh Token is single-use and generates a new token pair.

Prevent parallel refresh attempts for the same token to avoid conflicts.

Manage Token Pools

For multithreaded setups, use a shared pool of tokens. Monitor their validity and refresh them as needed to keep all threads running seamlessly.