全部產品
Search
文件中心

Qoder CN 系列:列出 Sessions

更新時間:Jul 02, 2026

按篩選條件分頁列出 Forward Session。

要求標頭

Header

是否必填

說明

Authorization

Bearer <PAT>

查詢參數

參數

類型

是否必填

預設值

說明

identity_ids

string或array

-

按一個或多個 Identity ID 過濾,支援逗號分隔。

template_id

string

-

按 Forward Template ID 過濾。

source_type

string

-

apiimschedule 過濾。

created_at[gt]

string

-

建立時間嚴格大於該 RFC 3339 時間。

created_at[gte]

string

-

建立時間大於等於該 RFC 3339 時間。

created_at[lt]

string

-

建立時間嚴格小於該 RFC 3339 時間。

created_at[lte]

string

-

建立時間小於等於該 RFC 3339 時間。

updated_at[gt]

string

-

更新時間嚴格大於該 RFC 3339 時間。

updated_at[gte]

string

-

更新時間大於等於該 RFC 3339 時間。

updated_at[lt]

string

-

更新時間嚴格小於該 RFC 3339 時間。

updated_at[lte]

string

-

更新時間小於等於該 RFC 3339 時間。

limit

integer

20

分頁大小,最大 100。

after_id

string

-

向後翻頁遊標。

before_id

string

-

向前翻頁遊標。

order

string

desc

排序方向:descasc

include_archived

boolean

false

是否包含已歸檔 Session。

樣本請求

curl -s -X GET 'https://api.qoder.com.cn/api/v1/forward/sessions' \
  -H "Authorization: Bearer $QODER_PAT"

樣本響應

HTTP 200 OK

{
  "data": [
    {
      "id": "sess_xxx",
      "type": "session",
      "identity_id": "idn_xxx",
      "template": {
        "id": "tmpl_support",
        "type": "template",
        "name": "Support assistant",
        "model": "ultimate",
        "version": 3
      },
      "source_type": "im",
      "status": "idle",
      "title": "Customer support session",
      "incremental_streaming_enabled": true,
      "metadata": {
        "source": "dingtalk"
      },
      "config": {
        "environment_variables": {
          "API_KEY": "sk-xxx"
        }
      },
      "stats": {
        "active_seconds": 30,
        "duration_seconds": 3600
      },
      "usage": {
        "credits": 12.5
      },
      "created_at": "2026-06-22T10:00:00Z",
      "updated_at": "2026-06-22T11:00:00Z"
    }
  ],
  "first_id": "sess_xxx",
  "last_id": "sess_xxx",
  "has_more": false
}

響應欄位

欄位

類型

說明

data

array

當前頁的 Session 對象。

first_id

string|null

當前頁第一條記錄 ID。

last_id

string|null

當前頁最後一條記錄 ID。

has_more

boolean

是否還有更多記錄。

錯誤

HTTP

Type

Code

觸發條件

400

invalid_request_error

invalid_time_range

時間篩選範圍不合法。

400

invalid_request_error

invalid_pagination

分頁參數不合法。

401

authentication_error

authentication_required

PAT 無效或已到期。

備忘

  • after_idbefore_id 不能同時傳入。

  • 當前設計不支援按 status 篩選。

  • Credits 模組未啟用時可省略 usage.credits

相關