เอกสารอ้างอิง API
บทสนทนาPOST

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-Key
stringจำเป็น

API key ของพื้นที่ทำงาน ระบบจะระบุพื้นที่ทำงานจากส่วนหัวนี้

Content-Type
stringจำเป็น

ใช้ application/json เมื่อต้องส่งเนื้อหาของคำขอเป็น JSON

พารามิเตอร์ใน path

account_id
stringจำเป็น

ตัวระบุที่ใช้ใน route ของ conversations

เนื้อหาของคำขอ

conversation_id
stringจำเป็น

ตัวระบุบทสนทนาเป้าหมาย

up_to_message_id
string

ข้อความสุดท้ายที่จะทำเครื่องหมายว่าอ่านแล้ว ต้องส่งพร้อม up_to_message_sender_id

up_to_message_sender_id
string

ผู้ส่งของข้อความสุดท้าย ต้องส่งพร้อม up_to_message_id

เนื้อหาการตอบกลับ

ok
boolean

เป็น true เสมอเมื่อการดำเนินการสำเร็จ ส่วนกรณีล้มเหลวจะคืนสถานะที่ไม่ใช่ 2xx แทน

การตอบกลับ

200
200 OK

คำขอสำเร็จ ดูตัวอย่างเนื้อหาตอบกลับด้านบน

400
Bad Request

เนื้อหาของคำขอ path หรือพารามิเตอร์ไม่ถูกต้อง

401
Unauthorized

ส่วนหัว X-Api-Key หายไปหรือไม่ถูกต้อง

404
Not Found

ไม่พบทรัพยากรของ provider ที่ร้องขอ

409
Conflict

การดำเนินการขัดแย้งกับบัญชีของผู้ให้บริการหรือทรัพยากรที่มีอยู่

500
Internal Server Error

บริการพบข้อผิดพลาดที่ไม่คาดคิด

501
Not Implemented

provider ที่เลือกยังไม่รองรับการดำเนินการนี้

502
Bad Gateway

อะแดปเตอร์หรือ 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
  }
}