Generate Access Token
Berikut adalah proses untuk mendpakan access token
| KEY | Detail |
|---|---|
| URL | https://pg-v2.digitalazhar.id/client/auth/generate-access-token |
| Method | POST |
| Headers | |
| Content-Type | Application/json |
| X-CLIENT-KEY | CLIENT ID |
| X-CLIENT-SECRET | CLIENT SECRET |
| Body | |
| grantType | client_credentials |
CURL Example
curl --location 'https://pg-v2.digitalazhar.id/client/auth/generate-access-token' \
--header 'X-CLIENT-KEY: [CLIENT-ID]' \
--header 'X-SECRET: [CLIENT-SECRET]' \
--header 'Content-Type: application/json' \
--data '{
"grantType": "client_credentials"
}'
Response Example (Success)
{
"success": true,
"code": "SUCCESS",
"message": "Access token created successfully",
"token": "long-token-goes-here",
"token_type": "bearer",
"expires_in": "360"
}
Response Example (Failed)
{
"status": 404,
"message": "Client not found",
"code": "CLIENT_NOT_FOUND",
"errors": [
"Client not found"
]
}