Mark conversation as read
Marks a conversation as read. Pass conversation_id in the JSON body (not the path, since provider IDs may contain @ / :). For a WhatsApp message receipt, set up_to_message_id together with up_to_message_sender_id; use the matching webhook data.sender.id for a group message. Omit both message fields to mark the whole conversation read. Supplying only one returns 400 invalid_request.
https://api.unifyport.ai/v1/accounts/{account_id}/conversations/readTiêu đề
X-Api-KeyAPI key của không gian làm việc. Không gian làm việc được xác định từ tiêu đề này.
Content-TypeDùng application/json khi gửi nội dung yêu cầu JSON.
Tham số đường dẫn
account_idĐịnh danh dùng cho route conversations.
Nội dung yêu cầu
conversation_idĐịnh danh cuộc trò chuyện đích.
up_to_message_idTin nhắn cuối cùng cần đánh dấu đã đọc; gửi cùng up_to_message_sender_id.
up_to_message_sender_idNgười gửi tin nhắn cuối cùng; gửi cùng up_to_message_id.
Nội dung phản hồi
okLuôn là true khi thao tác thành công; thất bại sẽ trả về mã trạng thái không thuộc 2xx.
Phản hồi
200Yêu cầu thành công. Xem ví dụ nội dung phản hồi.
400Body, đường dẫn hoặc tham số yêu cầu không hợp lệ.
401Header X-Api-Key thiếu hoặc không hợp lệ.
404Không tìm thấy tài nguyên provider được yêu cầu.
409Thao tác đang yêu cầu xung đột với tài khoản hoặc tài nguyên nhà cung cấp đã có.
500Dịch vụ gặp lỗi không mong muốn.
501Provider đã chọn chưa triển khai thao tác này.
502Adapter hoặc upstream provider không thể hoàn tất thao tác.
Yêu cầu
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"
}'Phản hồi
{
"data": {
"ok": true
}
}