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/readส่วนหัว
X-Api-KeyAPI key ของพื้นที่ทำงาน ระบบจะระบุพื้นที่ทำงานจากส่วนหัวนี้
Content-Typeใช้ application/json เมื่อต้องส่งเนื้อหาของคำขอเป็น JSON
พารามิเตอร์ใน path
account_idตัวระบุที่ใช้ใน route ของ conversations
เนื้อหาของคำขอ
conversation_idตัวระบุบทสนทนาเป้าหมาย
up_to_message_idข้อความสุดท้ายที่จะทำเครื่องหมายว่าอ่านแล้ว ต้องส่งพร้อม up_to_message_sender_id
up_to_message_sender_idผู้ส่งของข้อความสุดท้าย ต้องส่งพร้อม up_to_message_id
เนื้อหาการตอบกลับ
okเป็น true เสมอเมื่อการดำเนินการสำเร็จ ส่วนกรณีล้มเหลวจะคืนสถานะที่ไม่ใช่ 2xx แทน
การตอบกลับ
200คำขอสำเร็จ ดูตัวอย่างเนื้อหาตอบกลับด้านบน
400เนื้อหาของคำขอ path หรือพารามิเตอร์ไม่ถูกต้อง
401ส่วนหัว X-Api-Key หายไปหรือไม่ถูกต้อง
404ไม่พบทรัพยากรของ provider ที่ร้องขอ
409การดำเนินการขัดแย้งกับบัญชีของผู้ให้บริการหรือทรัพยากรที่มีอยู่
500บริการพบข้อผิดพลาดที่ไม่คาดคิด
501provider ที่เลือกยังไม่รองรับการดำเนินการนี้
502อะแดปเตอร์หรือ upstream provider ไม่สามารถทำรายการให้เสร็จได้
คำขอ
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
}
}