Authentication
Summary
Authentication method to access SkyJoy APIs
Methods
Retrieve Access Token
POST https://id.skyjoy.vn/realms/loyalty-partner/protocol/openid-connect/token
Parameters
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
| client_id | string | body | Yes | Client ID |
| client_secret | string | body | Yes | Client secret |
| username | string | body | Yes | Client username |
| password | string | body | Yes | Client password |
| grant_type | string | body | Yes | Grant type |
| Content-Type | string | header | No | x-www-form-urlencoded |
sh
curl -X POST \
--header 'Content-Type: x-www-form-urlencoded' \
--data-urlencode 'client_id=<your client id>' \
--data-urlencode 'client_secret=<your client secret>' \
--data-urlencode 'username=<your client username>' \
--data-urlencode 'password=<your client password>' \
--data-urlencode 'grant_type=<your grant type>' \
'https://id.skyjoy.vn/realms/loyalty-partner/protocol/openid-connect/token'Refresh Token
POST https://id.skyjoy.vn/realms/loyalty-partner/protocol/openid-connect/token
Parameters
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
| client_id | string | body | Yes | Client ID |
| client_secret | string | body | Yes | Client secret |
| grant_type | string | body | Yes | Grant type |
| refresh_token | string | body | No | Refresh token |
| Content-Type | string | header | No | x-www-form-urlencoded |
sh
curl -X POST \
--header 'Content-Type: x-www-form-urlencoded' \
--data-urlencode 'client_id=<your client id>' \
--data-urlencode 'client_secret=<your client secret>' \
--data-urlencode 'grant_type=<your grant type>' \
--data-urlencode 'refresh_token=<your refresh token>' \
'https://id.skyjoy.vn/realms/loyalty-partner/protocol/openid-connect/token 'Exchange Token
POST https://api.skyjoy.vn/api-identity/public/v1/exchange-token
Parameters
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
| token | string | body | Yes | Partner token. It is a JWT token signed by partner private key |
| Content-Type | string | header | Yes | application/json |
sh
curl -X POST \
--header 'Content-Type: application/json' \
-d '{"token":"eyJhbGciOiJSUzI1NiIsInR5cCIgOiAi..."}' \
'https://api.skyjoy.vn/api-identity/public/v1/exchange-token'