Obtain access token

View as Markdown
If using the Client Credentials method, Samvaad will call this endpoint to exchange its **Client ID** and **Client Secret** for a short-lived JWT Bearer token. Samvaad will authenticate to this endpoint using **HTTP Basic Authentication**. The returned access token will be cached and used in the `Authorization` header for all subsequent API calls until it expires. **Note:** This endpoint is not needed if you opt for the static API Key authentication method.

Authentication

AuthorizationBasic

HTTP Basic authentication for the /auth endpoint, using the Client ID as the username and the Client Secret as the password.

Headers

x-request-idstringRequiredformat: "uuid"

A unique identifier for this specific API call, generated by the client (Samvaad).

x-trace-idstringOptionalformat: "uuid"
An identifier to trace a single request across multiple services.
x-request-timestampdatetimeRequired
The ISO 8601 timestamp of when the client sent the request.

Request

The request body must specify the grant type as ‘client_credentials’.

grant_typestringRequired

The OAuth2 grant type. Must be client_credentials.

Response headers

X-Request-Idstring
A unique identifier for the request, generated by your service.
X-Trace-Idstring

The identifier for an end-to-end operation, passed from the client to be echoed in the response.

X-Request-Durationinteger
The time in milliseconds the server took to process the request.
X-Response-Timestampstring
The ISO 8601 timestamp of when the response was generated.

Response

Authentication successful. Returns a JWT access token.
dataobject
The response from a successful authentication request.

Errors

400
Bad Request Error
401
Unauthorized Error
422
Unprocessable Entity Error
500
Internal Server Error