Generate Token

Generate Token

The generate token API endpoint is designed to issue authentication tokens necessary for engaging with Accountability's API. These tokens, integral to making further API calls, are created when you supply your username, password, and tenant ID.

For token creation, your request must include certain credentials, each serving a distinct purpose:

ParameterDescription
grant_typeDetermines the authentication strategy. Options 'password' and 'refresh_token' are available, with 'password' set as the standard default.
usernameShould be the email address you use to sign into the platform.
passwordThis is the key you've generated within the Accountability system, retrievable through My settings > API Account Credentials > API Token.
tenant_idThis is a unique identifier assigned to your account. If you need to locate your Tenant ID, please raise a support ticket within the Accountability system.
refresh_tokenThis is essential only when you opt for the 'refresh_token' grant type. It's used to acquire a new token after the first token's validity has lapsed.

It's important to note that if you are utilizing the 'refresh_token' grant type, this is the sole parameter you need to include in your request. Username, password, and tenant ID are not required in this instance. A refresh token is valid for up to 30 days, and authentication grants an access window of 3600 seconds, regardless of the grant type.

Once you provide these parameters, the token API endpoint will generate a token that can be used for subsequent API requests.

For all other API endpoints, include the "Authorization" header with the access_token in this format: Bearer access_token.

Language
Credentials
Header
URL
Click Try It! to start a request and see the response here!