API Refresh Token
This API is used to retrieve a new ACCESS_TOKEN in case the current ACCESS_TOKEN has expired. After successfully calling to retrieve the refresh token, the old refresh token will no longer be valid.
EndPoint
POST
/api/v1/oauth/refresh_token
Header Params
Parameters | Requirement | Data type | Description | Note |
---|---|---|---|---|
Content-Type | required | String | Value: application/json |
{
"Content-Type": "application/json"
}
Request Params
Parameters | Requirement | Data type | Description | Note |
---|---|---|---|---|
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 | |
refresh_token | required | String | The refresh token is returned in the Wallet Account Access Token Retrieval API |
Example Request
{
"client_key": "1VXlZjO7vY7BJokQyaGbA5b3C9eT040pEdQq",
"secret_key": "R3cIrn81uYHgNLPOeqrFoCtG8UzJ",
"grant_type": "authorization_code",
"refresh_token": "R3cIrn81uYHgNLPOeqrFoCtG8UzJ1VXlZjO7vY7"
}
Response Params
{
"code": 200,
"data": {
"access_token": "c3ec19b7a8d93a7ee7be88aa2f2be328",
"token_type": "Bearer",
"refresh_token": "c09eb4ed6c65d152de9fcd74fdfe9cce",
"expiry_in": 1659411793,
"refresh_token_expiry_in": 1659411793
}
}
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 | Token type | 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 | Note |
---|---|---|---|
code | Integer | Error code | |
message | String | Description of the error |