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 路由嘅 ID。

查詢參數

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

下一頁嘅 opaque cursor。攞返佢做 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 與工作區是否有效。