POST /adminczar/api/v1/oauth2/token

Exchange client credentials for an access token using OAuth2 client credentials grant flow. Note: This endpoint is accessed at the admin server: https://admin.pattern.com/adminczar/api/v1/oauth2/token

application/json

Body

  • grant_type string Required

    The grant type - must be "client_credentials"

  • client_id string Required

    The client identifier issued to the client

  • client_secret string Required

    The client secret issued to the client

Responses

  • 200 application/json

    Access token issued successfully

    Hide response attributes Show response attributes object
    • access_token string

      The access token to use for authenticated requests

    • token_type string

      The token type (typically "Bearer")

    • expires_in integer

      The lifetime of the access token in seconds

  • 400 application/json

    Invalid request parameters

    Hide response attributes Show response attributes object
    • error string

      Error code

    • error_description string

      Human-readable error description

  • 401 application/json

    Invalid client credentials

    Hide response attributes Show response attributes object
    • error string

      Error code

    • error_description string

      Human-readable error description

POST /adminczar/api/v1/oauth2/token
curl \
 --request POST 'https://api.useshelf.com/adminczar/api/v1/oauth2/token' \
 --header "Content-Type: application/json" \
 --data '{"grant_type":"client_credentials","client_id":"\u003cclient_id\u003e","client_secret":"\u003cclient_secret\u003e"}'
Request examples
{
  "grant_type": "client_credentials",
  "client_id": "<client_id>",
  "client_secret": "<client_secret>"
}
Response examples (200)
{
  "access_token": "string",
  "token_type": "Bearer",
  "expires_in": 3600
}
Response examples (400)
{
  "error": "invalid_grant",
  "error_description": "The provided credentials are invalid"
}
Response examples (401)
{
  "error": "invalid_client",
  "error_description": "Client authentication failed"
}