Tham chiếu API
Hội thoạiPOST

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

Tiêu đề

X-Api-Key
stringbắt buộc

API 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-Type
stringbắt buộc

Dùng application/json khi gửi nội dung yêu cầu JSON.

Tham số đường dẫn

account_id
stringbắt buộc

Định danh dùng cho route conversations.

Nội dung yêu cầu

conversation_id
stringbắt buộc

Định danh cuộc trò chuyện đích.

up_to_message_id
string

Tin 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_id
string

Ngườ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

ok
boolean

Luô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

200
200 OK

Yêu cầu thành công. Xem ví dụ nội dung phản hồi.

400
Bad Request

Body, đường dẫn hoặc tham số yêu cầu không hợp lệ.

401
Unauthorized

Header X-Api-Key thiếu hoặc không hợp lệ.

404
Not Found

Không tìm thấy tài nguyên provider được yêu cầu.

409
Conflict

Thao 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ó.

500
Internal Server Error

Dịch vụ gặp lỗi không mong muốn.

501
Not Implemented

Provider đã chọn chưa triển khai thao tác này.

502
Bad Gateway

Adapter 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
  }
}