取得會話詳情
即時回傳一條會話嘅詳情。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 路由嘅 ID。
查詢參數
conversation_id想查嘅對話 —— 即係 List conversations 回返嘅 conversation_id 嗰個值。
type對話類型(user、group 或者 channel),用嚟消除查詢嘅歧義。
enum: user, group, channel
請求內容
呢個介面唔需要 JSON 請求內容。
回應內容
conversation_id對話識別碼。發送訊息或者 call 對話路由嗰陣攞佢做目標。
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
}
}