Skip to main content

Authentication REST

REST API · openapi/partner-api/openapi.yaml · 1 operation

Authenticate Partner and get an Access Token

Production
partner.api.sasha.eu

Get an access token​

POST/oauth/token

GetToken

Authenticate Partner and get an Access Token.

The request should contain the Client ID and Client Secret passed as Basic Authentication credentials.

Authentication
HTTP Basic
Source
openapi/partner-api/openapi.yaml

Request body

required

Get Token Request

application/x-www-form-urlencodedGetTokenRequest
  • grant_typestringrequired
    The grant type. Must be "client_credentials".

Responses

  • 200Successful operation

    Headers

    • SASHA-Request-IDstringoptional
      The identifier of this request, set on every response. Quote it when contacting SASHA support: it is what joins your call to the server-side logs. On an error response the same value is repeated in the payload's request_id.
    application/jsonGetTokenResponse
    • access_tokenstringrequired
      An access token that can be provided in subsequent calls, for example, to SASHA Partner API services.
    • token_typestringrequired
      How the access token may be used. Always "Bearer".
    • expires_inintegerrequired
      The time period (in seconds) for which the access token is valid.
  • 400The request is malformed. error is unsupported_grant_type when grant_type names a grant type other than client_credentials, and invalid_request for any other problem, e.g. a missing grant_type or a body that cannot be parsed.

    Headers

    • SASHA-Request-IDstringoptional
      The identifier of this request, set on every response. Quote it when contacting SASHA support: it is what joins your call to the server-side logs. On an error response the same value is repeated in the payload's request_id.
    application/jsonAuthErrorResponse
  • 401Client authentication failed, e.g. the Authorization header is missing, does not use the Basic scheme, or does not hold both the Client ID and the Client Secret. error is invalid_client.

    Headers

    • SASHA-Request-IDstringoptional
      The identifier of this request, set on every response. Quote it when contacting SASHA support: it is what joins your call to the server-side logs. On an error response the same value is repeated in the payload's request_id.
    • WWW-Authenticatestringoptional
      The authentication scheme the endpoint accepts. Always Basic realm="SASHA Partner API".
    application/jsonAuthErrorResponse
  • 403The Client ID and Client Secret were not accepted: the client is unknown, the secret does not match, or the client may not obtain an access token. error is unauthorized_client.

    Headers

    • SASHA-Request-IDstringoptional
      The identifier of this request, set on every response. Quote it when contacting SASHA support: it is what joins your call to the server-side logs. On an error response the same value is repeated in the payload's request_id.
    application/jsonAuthErrorResponse
  • 413The request body is larger than the server accepts. A media file uploaded as multipart/form-data that is too large is answered with 400 instead.

    Headers

    • SASHA-Request-IDstringoptional
      The identifier of this request, set on every response. Quote it when contacting SASHA support: it is what joins your call to the server-side logs. On an error response the same value is repeated in the payload's request_id.
    application/jsonErrorResponse
  • 500An unexpected error occurred on the server. error is server_error.

    Headers

    • SASHA-Request-IDstringoptional
      The identifier of this request, set on every response. Quote it when contacting SASHA support: it is what joins your call to the server-side logs. On an error response the same value is repeated in the payload's request_id.
    application/jsonAuthErrorResponse
  • 503The server is temporarily unable to issue an access token. error is server_error. The request can be retried, preferably after a short wait.

    Headers

    • SASHA-Request-IDstringoptional
      The identifier of this request, set on every response. Quote it when contacting SASHA support: it is what joins your call to the server-side logs. On an error response the same value is repeated in the payload's request_id.
    application/jsonAuthErrorResponse