curl -X POST "<base_url>/auth/v2/accessToken" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json" \
-d "grantType=secret&secretKey=YOUR_SECRET_KEY"
curl -X POST "<base_url>/auth/v2/accessToken" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json" \
-d "grantType=refresh&refreshToken=YOUR_REFRESH_TOKEN"
{
"header": {
"code": 1,
"message": "Access token created successfully!",
"response_code": 1
},
"body": {
"accessToken": "string",
"refreshToken": "string",
"expiry": 3600,
"resellerId": "string",
"resellerUid": "string"
}
}
Overview
API Access Authentication
Exchange your Secret Key for an Access Token, and refresh it when it expires.
POST
/
auth
/
v2
/
accessToken
curl -X POST "<base_url>/auth/v2/accessToken" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json" \
-d "grantType=secret&secretKey=YOUR_SECRET_KEY"
curl -X POST "<base_url>/auth/v2/accessToken" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json" \
-d "grantType=refresh&refreshToken=YOUR_REFRESH_TOKEN"
{
"header": {
"code": 1,
"message": "Access token created successfully!",
"response_code": 1
},
"body": {
"accessToken": "string",
"refreshToken": "string",
"expiry": 3600,
"resellerId": "string",
"resellerUid": "string"
}
}
Send a live request to
POST /auth/v2/accessToken with Try it. See the full reference for the response fields and error codes: API Access Authentication.
Request Body
string
required
How the Access Token is granted. One of
secret or refresh.string
Secret Key from the Partner Console. Required when
grantType is secret.string
Refresh Token returned by a previous call to this endpoint. Required when
grantType is refresh.curl -X POST "<base_url>/auth/v2/accessToken" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json" \
-d "grantType=secret&secretKey=YOUR_SECRET_KEY"
curl -X POST "<base_url>/auth/v2/accessToken" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json" \
-d "grantType=refresh&refreshToken=YOUR_REFRESH_TOKEN"
{
"header": {
"code": 1,
"message": "Access token created successfully!",
"response_code": 1
},
"body": {
"accessToken": "string",
"refreshToken": "string",
"expiry": 3600,
"resellerId": "string",
"resellerUid": "string"
}
}