Creating a new chat with a customer
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
Creates a new chat with the customer.
Types of chats:
- by orders;
- for refunds (available only for FBS and Express stores).
You can't create a chat with the type DIRECT
. Read more about customer messages in Yandex.Market Help for sellers.
, Limit: 1,000 requests per hour |
---|
Request
POST
https://api.partner.market.yandex.ru/businesses/{businessId}/chats/new
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: |
Body
application/json
{
"orderId": 0,
"context": {
"type": "ORDER",
"id": 0
}
}
Name |
Description |
context |
Type: ChatContextDTO Information about the order or refund for which the chat was started. |
orderId âϏ
|
Type: integer<int64> The order ID on the Market. |
ChatContextDTO
Information about the order or refund for which the chat was started.
Name |
Description |
id* |
Type: integer<int64> The order or refund ID. Min value: |
type* |
Type: ChatContextType Chat type:
Enum: |
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: |
Responses
200 OK
Everything worked out: the chat was created.
Body
application/json
{
"status": "OK",
"result": {
"chatId": 0
}
}
Name |
Description |
result |
Type: CreateChatResultDTO Information about the created chat. |
status |
Type: ApiResponseStatusType The type of response. Possible values:
Enum: |
CreateChatResultDTO
Information about the created chat.
Name |
Description |
chatId* |
Type: integer<int64> The chat ID. Min value: |
ApiResponseStatusType
The type of response. Possible values:
OK
â there are no mistakes.ERROR
â an error occurred while processing the request.
Type |
Description |
Enum: |
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 of the 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.