Аутентификация Партнёра в системе Яндекс Еды

Метод позволяет Партнёру получить токен авторизации для выполнения push-методов в системе Яндекс Еды.

Примечание

Заголовок Content-type в запросе и ответе отличаются.

Request

POST

/oauth2/token

Body

application/x-www-form-urlencoded
{
  "client_id": "987",
  "client_secret": "g8bKdBiIR9MutCObuexDm7nsgkaXU",
  "grant_type": "client_credentials",
  "scope": "read write"
}

Name

Description

client_id

Type: string

Example: 987

client_secret

Type: string

Example: g8bKdBiIR9MutCObuexDm7nsgkaXU

grant_type

Type: string

Example: client_credentials

scope

Type: string

Example: read write

Responses

200 OK

Успешная аутентификация.

Body

application/json
{
  "access_token": "bqehYcfk7Tb2zKRkxQ-IaK9nHyntdYnlpJ7kwTNX3B6mIKPws",
  "expires_in": 120,
  "scope": "vendor_management",
  "token_type": "bearer"
}

Name

Description

access_token

Type: string

Токен

Example: bqehYcfk7Tb2zKRkxQ-IaK9nHyntdYnlpJ7kwTNX3B6mIKPws

expires_in

Type: integer

Время жизни токена.

scope

Type: string

Example: vendor_management

token_type

Type: string

Тип токена

Example: bearer

401 Unauthorized

Ошибка авторизации.

Body

application/json
{
  "message": "example",
  "code": 0,
  "details": {}
}

Name

Description

code

Type: integer

Код ошибки.

message

Type: string

Сообщение об ошибке.

Example: example

details

Type: object
Example
{}

No longer supported, please use an alternative and newer version.