群組
取得群詳情
即時回傳單個群嘅詳情。group_id 走 query 參數傳入(可能含 @ / : 等字符,所以唔放喺 path)。搵唔到群會回傳 404。
https://api.unifyport.ai/v1/accounts/{account_id}/groups/info呼叫前準備
在伺服器端使用資源所屬工作區的 X-Api-Key,執行範例前替換所有預留位置。
參數從哪裡取得
- account_id
- 從建立或查詢帳號的回應取得 data.id。帳號屬於 X-Api-Key 對應的工作區。 攞帳號
- group_id
- 想操作嘅群組 —— 即係 List groups 回返嘅 id。因為渠道嘅 id 入面可能有 @ 或者 :,所以擺喺 query string 度。
請求參數
請求標頭
X-Api-Key工作區 API Key,工作區會由呢個標頭解析得出嚟。
路徑參數
account_id用嚟識別嗰條 groups 路由嘅 ID。
查詢參數
group_id想操作嘅群組 —— 即係 List groups 回返嘅 id。因為渠道嘅 id 入面可能有 @ 或者 :,所以擺喺 query string 度。
請求內容
呢個介面唔需要 JSON 請求內容。
如何理解結果
依文件解讀回應欄位與 HTTP 狀態。204 成功沒有回應本文,排查時使用 X-Request-Id。下一步請參閱相關操作。
回應 200 OK
{
"request_id": "<REQUEST_ID>",
"data": {
"id": "group_example",
"conversation_id": "group_example",
"name": "Project team",
"avatar_url": "",
"member_count": 5,
"description": "..."
}
}
回應內容
id群組識別碼。群組嘅 conversation_id 同呢個 id 一樣。
conversation_id群組嘅對話識別碼;同 id 一樣。
name群組名稱。
avatar_url群組頭像 URL;冇設定嘅話就係空字串。
member_count群組入面嘅成員數目。
format: int64
joined_at連接帳號加入群組嘅時間,有就回。
format: date-time
created_at渠道回報嘅群組建立時間,有就回。
format: date-time
description群組描述,有就回。
permissionsobjectGroup-wide speaking permissions, returned only when explicitly supplied by the source. Missing means unknown; admins_only=false permits ordinary members to speak, but does not guarantee this account can send.
permissionsGroup-wide speaking permissions, returned only when explicitly supplied by the source. Missing means unknown; admins_only=false permits ordinary members to speak, but does not guarantee this account can send.
admins_onlytrue means only administrators may speak; false is an explicit state, not an omitted or default value.
extraobject渠道擴充的群組欄位;WhatsApp 群組資料可包含公告群組分類,是否回傳取決於本次查詢可用的資料。
extra渠道擴充的群組欄位;WhatsApp 群組資料可包含公告群組分類,是否回傳取決於本次查詢可用的資料。
is_announcement_group僅 WhatsApp 群組提供。true 表示已確認為社群公告群組,false 表示本次資料已確認不符合公告群組條件;缺少表示未知,不回傳 null。此分類不表示目前帳號具備傳送訊息的權限。 獨立於 permissions.admins_only。
回應
200200 OK
請求成功,回應內容嘅例子如上。
400請求錯誤
請求內容、路徑或者參數無效。
401未授權
X-Api-Key 請求標頭缺少或者無效。
404搵唔到資源
搵唔到請求嘅渠道資源。
409衝突
目前操作同現有嘅渠道帳號或者資源衝突。
500伺服器錯誤
服務遇到咗未預期嘅錯誤。
501渠道未實作
所選渠道未實作呢個操作。
502上游閘道錯誤
渠道轉接器或者上游渠道未能完成呢個操作。
失敗後如何處理
檢查 HTTP 狀態和 error.code/numeric_code,保留 request_id。依原因修正參數、繼續授權或檢查狀態。重試傳送及寫入前確認上次結果,避免重複操作。 錯誤碼參考
- invalid_request · 10000 · 400
- 檢查必填欄位、格式與渠道條件,修正請求後再呼叫。
- invalid_api_key · 11001 · 401
- 檢查 X-Api-Key 與工作區是否有效。