API 參考
會話GET

取得會話詳情

即時回傳一條會話的詳情。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
string必填

工作區 API Key,工作區會由此標頭解析得到。

路徑參數

account_id
string必填

用於該 conversations 路由的識別字。

查詢參數

conversation_id
string必填

要查詢的對話 — 即列出對話時以 conversation_id 回傳的值。

type
string

對話類型(user、group 或 channel),用於釐清查詢對象。

enum: user, group, channel

請求內容

此介面無需 JSON 請求內容。

回應內容

conversation_id
string

對話識別字。傳送訊息或呼叫對話相關路由時,請以此作為目標。

type
string

對話類型:user、group 或 channel。

enum: user, group, channel

title
string

對話的顯示標題。

username
string

渠道有提供時回傳的對話 username。

avatar_url
string

頭像 URL;若未設定則為空字串。

description
string

群組或頻道描述(若有提供)。

last_message_at
string

最近一則訊息的 RFC3339 時間戳記。

format: date-time

last_message_text
string

最近一則訊息的文字預覽(若有)。

unread_count
integer

對話中的未讀訊息數量。

format: int64

members_count
integer

成員數量;針對群組對話回傳。

format: int64

subscribers_count
integer

頻道類對話的訂閱者數量(若有)。

format: int64

is_pinned
boolean

連接帳號是否已置頂此對話。

is_muted
boolean

連接帳號是否已將此對話靜音。

created_at
string

渠道有提供時回傳的對話建立時間。

format: date-time

extra
object

標準結構未涵蓋的渠道專屬欄位。

回應

200
200 OK

請求成功,回應內容範例如上。

400
請求錯誤

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

401
未授權

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