API Get Access Token
EndPoint
POST
/api/v1/oauth/access_token
Header Params
Parameters | Requirement | Data type | Description |
---|---|---|---|
Content-Type | required | String | Value: application/json |
{
"Content-Type": "application/json"
}
Request Params
Parameters | Requirement | Data type | Description |
---|---|---|---|
client_key | required | String | The API_KEY provided by AppotaPay |
secret_key | required | String | The SECRET_KEY provided by AppotaPay |
grant_type | required | String | Default: authorization_code |
code | required | String | The code parameter returned to the Callback URL |
Example Request
{
"client_key": "1VXlZjO7vY7BJokQyaGbA5b3C9eT040pEdQq",
"secret_key": "R3cIrn81uYHgNLPOeqrFoCtG8UzJ",
"grant_type": "authorization_code",
"code": "R3cIrn81uYHgNLPOeqrFoCtG8UzJ1VXlZjO7vY7"
}
Response Params
{
"code": 200,
"data": {
"access_token": "c3ec19b7a8d93a7ee7be88aa2f2be328",
"token_type": "Bearer",
"refresh_token": "c09eb4ed6c65d152de9fcd74fdfe9cce",
"expiry_in": 1659411793,
"refresh_token_expiry_in": 1706686919
}
}
Success
Http Status Code
200
-OK
Parameters | Data type | Description | Note |
---|---|---|---|
code | Integer | Error code | |
data | Object | Data details | |
data.access_token | String | The Access Token of the Appota system | |
data.token_type | String | The type of token | Default: Bearer |
data.refresh_token | String | The Refresh Token of the Appota system. | |
data.expiry_in | Integer | The expiration time of the access token | Unix timestamp |
data.refresh_token_expiry_in | Integer | The expiration time of the refresh token | Unix timestamp |
Error
HTTP Status Code !=
200
Parameters | Data type | Description |
---|---|---|
code | Integer | Error code |
message | String | Description of the error |