Grant authentication token

Retrieve a JWT-compliant access token for use with all other endpoints.


📘

All tokens currently expire after 24 hours (86,400 seconds), but we suggest refreshing tokens every 12 hours (43,200 seconds).

Here's an example of using the returned token in an API call:

curl \
  --url "https://api.ocrolus.com/v1/books" \
  --oauth2-bearer "eyJhbGciOiJ...2hUye_4CpIvQ"

See our guide on using API credentials for more details.

This endpoint is OAuth 2.0-compliant. A successful response from this endpoint adheres to the structure given in RFC 6749, section 5.1, while a failed response adheres to the structure given in section 5.2. As a consequence, you can use this endpoint in OAuth 2.0 clients and libraries without needing to explicitly call it in your own code.

Body Params
string
enum
required
Defaults to client_credentials

The OAuth 2.0 grant type for the returned token. Must have a value of client_credentials, as we don't offer other grant types at this time.

Allowed:
string
enum

The domain in which the token will be used. We currently only support the value of https://api.ocrolus.com/ (including the trailing /).

Allowed:
string
required

The client ID that was generated from the Ocrolus Dashboard.

string
required

The client secret associated with the client ID that was generated from the Ocrolus Dashboard.

Responses

Language
Response
Choose an example:
application/json