會話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-Keystring必填
工作區 API Key,工作區會由此標頭解析得到。
Content-Typestring必填
傳送 JSON 請求內容時請使用 application/json。
路徑參數
account_idstring必填
用於該 conversations 路由的識別字。
請求內容
conversation_idstring必填
目標對話識別字。
up_to_message_idstring
要標記已讀的最後一則訊息,必須與 up_to_message_sender_id 一起傳入。
up_to_message_sender_idstring
最後一則訊息的發送者,必須與 up_to_message_id 一起傳入。
回應內容
okboolean
操作成功時恆為 true;失敗時則改回傳非 2xx 狀態碼。
回應
200200 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
}
}