Create bearer access token
The POST /Auth/connect/token endpoint creates a bearer access token for the provided client credentials.
Most of the example code uses one of the following URLs. To access the API for your region, use the URL with the correct subdomain for your region:
| Region | URL subdomain | Base URL |
|---|---|---|
| EMEA | emea | https://emea.cc.vonage.com |
| USA | nam | https://nam.cc.vonage.com |
| APAC | apac | https://apac.cc.vonage.com |
Request parameters
Required The Example Required All requests to the token endpoint require the Example Required The Example Required The client ID identifies your account to the Example Required The secret is like a password that enables you to use the API with your account. Example None. None.Header parameters
content-type
content-type parameter describes the type of the content that you send in the request body. The token endpoint can only accept URL encoded content so you must set the content-type parameter to application/x-www-form-urlencoded.content-type: application/x-www-form-urlencodedRequest body parameters
grant_type
grant_type parameter in the body of the request. You must set grant_type to ‘client_credentials’. A grant type of client credentials indicates that you are using OAuth 2.0 for authorization.grant_type=client_credentialsscope
scope parameter identifies the API for which you need a bearer access token and what level of access you will have to that API. Multiple scopes are separated by spaces.scope=statsclient_id
token endpoint.client_id=abcdeclient_secret
client_secret=12345Path parameters
Query string parameters
Example request
curl -X POST \ https://emea.cc.vonage.com/Auth/connect/token \ -H 'content-type: application/x-www-form-urlencoded' \ -d 'grant_type=client_credentials&client_id=abcde&client_secret=12345&scope=agents-availability%3Aread'
Responses
Responses contains the new bearer access token.
Successful response
Successful requests return a 200 Success code and the token.
Example response
{
"access_token": "abcde12345",
"expires_in": 900,
"token_type": "Bearer"
}
For information, see Trying out Vonage Contact Center APIs.