Step 3: Get a token
POST {{authPath}}/{{envID}}/as/token
The token endpoint is used by the client to obtain an access token by presenting its authorization grant. For client_credentials
grants, the application calls the POST /{{envID}}/as/token
endpoint to acquire the access token. The request body must include values for the following properties:
grant_type
A string that specifies the grant type of the token request. In this example, the value is authorization_code
.
Note: The request requires basic authentication, in which the application ID from Step 1 and the application secret from Step 2 are used to authenticate. In a curl command, you can use the --user
parameter to satisfy the basic authentication requirement like this: --user "{{appID}}:{{appSecret}}"
.
The response data contains the access token.
Request Body
[{"name"=>"grant_type", "value"=>"client_credentials", "datatype"=>"string"}, {"name"=>"client_id", "value"=>"", "datatype"=>"null"}, {"name"=>"client_secret", "value"=>"", "datatype"=>"null"}]
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
Authorization | string | ||
Content-Type | string |