Generate bearer token
Bearer token is a type of access token that is used in the authentication and authorisation processes for APIs. It is a string that provides the user or system the identity to access sensitive resources or actions on a server. Bearer tokens are commonly used in the token-based authentication systems, such as OAuth2.
Generating a bearer token is essential for securely managing access to APIs, allowing for robust authentication mechanisms while maintaining a stateless, scalable architecture.
Note
This section explains the process of generating the bearer token via the Postman application. You may use other platforms to generate the bearer token, if applicable.
To generate the bearer token via the Postman application, follow the instructions as explained in the following procedure.
- Launch the Postman application or log in into your Postman account. If you have selected the online version, make sure to activate your account.
Tip
If you do not have the Postman application, you can download it here or register for an online Postman account, respectively.
- After successfully logging in, on your workspace toolbar, select New > HTTP . Alternatively, on your workspace, select + tab to add a new HTTP request tab.

Creating new HTTP request in Postman
- In the new request tab that opens, from the left dropdown menu, select POST and enter the following URL in the Enter request URL field.

Entering URL
- Now, select the Body tab and then click the x-www-form-urlencoded option. In the table that appears, enter the following key-value pairs in the KEY column:
- client_id
- client_secret
- grant_type
After, in the VALUE column, enter the credentials generated via the SAPIENT API Credentials functionality. For the grant_type key, set the value to client-credentials.

Adding keys value pairs
- After entering the necessary information, select Send.
- If the credentials match the ones that have been set in the Create API Credentials functionality, then the bearer token is returned in the response.

Bearer token response example
- The expires in value in the preceding token response indicates the duration for which the token remains valid, measured in seconds. For example, a value of 3600 seconds corresponds to 60 minutes of validity.
Important
Please ensure you cache the authentication token and check for expiry before requesting a new one.

Bearer token sample
Once the bearer token has been generated successfully, you can now use it for authentication purposes.
Updated 7 days ago