Get access token
Exchange client credentials for a Bearer token using the OAuth 2.0 client_credentials flow.
Body·
required
application/json
Request body for the OAuth 2.0 client-credentials token endpoint. Submit your API client credentials to obtain a short-lived Bearer access token.
- Type: stringclient
_id The client identifier issued to you when your API credentials were created.
- Type: stringclient
_secret The client secret paired with your
client_id. Keep this confidential and never expose it in client-side code. - enumgrant
_type const:client_credentialsThe OAuth 2.0 grant type. Must be the literal value
client_credentials.values- client
_credentials
Responses
- application/json
- 401
Invalid client credentials
Request Example for post/v1/oauth/token
curl https://public-api.prettydecent.link/v1/oauth/token \
--request POST \
--header 'Content-Type: application/json' \
--data '{
"client_id": "1example23clientid456",
"client_secret": "s3cr3t-example-value",
"grant_type": "client_credentials"
}'
{
"access_token": "eyJraWQiOiJleGFtcGxlIiwiYWxnIjoiUlMyNTYifQ...",
"token_type": "Bearer",
"expires_in": 3600
}