API 參考
會話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-Key
string必填

工作區 API Key,工作區會由呢個標頭解析得出嚟。

Content-Type
string必填

發送 JSON 請求內容嘅時候請用 application/json。

路徑參數

account_id
string必填

用嚟識別嗰條 conversations 路由嘅 ID。

請求內容

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
請求錯誤

請求內容、路徑或者參數無效。

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