获取可用的聊天记录
方法适用于所有模式.
如果您使用API-Key令牌,调用该方法时需要具备列表中可用权限之一
- communication — 与买家沟通
- all-methods — 全面管理账户
- all-methods:read-only — 查看所有数据
返回与客户的聊天。
参数的限制 limit
不要传递大于20的值。
| ⚙️ 限制: 每小时10,000次请求 |
|---|
Request
POST
https://api.partner.market.yandex.ru/v2/businesses/{businessId}/chats
Path parameters
|
Name |
Description |
|
businessId |
Type: integer 内阁ID。 要找到答案,请使用请求 GET v2/campaigns. Min value: |
Query parameters
|
Name |
Description |
|
limit |
Type: integer 每页的值数。 Min value: |
|
page_token |
Type: string 结果页面的ID。 如果省略该参数,则返回第一页。 我们建议传输输出参数的值 如果设置 Example: |
Body
application/json
{
"orderIds": [
0
],
"contexts": [
{
"type": "ORDER",
"id": 1
}
],
"contextTypes": [
"ORDER"
],
"types": [
"CHAT"
],
"statuses": [
"NEW"
]
}
|
Name |
Description |
||||
|
contexts |
Type: object[]
按聊天上下文过滤。 Min items: Unique items: Example
|
||||
|
contextTypes |
Type: string[] | null 按聊天上下文类型进行筛选。 Min items: Unique items: Example
|
||||
|
orderIds |
Type: integer[] | null 通过市场上的订单Id进行过滤。 Min items: Unique items: Example
|
||||
|
statuses |
Type: string[] | null 按聊天状态过滤。 Min items: Unique items: Example
|
||||
|
types |
Type: string[] | null 按聊天类型过滤。 Min items: Unique items: Example
|
Responses
200 OK
聊天列表。
Body
application/json
{
"status": "OK",
"result": {
"chats": [
{
"chatId": 1,
"orderId": 1,
"context": {},
"type": "CHAT",
"status": "NEW",
"createdAt": "2017-11-21T00:00:00+03:00",
"updatedAt": "2017-11-21T00:00:00+03:00"
}
],
"paging": {
"nextPageToken": "example"
}
}
}
Type: object
All of 2 types
-
Type: object
status
Type: string
响应的类型。 可能的值:
OK— 没有错误。ERROR— 处理请求时出错。
Enum:
OK,ERROR服务器响应的标准包装器。
Example
{ "status": "OK" } -
Type: object
result
Type: object
chats
Type: object[]
chatId
Type: integer
的聊天ID。
Min value:
1context
Type: object
type
Type: string
上下文类型:
ORDER— 根据要求聊天。 关于订单和退款的聊天RETURN— 退款聊天(FBY, FBS 和 Express). 关于订单和退款的聊天DIRECT— 客户开始的聊天。 来自客户的信息
Enum:
ORDER,RETURN,DIRECTcampaignId
Type: integer
广告系列(商店)的ID — 通过API工作时,代表您在Yandex市场系统中的商店的技术标识符。 它与您的商店唯一链接,但仅用于自动交互。
您可以使用查询找到它 GET v2/campaigns 或者在市场上的卖家办公室找到它。 点击您的帐户图标→ 设置 在左边的菜单中,选择 Api和模块:
- 座 运动ID;
- 标签 查询日志 →块中的下拉列表 显示日志.
⚠️ 不要把它与:
- 商店的标识符,显示在商家的个人帐户中。
- 广告活动。
Min value:
1customer
Type: object
name
Type: string
买方在Yandex Passport中的公开名称,显示在Yandex services中。
Min length:
1Example:
examplepublicId
Type: string
Yandex Passport中的公共用户ID。
使用它的例子
- 市场:
https://market.yandex.ru/user/{public-id}/reviews - 禅宗:
https://zen.yandex.ru/user/{public-id} - 检讨报告:
https://yandex.ru/user/{public-id}
阅读更多关于公共数据的信息 Yandex ID文档.
Min length:
1Example:
example聊天中有关买家的信息。
Example
{ "name": "example", "publicId": "example" }orderId
Type: integer
的订单ID。
它被退回的订单和退款。
Min value:
1returnId
Type: integer
退款ID。
它仅用于退款。
Min value:
1有关开始聊天的订单或退款的信息。
Example
{ "type": "ORDER", "customer": { "name": "example", "publicId": "example" }, "campaignId": 1, "orderId": 1, "returnId": 1 }createdAt
Type: string<date-time>
创建聊天的日期和时间。
日期格式: ISO 8601 具有相对于 UTC.
Example:
2017-11-21T00:00:00+03:00status
Type: string
聊天状态:
NEW— 一个新的聊天。WAITING_FOR_CUSTOMER— 我们需要买家的回应。WAITING_FOR_PARTNER— 我们需要商店的回应。WAITING_FOR_ARBITER— 我们需要仲裁员的回应。WAITING_FOR_MARKET— 我们需要Yandex的回应。 市场。FINISHED— 聊天结束了。
Enum:
NEW,WAITING_FOR_CUSTOMER,WAITING_FOR_PARTNER,WAITING_FOR_ARBITER,WAITING_FOR_MARKET,FINISHEDtype
Type: string
聊天类型:
CHAT— 与买家聊天。ARBITRAGE— 争议。
Enum:
CHAT,ARBITRAGEupdatedAt
Type: string<date-time>
聊天中最后一条消息的日期和时间。
日期格式: ISO 8601 具有相对于 UTC.
Example:
2017-11-21T00:00:00+03:00orderId
Type: integer
的订单ID。
Min value:
1关于聊天的信息。
Example
[ { "chatId": 1, "orderId": 1, "context": { "type": "ORDER", "customer": { "name": "example", "publicId": "example" }, "campaignId": 1, "orderId": 1, "returnId": 1 }, "type": "CHAT", "status": "NEW", "createdAt": "2017-11-21T00:00:00+03:00", "updatedAt": "2017-11-21T00:00:00+03:00" } ]paging
Type: object
nextPageToken
Type: string
下一个结果页面的ID。
Example:
example下一页的ID。
Example
{ "nextPageToken": "example" }聊天列表。
Example
{ "chats": [ { "chatId": 1, "orderId": 1, "context": { "type": "ORDER", "customer": { "name": "example", "publicId": "example" }, "campaignId": 1, "orderId": 1, "returnId": 1 }, "type": "CHAT", "status": "NEW", "createdAt": "2017-11-21T00:00:00+03:00", "updatedAt": "2017-11-21T00:00:00+03:00" } ], "paging": { "nextPageToken": "example" } }Example
{ "result": { "chats": [ { "chatId": 1, "orderId": 1, "context": { "type": "ORDER", "customer": {}, "campaignId": 1, "orderId": 1, "returnId": 1 }, "type": "CHAT", "status": "NEW", "createdAt": "2017-11-21T00:00:00+03:00", "updatedAt": "2017-11-21T00:00:00+03:00" } ], "paging": { "nextPageToken": "example" } } }
400 Bad Request
请求包含不正确的数据。 有关错误的更多信息
Body
application/json
{
"status": "OK",
"errors": [
{
"code": "example",
"message": "example"
}
]
}
Type: object
All of 1 type
-
Type: object
All of 2 types
-
Type: object
status
Type: string
响应的类型。 可能的值:
OK— 没有错误。ERROR— 处理请求时出错。
Enum:
OK,ERROR服务器响应的标准包装器。
Example
{ "status": "OK" } -
Type: object
errors
Type: object[]
code
Type: string
的错误代码。
Example:
examplemessage
Type: string
错误的描述。
Example:
example错误列表。
Min items:
1Example
[ { "code": "example", "message": "example" } ]Example
{ "errors": [ { "code": "example", "message": "example" } ] }
服务器错误的标准包装器。
Example
{ "status": "OK", "errors": [ { "code": "example", "message": "example" } ] } -
401 Unauthorized
请求中未指定授权数据。 有关错误的更多信息
Body
application/json
{
"status": "OK",
"errors": [
{
"code": "example",
"message": "example"
}
]
}
Type: object
All of 1 type
-
Type: object
All of 2 types
-
Type: object
status
Type: string
响应的类型。 可能的值:
OK— 没有错误。ERROR— 处理请求时出错。
Enum:
OK,ERROR服务器响应的标准包装器。
Example
{ "status": "OK" } -
Type: object
errors
Type: object[]
code
Type: string
的错误代码。
Example:
examplemessage
Type: string
错误的描述。
Example:
example错误列表。
Min items:
1Example
[ { "code": "example", "message": "example" } ]Example
{ "errors": [ { "code": "example", "message": "example" } ] }
服务器错误的标准包装器。
Example
{ "status": "OK", "errors": [ { "code": "example", "message": "example" } ] } -
403 Forbidden
授权数据不正确或禁止访问资源。 有关错误的更多信息
Body
application/json
{
"status": "OK",
"errors": [
{
"code": "example",
"message": "example"
}
]
}
Type: object
All of 1 type
-
Type: object
All of 2 types
-
Type: object
status
Type: string
响应的类型。 可能的值:
OK— 没有错误。ERROR— 处理请求时出错。
Enum:
OK,ERROR服务器响应的标准包装器。
Example
{ "status": "OK" } -
Type: object
errors
Type: object[]
code
Type: string
的错误代码。
Example:
examplemessage
Type: string
错误的描述。
Example:
example错误列表。
Min items:
1Example
[ { "code": "example", "message": "example" } ]Example
{ "errors": [ { "code": "example", "message": "example" } ] }
服务器错误的标准包装器。
Example
{ "status": "OK", "errors": [ { "code": "example", "message": "example" } ] } -
404 Not Found
找不到请求的资源。 有关错误的更多信息
Body
application/json
{
"status": "OK",
"errors": [
{
"code": "example",
"message": "example"
}
]
}
Type: object
All of 1 type
-
Type: object
All of 2 types
-
Type: object
status
Type: string
响应的类型。 可能的值:
OK— 没有错误。ERROR— 处理请求时出错。
Enum:
OK,ERROR服务器响应的标准包装器。
Example
{ "status": "OK" } -
Type: object
errors
Type: object[]
code
Type: string
的错误代码。
Example:
examplemessage
Type: string
错误的描述。
Example:
example错误列表。
Min items:
1Example
[ { "code": "example", "message": "example" } ]Example
{ "errors": [ { "code": "example", "message": "example" } ] }
服务器错误的标准包装器。
Example
{ "status": "OK", "errors": [ { "code": "example", "message": "example" } ] } -
420 Method Failure
已超出资源访问限制。 有关错误的更多信息
Body
application/json
{
"status": "OK",
"errors": [
{
"code": "example",
"message": "example"
}
]
}
Type: object
All of 1 type
-
Type: object
All of 2 types
-
Type: object
status
Type: string
响应的类型。 可能的值:
OK— 没有错误。ERROR— 处理请求时出错。
Enum:
OK,ERROR服务器响应的标准包装器。
Example
{ "status": "OK" } -
Type: object
errors
Type: object[]
code
Type: string
的错误代码。
Example:
examplemessage
Type: string
错误的描述。
Example:
example错误列表。
Min items:
1Example
[ { "code": "example", "message": "example" } ]Example
{ "errors": [ { "code": "example", "message": "example" } ] }
服务器错误的标准包装器。
Example
{ "status": "OK", "errors": [ { "code": "example", "message": "example" } ] } -
500 Internal Server Error
Yandex中的内部错误。 市场。 有关错误的更多信息
Body
application/json
{
"status": "OK",
"errors": [
{
"code": "example",
"message": "example"
}
]
}
Type: object
All of 1 type
-
Type: object
All of 2 types
-
Type: object
status
Type: string
响应的类型。 可能的值:
OK— 没有错误。ERROR— 处理请求时出错。
Enum:
OK,ERROR服务器响应的标准包装器。
Example
{ "status": "OK" } -
Type: object
errors
Type: object[]
code
Type: string
的错误代码。
Example:
examplemessage
Type: string
错误的描述。
Example:
example错误列表。
Min items:
1Example
[ { "code": "example", "message": "example" } ]Example
{ "errors": [ { "code": "example", "message": "example" } ] }
服务器错误的标准包装器。
Example
{ "status": "OK", "errors": [ { "code": "example", "message": "example" } ] } -
No longer supported, please use an alternative and newer version.