Get access token API
Endpoint
POST /authen/access-token
Description
This API is used to create authentication tokens for all requests to the MISA system
| Header |
Type |
Required |
Description |
| Accept |
string |
Yes |
application/json |
Request body
| Property |
Type |
Required |
Description |
Example |
| publicKey |
string |
Yes |
public key |
+TqAE2ZKH2HfEHTyiYAXQaywEudsLiGgSS4RKsb+BnM= |
| secretKey |
string |
Yes |
secret key |
5d9pkTjSogNPwufuLjUMgop9h74VflNpsjQvWXxEClFWhDtLXM0qmHU+l6PyH1JHFWXWN4OCmOvuWrBYBNqTUw== |
Response
Status Codes
| Status Code |
Description |
Chi tiết |
| 200 |
Success |
Token created successfully |
| 400 |
Bad Request |
Invalid parameter |
| 401 |
Unauthorized |
Public key or secret key information is incorrect |
Response Body
| Property |
Type |
Description |
| accessToken |
string |
bearer token |
| refreshToken |
string |
refresh token |
| expiredIn |
number |
The access token will expire in (s) |
Example
Request
Status 200 OK
curl --request POST \
--url {domain}/api/authen/access-token \
--header 'content-type: application/json' \
--data '{
"publicKey": "+TqAE2ZKH2HfEHTyiYAXQaywEudsLiGgSS4RKsb+BnM=",
"secretKey": "5d9pkTjSogNPwufuLjUMgop9h74VflNpsjQvWXxEClFWhDtLXM0qmHU+l6PyH1JHFWXWN4OCmOvuWrBYBNqTUw=="
}'
Response
{
"accessToken": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwayI6IitUcUFFMlpLSDJIZkVIVHlpWUFYUWF5d0V1ZHNMaUdnU1M0UktzYitCbk09IiwiY2MiOiJtZXVzIiwiYmlkIjoiOTk0YzZmZTUtZGE4My00NDFiLWEwZTgtNTdhNmZlZDk4ZmIyIiwidWlkIjoiZTJlZGZiOGMtZDA2Yi00YjMxLWE2NjktNDBhYTBiOTI2NTVkIiwibmJmIjoxNzQzMzkxMTQyLCJleHAiOjE3NDU5ODMxNDIsImlhdCI6MTc0MzM5MTE0MiwiaXNzIjoiTUlTQUpTQyJ9.38YNAiVhD_7YHcI8yO5u40HNxZ6RHDRrGZK9gbK8ZEA",
"refreshToken": "50Earun4fc7HgbMNoETIH/MUypB8f3IqsteJ5/dFR94=",
"expiredIn": 2592000
}