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.

  • client_id
    Type: string

    The client identifier issued to you when your API credentials were created.

  • client_secret
    Type: string

    The client secret paired with your client_id. Keep this confidential and never expose it in client-side code.

  • grant_type
    enum
    const:  
    client_credentials

    The 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
}

Grand Public API