To be authenticated a request to OKAPI should carry an access token in its headers.
Request an Access token
Content-Type | application/x-www-form-urlencoded |
To obtain access to the OKAPI HTTP service we use the OAuth2 client credentials
grant
to provide an access_token
.
The access_token
provides access to the
OKAPI
services. It expires after one hour.
Please ensure that your backend application handles the
lifecycle of the access token.
More information about access_tokens
can be found in the official OAuth spec: https://tools.ietf.org/html/rfc6749#section-1.4.
To request the access_token
you have to provide the client_id
and your client_secret
.
You will need the access_token
for every subsequent request to okapi. It will
expire after one hour.
Example Request with cURL
Adding token to the request
To authorise the request the access token should be added to the header with the key "Authorization". The value should be the access prefixed with the marker "Bearer".
Authorization | Bearer {access_token} |
Accept | application/json |
Example Request with cURL