会话POST
标记会话已读
把会话标记为已读。conversation_id 通过 JSON body 传入(不走 path,因为渠道侧 ID 可能含 @ / : 等字符)。WhatsApp 消息级已读需要成对传入 up_to_message_id 与 up_to_message_sender_id;群聊发送者使用对应 webhook 的 data.sender.id。省略这两个字段表示把整条会话标记为已读,只传其中一个会返回 400 invalid_request。
https://api.unifyport.ai/v1/accounts/{account_id}/conversations/read请求头
X-Api-Keystring必填
工作区 API Key,工作区由该请求头解析得到。
Content-Typestring必填
发送 JSON 请求体时使用 application/json。
路径参数
account_idstring必填
用于该 conversations 路由的标识符。
请求体
conversation_idstring必填
目标会话标识。
up_to_message_idstring
要标记已读的最后一条消息,必须与 up_to_message_sender_id 成对传入。
up_to_message_sender_idstring
最后一条消息的发送者,必须与 up_to_message_id 成对传入。
响应体
okboolean
操作成功时始终为 true;失败时返回非 2xx 状态码而非该字段。
响应
200200 OK
请求成功,响应体示例如上。
400请求错误
请求体、路径或参数不合法。
401未授权
X-Api-Key 请求头缺失或无效。
404未找到
未找到请求的渠道资源。
409冲突
当前操作与已有的渠道账号或资源冲突。
500服务端错误
服务端遇到了未预期的错误。
501渠道未实现
所选渠道尚未实现该操作。
502上游网关错误
渠道适配器或上游渠道未能完成该操作。
请求
curl -X POST https://api.unifyport.ai/v1/accounts/{account_id}/conversations/read \
-H "X-Api-Key: <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"conversation_id": "peer_example",
"up_to_message_id": "msg_example",
"up_to_message_sender_id": "sender_example"
}'响应
{
"data": {
"ok": true
}
}