取得 Workflow 執行列表
取得 Workflow 執行列表
用於取得 Workflow 的執行日誌列表。Workflow 由 API Key 自動驗證確定,無需額外傳入 workflow_id。
| ID 名稱 | 描述 |
|---|---|
| log_id | Workflow 執行日誌 ID。 |
| workflow_run_id | Workflow 單次執行 ID,用於標識一次 Workflow 執行。 |
| input | Workflow 本次執行的輸入內容。 |
| output | Workflow 本次執行的輸出內容。 |
請求方式
GET
調用地址
https://api-${endpoint}.gptbots.ai/v1/workflow/run/logs
調用驗證
使用 Workflow API Key 進行調用驗證。
請求
請求範例
curl -X GET 'https://api-${endpoint}.gptbots.ai/v1/workflow/run/logs?conversation_type=API&user_id=your_user_id&start_time=1785125443602&end_time=1785125447498&page=1&page_size=10' \
-H 'Authorization: Bearer ${API Key}'
curl -X GET 'https://api-${endpoint}.gptbots.ai/v1/workflow/run/logs?conversation_type=API&user_id=your_user_id&start_time=1785125443602&end_time=1785125447498&page=1&page_size=10' \
-H 'Authorization: Bearer ${API Key}'
此代碼塊在浮窗中顯示
請求標頭
| 欄位 | 類型 | 描述 |
|---|---|---|
| Authorization | Bearer ${API Key} | 使用 Authorization: Bearer ${API Key} 進行調用驗證,請使用 Workflow API Key。 |
請求參數
| 欄位 | 類型 | 必填 | 描述 |
|---|---|---|---|
| conversation_type | string | 是 | 執行來源類型。支援:ALL、API、AGENT、SHARE、C_WORKFLOW。不支援試執行 DEBUG。 |
| user_id | string | 否 | 用戶標識,用於篩選指定用戶的 Workflow 執行記錄。 |
| start_time | number | 是 | 查詢開始時間,毫秒時間戳。 |
| end_time | number | 是 | 查詢結束時間,毫秒時間戳。 |
| page | number | 是 | 頁碼,從 1 開始。 |
| page_size | number | 是 | 每頁數量,取值範圍 10-100。 |
回應
回應範例
{
"list": [
{
"log_id": "6a66da44435da934b2e67e49",
"workflow_run_id": "6a66da44435da934b2e67e49",
"input": "{}",
"output": "{\"output\":\"{\\\"text\\\":\\\"Workflow output text\\\",\\\"image\\\":[],\\\"audio\\\":[]}\"}"
}
],
"total": 1
}
{
"list": [
{
"log_id": "6a66da44435da934b2e67e49",
"workflow_run_id": "6a66da44435da934b2e67e49",
"input": "{}",
"output": "{\"output\":\"{\\\"text\\\":\\\"Workflow output text\\\",\\\"image\\\":[],\\\"audio\\\":[]}\"}"
}
],
"total": 1
}
此代碼塊在浮窗中顯示
成功回應
| 欄位 | 類型 | 描述 |
|---|---|---|
| list | array | Workflow 執行日誌列表。 |
| total | number | 符合查詢條件的總數。 |
| list[].log_id | string | Workflow 執行日誌 ID。 |
| list[].workflow_run_id | string | Workflow 單次執行 ID。 |
| list[].input | string | 輸入內容,JSON 字串。 |
| list[].output | string | 輸出內容,JSON 字串。 |
失敗回應
| 欄位 | 類型 | 描述 |
|---|---|---|
| code | int | 錯誤碼。 |
| message | string | 錯誤詳情。 |
錯誤碼
| Code | Message |
|---|---|
| 40000 | 參數錯誤 |
| 40001 | 請求過於頻繁 |
| 40101 | Header Authorization is empty |
| 40127 | Developer authentication failed |
