Getting the chat message history

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 the history of messages in the chat with the buyer.

⚙️ Limit: 10,000 requests per hour

Request

POST

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

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

chatId*

Type: integer<int64>

The chat ID.

Min value: 1

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
{
    "messageIdFrom": 0
}

Name

Description

messageIdFrom

Type: integer<int64>

The ID of the message to receive all subsequent messages from.

Min value: 1

Responses

200 OK

Message history.

Body

application/json
{
    "status": "OK",
    "result": {
        "orderId": 0,
        "context": {
            "type": "ORDER",
            "customer": {
                "name": "string",
                "publicId": "string"
            },
            "campaignId": 0,
            "orderId": 0,
            "returnId": 0
        },
        "messages": [
            {
                "messageId": 0,
                "createdAt": "2017-11-21T00:00:00+03:00",
                "sender": "PARTNER",
                "message": "string",
                "payload": [
                    {
                        "name": "string",
                        "url": "string",
                        "size": 0
                    }
                ]
            }
        ],
        "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

context*

Type: object

type*

Type: string

Type of context:

Enum: ORDER, RETURN, DIRECT

campaignId

Type: integer<int64>

The campaign ID.

It is returned for orders and refunds.

customer

Type: object

name

Type: string

The buyer's public name in Yandex Passport, which is displayed in Yandex services.

Min length: 1

publicId

Type: string

The public user ID in Yandex Passport.

Examples where it is used
  • The market: https://market.yandex.ru/user/{public-id}/reviews
  • Zen: https://zen.yandex.ru/user/{public-id}
  • Reviews: https://yandex.ru/user/{public-id}

Read more about public data in Yandex ID documentation.

Min length: 1

Information about the buyer in the chat.

orderId

Type: integer<int64>

The order ID.

It is returned for orders and refunds.

Min value: 1

returnId

Type: integer<int64>

The refund ID.

It is returned only for refunds.

Min value: 1

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

messages*

Type: object[]

Information about messages.
Information about the message.

orderId

Type: integer<int64>

The order ID.

paging

Type: object

nextPageToken

Type: string

ID of the next results page.

The ID of the next page.

Information about messages.

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.

For example, Please do not ask buyers for contacts, do not send links to other sites. We see the correspondence and hide the goods from the showcase when the rules of communication in chat rooms are violated.