POST /oauth/token
Obtains access tokens for server-to-server API calls using the OAuth 2.0 Client Credentials grant type.
Required Headers
Basic authentication in the format:
Basic Base64(client_id:client_secret)SHA256withRSA algorithm signature:
algorithm=RSA256, keyVersion=1, signature=****Identifier provided by A+ (e.g.,
2022091495540562874792)RFC3339 formatted timestamp accurate to seconds
application/json; charset=UTF-8Request Parameters
Fixed value:
client_credentialsPermission scope. Use
openid for Mini Program scenarios.Response Parameters
Standard result object with
resultCode, resultStatus, resultMessageBearer token for subsequent API calls.
Always
Bearer.Token validity period in seconds.
Granted permission scopes.
Result Codes
| resultStatus | resultCode | Description |
|---|---|---|
S | SUCCESS | Request successful |
F | PARAM_ILLEGAL | Missing or invalid required parameter |
F | INVALID_AUTH_CLIENT | Client authentication failed |
F | UNSUPPORTED_GRANT_TYPE | Unsupported grantType value |
F | ACCESS_DENIED | Missing or invalid authorization header |
F | INVALID_SCOPE | Invalid scope value |
U | UNKNOWN_EXCEPTION | Server error occurred |