获取可用的聊天记录

方法适用于所有模式.

如果您使用API-Key令牌,调用该方法时需要具备列表中可用权限之一
  • communication — 与买家沟通
  • all-methods — 全面管理账户
  • all-methods:read-only — 查看所有数据

返回与客户的聊天。

启用API通知

燕基科斯.Market会向您发送请求。 POST 通知书 出现新聊天或消息时。

如何使用通知

参数的限制 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: 1

Query parameters

Name

Description

limit

Type: integer

每页的值数。

Min value: 1

page_token

Type: string

结果页面的ID。

如果省略该参数,则返回第一页。

我们建议传输输出参数的值 nextPageToken,在最后一次请求期间接收。

如果设置 page_token 并且请求有参数 pagepageSize 它们被忽略了。

Example: eyBuZXh0SWQ6IDIzNDIgfQ==

Body

application/json
{
  "orderIds": [
    0
  ],
  "contexts": [
    {
      "type": "ORDER",
      "id": 1
    }
  ],
  "contextTypes": [
    "ORDER"
  ],
  "types": [
    "CHAT"
  ],
  "statuses": [
    "NEW"
  ]
}

Name

Description

contexts

Type: object[]

id

Type: integer

订单或退款ID。

Min value: 1

type

Type: string

聊天类型:

  • ORDER — 奉命行事。
  • RETURN — 关于退款(FBY, FBS 和 Express).

有关订单和退款聊天的更多信息,请参阅 燕基科斯.对卖家的市场帮助.

Enum: ORDER, RETURN

按聊天上下文过滤。

Min items: 1

Unique items: true

Example
[
  {
    "type": "ORDER",
    "id": 1
  }
]

contextTypes

Type: string[] | null

按聊天上下文类型进行筛选。

Min items: 1

Unique items: true

Example
[
  "ORDER"
]

orderIds

Type: integer[] | null

通过市场上的订单Id进行过滤。

Min items: 1

Unique items: true

Example
[
  0
]

statuses

Type: string[] | null

按聊天状态过滤。

Min items: 1

Unique items: true

Example
[
  "NEW"
]

types

Type: string[] | null

按聊天类型过滤。

Min items: 1

Unique items: true

Example
[
  "CHAT"
]

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: 1

    context

    Type: object

    type

    Type: string

    上下文类型:

    Enum: ORDER, RETURN, DIRECT

    campaignId

    Type: integer

    广告系列(商店)的ID — 通过API工作时,代表您在Yandex市场系统中的商店的技术标识符。 它与您的商店唯一链接,但仅用于自动交互。

    您可以使用查询找到它 GET v2/campaigns 或者在市场上的卖家办公室找到它。 点击您的帐户图标→ 设置 在左边的菜单中,选择 Api和模块:

    • 运动ID;
    • 标签 查询日志 →块中的下拉列表 显示日志.

    ⚠️ 不要把它与:

    • 商店的标识符,显示在商家的个人帐户中。
    • 广告活动。

    Min value: 1

    customer

    Type: object

    name

    Type: string

    买方在Yandex Passport中的公开名称,显示在Yandex services中。

    Min length: 1

    Example: example

    publicId

    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: 1

    Example: example

    聊天中有关买家的信息。

    Example
    {
      "name": "example",
      "publicId": "example"
    }
    

    orderId

    Type: integer

    的订单ID。

    它被退回的订单和退款。

    Min value: 1

    returnId

    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:00

    status

    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, FINISHED

    type

    Type: string

    聊天类型:

    • CHAT — 与买家聊天。
    • ARBITRAGE — 争议。

    Enum: CHAT, ARBITRAGE

    updatedAt

    Type: string<date-time>

    聊天中最后一条消息的日期和时间。

    日期格式: ISO 8601 具有相对于 UTC.

    Example: 2017-11-21T00:00:00+03:00

    orderId

    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: example

      message

      Type: string

      错误的描述。

      Example: example

      错误列表。

      Min items: 1

      Example
      [
        {
          "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: example

      message

      Type: string

      错误的描述。

      Example: example

      错误列表。

      Min items: 1

      Example
      [
        {
          "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: example

      message

      Type: string

      错误的描述。

      Example: example

      错误列表。

      Min items: 1

      Example
      [
        {
          "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: example

      message

      Type: string

      错误的描述。

      Example: example

      错误列表。

      Min items: 1

      Example
      [
        {
          "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: example

      message

      Type: string

      错误的描述。

      Example: example

      错误列表。

      Min items: 1

      Example
      [
        {
          "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: example

      message

      Type: string

      错误的描述。

      Example: example

      错误列表。

      Min items: 1

      Example
      [
        {
          "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.