取得會話詳情
即時回傳一條會話的詳情。conversation_id 透過 query 參數傳入(其值即為 List conversations 回傳的 id)。回應固定包含 conversation_id / type / title / avatar_url(缺值時為空字串),並依會話類型補上 members_count 等欄位;找不到會話時回傳 404。
https://api.unifyport.ai/v1/accounts/{account_id}/conversations/info請求標頭
X-Api-Key工作區 API Key,工作區會由此標頭解析得到。
路徑參數
account_id用於該 conversations 路由的識別字。
查詢參數
conversation_id要查詢的對話 — 即列出對話時以 conversation_id 回傳的值。
type對話類型(user、group 或 channel),用於釐清查詢對象。
enum: user, group, channel
請求內容
此介面無需 JSON 請求內容。
回應內容
conversation_id對話識別字。傳送訊息或呼叫對話相關路由時,請以此作為目標。
type對話類型:user、group 或 channel。
enum: user, group, channel
title對話的顯示標題。
username渠道有提供時回傳的對話 username。
avatar_url頭像 URL;若未設定則為空字串。
description群組或頻道描述(若有提供)。
last_message_at最近一則訊息的 RFC3339 時間戳記。
format: date-time
last_message_text最近一則訊息的文字預覽(若有)。
unread_count對話中的未讀訊息數量。
format: int64
members_count成員數量;針對群組對話回傳。
format: int64
subscribers_count頻道類對話的訂閱者數量(若有)。
format: int64
is_pinned連接帳號是否已置頂此對話。
is_muted連接帳號是否已將此對話靜音。
created_at渠道有提供時回傳的對話建立時間。
format: date-time
extra標準結構未涵蓋的渠道專屬欄位。
回應
200請求成功,回應內容範例如上。
400請求內容、路徑或參數無效。
401X-Api-Key 請求標頭缺少或無效。
404找不到請求的渠道資源。
409目前操作與既有的渠道帳號或資源衝突。
500服務遇到了未預期的錯誤。
501所選渠道尚未實作此操作。
502渠道轉接器或上游渠道未能完成此操作。
請求
curl -X GET https://api.unifyport.ai/v1/accounts/{account_id}/conversations/info?conversation_id=peer_example&type=group \
-H "X-Api-Key: <YOUR_API_KEY>"回應
{
"data": {
"conversation_id": "peer_example",
"type": "group",
"title": "Group title",
"avatar_url": "",
"description": "...",
"unread_count": 0,
"members_count": 42
}
}