Skip to main content
Version: Lastest

API Get Access Token

EndPoint

POST /api/v1/oauth/access_token

Header Params

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

Request Params

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

ParametersData typeDescriptionNote
codeIntegerError code
dataObjectData details
data.access_tokenStringThe Access Token of the Appota system
data.token_typeStringThe type of tokenDefault: 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 typeDescription
codeIntegerError code
messageStringDescription of the error