Getting available chats

The method is available for all models.

If you are using an API Key token, one of the accesses in the list is required to call the method
  • communication — Customer communication
  • all-methods — Full account management
  • all-methods:read-only — View all data

Returns chats with customers.

Enable API notifications

Yandex.Market will send you a request. POST notification when a new chat or message appears.

How to work with notifications

Restriction for the parameter limit

Do not pass a value greater than 20.

⚙️ Limit: 10,000 requests per hour

Request

POST

https://api.partner.market.yandex.ru/v2/businesses/{businessId}/chats

Path parameters

Name

Description

businessId*

Type: integer<int64>

Cabinet ID. To find out, use the request GET v2/campaigns.

ℹ️ What is a cabinet and a store on the Market?

Min value: 1

Query parameters

Name

Description

limit

Type: integer<int32>

The number of values per page.

Min value: 1
Example: 20

page_token

Type: string

ID of the results page.

If the parameter is omitted, the first page is returned.

We recommend transmitting the value of the output parameter nextPageToken, received during the last request.

If set page_token and the request has parameters page and pageSize they are ignored.
Example: eyBuZXh0SWQ6IDIzNDIgfQ==

Body

application/json
{
    "orderIds": [
        0
    ],
    "contexts": [
        {
            "type": "ORDER",
            "id": 0
        }
    ],
    "contextTypes": [
        "ORDER"
    ],
    "types": [
        "CHAT"
    ],
    "statuses": [
        "NEW"
    ]
}

Name

Description

contextTypes

Type: string[]

Filter by chat context type.
Type of context:

Enum: ORDER, RETURN, DIRECT

Min items: 1

Unique items  

contexts

Type: object[]

Filter by chat context.
Information about the order or refund for which the chat was started.

Min items: 1

Unique items  

orderIds

Type: integer[]

Filter by order IDs on the Market.

Min items: 1

Unique items  

statuses

Type: string[]

Filter by chat statuses.
Chat status:

  • NEW — a new chat.
  • WAITING_FOR_CUSTOMER — We need a buyer's response.
  • WAITING_FOR_PARTNER — We need the store's response.
  • WAITING_FOR_ARBITER — We need an arbitrator's response.
  • WAITING_FOR_MARKET — We need a response from Yandex. Market.
  • FINISHED — The chat is over.

Enum: NEW, WAITING_FOR_CUSTOMER, WAITING_FOR_PARTNER, WAITING_FOR_ARBITER, WAITING_FOR_MARKET, FINISHED

Min items: 1

Unique items  

types

Type: string[]

Filter by chat type.
Chat type:

  • CHAT — chat with the buyer.
  • ARBITRAGE — dispute.

Enum: CHAT, ARBITRAGE

Min items: 1

Unique items  

Responses

200 OK

A list of chats.

Body

application/json
{
    "status": "OK",
    "result": {
        "chats": [
            {
                "chatId": 0,
                "orderId": 0,
                "context": {
                    "type": "ORDER",
                    "customer": {
                        "name": "string",
                        "publicId": "string"
                    },
                    "campaignId": 0,
                    "orderId": 0,
                    "returnId": 0
                },
                "type": "CHAT",
                "status": "NEW",
                "createdAt": "2017-11-21T00:00:00+03:00",
                "updatedAt": "2017-11-21T00:00:00+03:00"
            }
        ],
        "paging": {
            "nextPageToken": "string"
        }
    }
}

Name

Description

status*

Type: string

The type of response. Possible values:

  • OK — There are no errors.
  • ERROR — an error occurred while processing the request.

Enum: OK, ERROR

result

Type: object

chats*

Type: object[]

Information about chats.
Information about the chat.

paging

Type: object

nextPageToken

Type: string

ID of the next results page.

The ID of the next page.

A list of chats.

400 Bad Request

The request contains incorrect data. More information about the error

Body

application/json
{
    "status": "OK",
    "errors": [
        {
            "code": "string",
            "message": "string"
        }
    ]
}

Name

Description

errors

Type: object[]

A list of errors.
The general error format.

Min items: 1

status

Type: string

The type of response. Possible values:

  • OK — There are no errors.
  • ERROR — an error occurred while processing the request.

Enum: OK, ERROR

401 Unauthorized

The authorization data is not specified in the request. More information about the error

Body

application/json
{
    "status": "OK",
    "errors": [
        {
            "code": "string",
            "message": "string"
        }
    ]
}

Name

Description

errors

Type: object[]

A list of errors.
The general error format.

Min items: 1

status

Type: string

The type of response. Possible values:

  • OK — There are no errors.
  • ERROR — an error occurred while processing the request.

Enum: OK, ERROR

403 Forbidden

The authorization data is incorrect or access to the resource is prohibited. More information about the error

Body

application/json
{
    "status": "OK",
    "errors": [
        {
            "code": "string",
            "message": "string"
        }
    ]
}

Name

Description

errors

Type: object[]

A list of errors.
The general error format.

Min items: 1

status

Type: string

The type of response. Possible values:

  • OK — There are no errors.
  • ERROR — an error occurred while processing the request.

Enum: OK, ERROR

404 Not Found

The requested resource was not found. More information about the error

Body

application/json
{
    "status": "OK",
    "errors": [
        {
            "code": "string",
            "message": "string"
        }
    ]
}

Name

Description

errors

Type: object[]

A list of errors.
The general error format.

Min items: 1

status

Type: string

The type of response. Possible values:

  • OK — There are no errors.
  • ERROR — an error occurred while processing the request.

Enum: OK, ERROR

420 Method Failure

The resource access limit has been exceeded. More information about the error

Body

application/json
{
    "status": "OK",
    "errors": [
        {
            "code": "string",
            "message": "string"
        }
    ]
}

Name

Description

errors

Type: object[]

A list of errors.
The general error format.

Min items: 1

status

Type: string

The type of response. Possible values:

  • OK — There are no errors.
  • ERROR — an error occurred while processing the request.

Enum: OK, ERROR

500 Internal Server Error

Internal error of the Market. More information about the error

Body

application/json
{
    "status": "OK",
    "errors": [
        {
            "code": "string",
            "message": "string"
        }
    ]
}

Name

Description

errors

Type: object[]

A list of errors.
The general error format.

Min items: 1

status

Type: string

The type of response. Possible values:

  • OK — There are no errors.
  • ERROR — an error occurred while processing the request.

Enum: OK, ERROR

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