Skip to main content
Version: Lastest

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

ParametersRequirementData typeDescriptionNote
Content-TyperequiredStringValue: application/json
{
"Content-Type": "application/json"
}

Request Params

ParametersRequirementData typeDescriptionNote
client_keyrequiredStringThe API_KEY provided by AppotaPay
secret_keyrequiredStringThe SECRET_KEY provided by AppotaPay
grant_typerequiredStringDefault: authorization_code
refresh_tokenrequiredStringThe 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

ParametersData typeDescriptionNote
codeIntegerError code
dataObjectData details
data.access_tokenStringThe Access Token of the Appota system
data.token_typeStringToken typeDefault: Bearer
data.refresh_tokenStringThe Refresh Token of the Appota system.
data.expiry_inIntegerThe expiration time of the access tokenUnix timestamp
data.refresh_token_expiry_inIntegerThe expiration time of the refresh tokenUnix timestamp

Error

HTTP Status Code != 200

ParametersData typeDescriptionNote
codeIntegerError code
messageStringDescription of the error