Download OpenAPI specification:Download
Example API Document
After redirecting to the auth login kit, the user must first log in. After successful login, auth server will return an authCode query string to the specified callback URL.
After that authCode can then be used to make a [POST] request to /auth/token and will response accessToken that use for HTTP authorization.
| callbackUrl required | string Example: callbackUrl=https://shop.praneat.com/product?category=1 Return callbackUrl with authCode |
<html><body><button>เข้าสู่ระบบสมาชิก Praneat Shop</button></body></html>
Create access & refresh token by authentication code
| authCode required | string |
{- "authCode": "N7laOeemkwHK9f8E3VBAvXfXjZwAF64"
}{- "statusCode": 200,
- "message": "Success",
- "data": {
- "accessToken": "1d1021d2aee3d41fee2d2add43456badMFZnrhFhfWotu3Ecuiuka27L56lr!2323",
- "refreshToken": "e10a897yu15f821ab5f08stuart1fc9f245qgUitnFeEvbWq4ZBoemE36DKZABC!5294",
- "expiresIn": 1684894582
}
}Send refresh token to get new access token
| refreshToken required | string |
{- "refreshToken": "1d1021d2aee3d41fee2d2add43456badMFZnrhFhfWotu3Ecuiuka27L56lr"
}{- "statusCode": 200,
- "message": "Success",
- "data": {
- "accessToken": "1d1021d2aee3d41fee2d2add43456badMFZnrhFhfWotu3Ecuiuka27L56lr!2323",
- "refreshToken": "e10a897yu15f821ab5f08stuart1fc9f245qgUitnFeEvbWq4ZBoemE36DKZABC!5294",
- "expiresIn": 1684894582
}
}Verify access token is valid, a backend to backend token verification process can be used. This involves checking the token against the authentication server to ensure that it is still valid and has not expired.
| accessToken required | string |
{- "accessToken": "1d1021d2aee3d41fee2d2add43456badMFZnrhFhfWotu3Ecuiuka27L56lr"
}{- "statusCode": 200,
- "message": "Success"
}Get user data e.g. uuid, name, phone, email, point
{- "statusCode": 200,
- "message": "Success",
- "data": {
- "uuid": "15eb84120b3b11ee",
- "firstname": "Pita",
- "lastname": "Limjaroenrat",
- "phoneNumber": "0987654321",
- "point": 9999,
}
}Send a point that user earn/burn and then return a latest summary point of user to client
| point required | integer <int32> Point that user earn/burn from each source |
| source required | string Enum: "MiniGame1" "Minigame2" "Minigame3" "Minigame4" "DailyLogin" "Tutorial" Source of earn/burn point |
| actionAt required | integer <int64> Unix timestamp of user's source action |
{- "point": 99,
- "source": "MiniGame1",
- "actionAt": 1684894582
}{- "statusCode": 200,
- "message": "Success",
- "data": {
- "point": 9999
}
}