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/businesses/{businessId}/chats/history
Path parameters
Name |
Description |
businessId* |
Type: integer<int64> Cabinet ID. To find out, use the request GET campaigns. ℹ️ What is a cabinet and a store on the Market?
Min value: |
Query parameters
Name |
Description |
chatId* |
Type: integer<int64> The chat ID. Min value: |
limit |
Type: integer<int32> The number of values per page.
Min value: |
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 If set |
Body
application/json
{
"messageIdFrom": 0
}
Name |
Description |
messageIdFrom |
Type: integer<int64> The ID of the message to receive all subsequent messages from. Min value: |
Responses
200 OK
Message history.
Body
application/json
{
"status": "OK",
"result": {
"orderId": 0,
"context": {
"type": "ORDER",
"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 |
result |
Type: ChatMessagesResultDTO Information about messages. |
status |
Type: ApiResponseStatusType The type of response. Possible values:
Enum: |
ChatMessagesResultDTO
Information about messages.
Name |
Description |
context* |
Type: ChatFullContextDTO Information about the order or refund for which the chat was started. |
messages* |
Type: ChatMessageDTO[] Information about messages. |
orderId ⦸
|
Type: integer<int64> The order ID. |
paging |
Type: ForwardScrollingPagerDTO The ID of the next page. |
ApiResponseStatusType
The type of response. Possible values:
OK
— there are no mistakes.ERROR
— an error occurred while processing the request.
Type |
Description |
Enum: |
ChatFullContextDTO
Information about the order or refund for which the chat was started.
Name |
Description |
type* |
Type: ChatContextType Chat type:
Enum: |
orderId |
Type: integer<int64> The order ID. It is returned for orders and refunds. Min value: |
returnId |
Type: integer<int64> The refund ID. It is returned only for refunds. Min value: |
ChatMessageDTO
Information about the message.
Name |
Description |
createdAt* |
Type: string<date-time> The date and time when the message was created. Date format: ISO 8601 with an offset relative to UTC. Example: |
messageId* |
Type: integer<int64> The ID of the message. Min value: |
sender* |
Type: ChatMessageSenderType Sender. Enum: |
message |
Type: string The text of the message. Optional parameter if the parameter is returned |
payload |
Type: ChatMessagePayloadDTO[] Information about the files attached to the message. Optional parameter if the parameter is returned Min items: |
ForwardScrollingPagerDTO
The ID of the next page.
Name |
Description |
nextPageToken |
Type: string ID of the next results page. |
ChatContextType
Chat type:
ORDER
— on orders. Read more about order chats in Yandex.Market Help for sellers.RETURN
— for refunds (FBS and Express). Read more about refund chats in Yandex.Market Help for sellers.DIRECT
— the chat that the customer started. Read more about this type in Yandex.Market Help for sellers.
Type |
Description |
Enum: |
ChatMessageSenderType
Who sent the message:
PARTNER
— the store.CUSTOMER
— the buyer.MARKET
— The market.SUPPORT
— a Yandex. Market support employee.
Type |
Description |
Enum: |
ChatMessagePayloadDTO
Information about the files attached to the message.
Name |
Description |
name* |
Type: string The file name. |
size* |
Type: integer<int32> The file size in bytes. |
url* |
Type: string The link to download the file. Min length: Max length: |
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: ApiErrorDTO[] A list of errors. Min items: |
status |
Type: ApiResponseStatusType The type of response. Possible values:
Enum: |
ApiErrorDTO
The general error format.
Name |
Description |
code* |
Type: string The error code. |
message |
Type: string Description of the 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: ApiErrorDTO[] A list of errors. Min items: |
status |
Type: ApiResponseStatusType The type of response. Possible values:
Enum: |
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: ApiErrorDTO[] A list of errors. Min items: |
status |
Type: ApiResponseStatusType The type of response. Possible values:
Enum: |
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: ApiErrorDTO[] A list of errors. Min items: |
status |
Type: ApiResponseStatusType The type of response. Possible values:
Enum: |
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: ApiErrorDTO[] A list of errors. Min items: |
status |
Type: ApiResponseStatusType The type of response. Possible values:
Enum: |
500 Internal Server Error
Internal error in Yandex. Market. More information about the error
Body
application/json
{
"status": "OK",
"errors": [
{
"code": "string",
"message": "string"
}
]
}
Name |
Description |
errors |
Type: ApiErrorDTO[] A list of errors. Min items: |
status |
Type: ApiResponseStatusType The type of response. Possible values:
Enum: |
No longer supported, please use an alternative and newer version.