通过ID进行聊天
方法适用于所有模式.
如果您使用API-Key令牌,调用该方法时需要具备列表中可用权限之一
- communication — 与买家沟通
- all-methods — 全面管理账户
- all-methods:read-only — 查看所有数据
通过其ID返回聊天。
| ⚙️ 限制: 每小时1,000个请求 |
|---|
Request
GET
https://api.partner.market.yandex.ru/v2/businesses/{businessId}/chat
Path parameters
|
Name |
Description |
|
businessId |
Type: integer 内阁ID。 要找到答案,请使用请求 GET v2/campaigns. Min value: |
Query parameters
|
Name |
Description |
|
chatId |
Type: integer 的聊天ID。 Min value: |
Responses
200 OK
关于聊天的信息。
Body
application/json
{
"status": "OK",
"result": {
"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"
}
}
Type: object
All of 2 types
-
Type: object
status
Type: string
响应的类型。 可能的值:
OK— 没有错误。ERROR— 处理请求时出错。
Enum:
OK,ERROR服务器响应的标准包装器。
Example
{ "status": "OK" } -
Type: object
result
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" }Example
{ "result": { "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" } }
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.