群組
取得群組詳情
即時回傳單一群組的詳情。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
- 要操作的群組 — 即列出群組時回傳的 id。因渠道 id 可能含有 @ 或 :,故保留於查詢字串中。
請求參數
請求標頭
X-Api-Key工作區 API Key,工作區會由此標頭解析得到。
路徑參數
account_id用於該 groups 路由的識別字。
查詢參數
group_id要操作的群組 — 即列出群組時回傳的 id。因渠道 id 可能含有 @ 或 :,故保留於查詢字串中。
請求內容
此介面無需 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 與工作區是否有效。