- CategoryAPI
- ProductAPI
- Prices&StocksAPI
- Promos
- PricingStrategyAPI
- WarehouseAPI
- PolygonAPI
- FBS&rFBSMarks
- FBS
- ReturnsAPI
- CancellationAPI
- ChatAPI
- ReportAPI
- AnalyticsAPI
- FinanceAPI
聊天历史记录
POST
/v2/chat/history
ChatAPI
请求参数
Header 参数
Client-Id
string
用户识别号。
示例值:
{{Client-Id}}
Api-Key
string
API-密钥。
示例值:
{{Api-Key}}
Body 参数application/json
chat_id
string
聊天识别码。
direction
string
可选
Forward
— 从旧到新。Backward
— 从新到旧。Backward
。消息的数量可以在 limit
参数中设置。from_message_id
integer <uint64>
可选
limit
integer <int64>
可选
示例
{
"chat_id": "18b8e1f9-4ae7-461c-84ea-8e1f54d1a45e",
"direction": "Forward",
"from_message_id": 3000000000118032000,
"limit": 1
}
示例代码
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api-seller.ozon.ru/v2/chat/history' \
--header 'Client-Id: ' \
--header 'Api-Key: ' \
--header 'Content-Type: application/json' \
--data-raw '{
"chat_id": "18b8e1f9-4ae7-461c-84ea-8e1f54d1a45e",
"direction": "Forward",
"from_message_id": 3000000000118032000,
"limit": 1
}'
返回响应
🟢200聊天历史记录
application/json
Body
has_next
boolean
可选
messages
array [object]
可选
direction
参数排序的信息数组。示例
{
"has_next": true,
"messages": [
{
"message_id": "3000000000817031942",
"user": {
"id": "115568",
"type": "Сustomer"
},
"created_at": "2022-07-18T20:58:04.528Z",
"is_read": true,
"data": [
"Здравствуйте, у меня вопрос по вашему товару \"Стекло защитное для смартфонов\", артикул 11223. Подойдет ли он на данную [ модель ](https://www.ozon.ru/product/smartfon-samsung-galaxy-a03s-4-64-gb-chernyy) телефона?"
]
}
]
}
🟠400参数有误
🟠403拒绝访问
🟠404未找到答复
🟠409请求冲突
🔴500内部服务器出错
修改于 2023-11-03 06:04:11