API 參考

群組

列出群組

即時列出已加入群組,包括沉默群組。limit 範圍 1..100,預設 50;cursor 無效或過期時由各渠道分別處理。群組的 conversation_id 即群組 id。

GEThttps://api.unifyport.ai/v1/accounts/{account_id}/groups

呼叫前準備

在伺服器端使用資源所屬工作區的 X-Api-Key,執行範例前替換所有預留位置。

參數從哪裡取得
account_id
從建立或查詢帳號的回應取得 data.id。帳號屬於 X-Api-Key 對應的工作區。 取得帳號

請求參數

請求標頭

X-Api-Key
string必填

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

路徑參數

account_id
string必填

用於該 groups 路由的識別字。

查詢參數

cursor
string

渠道不透明游標,應原樣回傳前一回應的 next_cursor;省略或留空從第一頁開始。偽造、過期或跨查詢重用的游標可能被忽略、重設為第一頁或回傳渠道錯誤,不得依賴統一的 400 回應。

limit
integer

單頁數量範圍 1..100;預設值見各端點說明。

minimum: 1 · maximum: 100

請求內容

此介面無需 JSON 請求內容。

如何理解結果

依文件解讀回應欄位與 HTTP 狀態。204 成功沒有回應本文,排查時使用 X-Request-Id。下一步請參閱相關操作。

回應 200 OK

{
  "request_id": "<REQUEST_ID>",
  "data": {
    "items": [
      {
        "id": "group_example",
        "conversation_id": "group_example",
        "name": "Project team",
        "avatar_url": "",
        "member_count": 5,
        "joined_at": "2026-07-01T08:00:00Z",
        "created_at": "2026-06-15T08:00:00Z",
        "description": "Project coordination group",
        "extra": {}
      }
    ],
    "next_cursor": "",
    "has_more": false
  }
}

回應內容

id
string

群組識別字。針對群組,conversation_id 等同此 id。

conversation_id
string

群組的對話識別字;等同 id。

name
string

群組名稱。

avatar_url
string

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

member_count
integer

群組中的成員數量。

format: int64

joined_at
string

連接帳號加入群組的時間(若有)。

format: date-time

created_at
string

渠道回報的群組建立時間(若有)。

format: date-time

description
string

群組描述(若有提供)。

permissions
object

Group-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_only
boolean

true means only administrators may speak; false is an explicit state, not an omitted or default value.

extra
object

渠道擴充的群組欄位;WhatsApp 群組資料可包含公告群組分類,是否回傳取決於本次查詢可用的資料。

is_announcement_group
boolean

僅 WhatsApp 群組提供。true 表示已確認為社群公告群組,false 表示本次資料已確認不符合公告群組條件;缺少表示未知,不回傳 null。此分類不表示目前帳號具備傳送訊息的權限。 獨立於 permissions.admins_only。

next_cursor
string

指向下一頁的不透明游標。請以 cursor 原樣回傳;空字串表示已無更多分頁。

has_more
boolean

當本頁之外仍有更多結果時為 true。

回應

200

200 OK

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

400

請求錯誤

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

401

未授權

X-Api-Key 請求標頭缺少或無效。

409

衝突

目前操作與既有的渠道帳號或資源衝突。

500

伺服器錯誤

服務遇到了未預期的錯誤。

501

渠道尚未實作

所選渠道尚未實作此操作。

502

上游閘道錯誤

渠道轉接器或上游渠道未能完成此操作。

失敗後如何處理

檢查 HTTP 狀態和 error.code/numeric_code,保留 request_id。依原因修正參數、繼續授權或檢查狀態。重試傳送及寫入前確認上次結果,避免重複操作。 錯誤碼參考

invalid_request · 10000 · 400
檢查必填欄位、格式與渠道條件,修正請求後再呼叫。
invalid_api_key · 11001 · 401
檢查 X-Api-Key 與工作區是否有效。