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
requiredGet Token Request
application/x-www-form-urlencodedGetTokenRequest
- grant_
typestringrequired The grant type. Must be "client_credentials".
Responses
- 200Successful operation
Headers
- SASHA-Request-IDstringoptionalThe 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.
errorisunsupported_grant_typewhengrant_typenames a grant type other thanclient_credentials, andinvalid_requestfor any other problem, e.g. a missinggrant_typeor a body that cannot be parsed.Headers
- SASHA-Request-IDstringoptionalThe 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
Authorizationheader is missing, does not use theBasicscheme, or does not hold both the Client ID and the Client Secret.errorisinvalid_client.Headers
- SASHA-Request-IDstringoptionalThe 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-AuthenticatestringoptionalThe 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.
errorisunauthorized_client.Headers
- SASHA-Request-IDstringoptionalThe 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-datathat is too large is answered with400instead.Headers
- SASHA-Request-IDstringoptionalThe 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.
errorisserver_error.Headers
- SASHA-Request-IDstringoptionalThe 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.
errorisserver_error. The request can be retried, preferably after a short wait.Headers
- SASHA-Request-IDstringoptionalThe 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