Skip to content

Get Access Token

Access to the Trust2Connect API is secured via the OAuth 2.0 Client Credentials flow. Before making any requests to protected API resources, your application must obtain a valid access token. This token serves as proof of authentication and authorization.

POST

To obtain an access token, send a POST request to the following authorization endpoint:

POST https://api.trust2connect.ai/api/v1/token

HTTP Basic Authorization requires encoding your credentials (username and password) and including them in the Authorization header of your HTTP request. For our token endpoint, your client_id acts as the username and your client_secret acts as the password.

ParameterTypeRequiredDescription
client_id - usernamestringYesThe unique identifier assigned to your business unit (application) upon registration with Trust2Connect. This acts as your public key for authentication. Provided upon approval of API access
client_secret - passwordstringYesThe confidential secret key associated with your client_id. Must be kept secure and never exposed in client-side code (e.g., in a browser). Provided upon approval of API access

The request to the token endpoint must include the following parameter in the body, sent as application/x-www-form-urlencoded content type:

ParameterTypeRequiredDescription
grant_typetextYesSpecifies the OAuth 2.0 grant type. For the Client Credentials flow, this must be set to client_credentials

curl --location 'https://api.trust2connect.ai/api/v1/token' \
--data-urlencode 'grant_type=client_credentials'
{
"access_token": "gq5mWQ4InJUXJG2yDPyApPZ5CDvt",
"expires_in": 1799,
"token_type": "Bearer",
"client_id": "w37zIFSO4dZhhb7ZlveQ7ZGVHRGZTwTx6Z0M8Alzg7ttInpf"
}