Skip to content

OAuth Token Operations

Request

This endpoint handles both access token acquisition and token refresh operations based on the grantType parameter.

For Access Token Acquisition (grantType = "authorization_code"): This endpoint enables developers to acquire access token from Keeta.

For Token Refresh (grantType = "refresh_token"): This endpoint enables developers to refresh access token validity period from Keeta platform.

Bodyapplication/jsonrequired
appIdinteger, (int64)required

Unique application ID assigned by Keeta

Example:3340612437
timestampintegerrequired

Unix timestamp (seconds since 1970-01-01)

Example:1740151097
sigstringrequired

Result of the sig calculation

Example:"7713bf15971faf402341bd0a372af7af5d788c25a8b08d7f238314b43a46f768"
grantTypestringrequired

This field represents the mode of the authorization code, and its value should be fixed as "authorization_code".

Value:"authorization_code"
Example:"authorization_code"
Discriminator
codestringrequired

Authorization code

Example:"885000242"
POST
/base/oauth/token
curl -i -X POST \
  https://open.mykeeta.com/api/open/base/oauth/token \
  -H 'Content-Type: application/json' \
  -d '{
    "appId": 3340612437,
    "timestamp": 1740151097,
    "sig": "7713bf15971faf402341bd0a372af7af5d788c25a8b08d7f238314b43a46f768",
    "grantType": "authorization_code",
    "code": "885000242"
  }'

Responses

OAuth token operation result.

Bodyapplication/json
accessTokenstring

The access token serves as the primary credential for authenticating API requests.

Example:"911b56fbc7c14ef397261f5efd1d1b99"
tokenTypestring

This field specifies the type of token issued, with the fixed value "bearer" indicating that the token is a bearer token.

Example:"bearer"
expiresIninteger

The expiration period of the access token, measured in seconds. Tokens remain valid for precisely 90 days (7,776,000 seconds)

Example:7776000
refreshTokenstring

A credential used to obtain new access tokens when the current token nears expiration. Each refresh token may only be used once and becomes invalid immediately after use. The system automatically issues a new refresh token with each access token refresh.

Example:"q11bd86271e844cca7dbc139bb3f00f7"
scopestring

Defines the permissions granted to the token, corresponding to the scopes requested by the client application. The default value "all" grants complete access.

Example:"all"
issuedAtTimeinteger, (int64)

The precise timestamp of token issuance represented as Unix epoch time in milliseconds.

Example:1740151097721
Response
{ "accessToken": "911b56fbc7c14ef397261f5efd1d1b99", "tokenType": "bearer", "expiresIn": 7776000, "refreshToken": "q11bd86271e844cca7dbc139bb3f00f7", "scope": "all", "issuedAtTime": 1740151097721 }