Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Use OAuth 2.0 authorization to get access to API.

How to get an OAuth token

Anchor
How to get an OAuth token
How to get an OAuth token

To authorize and get a token, run the following query 

Code Block
POST https://auth-delivery.ucs.ru/connect/token

with the following parameters (form-data)

parametervalue
client_IDgiven for connection via API
client_secretgiven for connection via API
grant_typeclient_credentials
scopesorders

In response, you'll get a JWT access token and information about token expiration time. 

Add a header for requests in HTTP Headers

It is necessary to use the OAuth token for all the requests.

Code Block
Authorization: Bearer <access_token>

Example

Code Block
Authorization: Bearer eyJhbGciOiJSUzI....aXHgrHV-I

If the token has expired, repeat the abovementioned actions

General rules for requests to API

All the requests, containing JSON in their body, should have the following HTTP header:

Code Block
Content-Type: application/json