รับรายการการรัน Workflow

รับรายการการรัน Workflow

ใช้สำหรับรับรายการบันทึกการรันของ Workflow โดย Workflow จะถูกระบุโดยอัตโนมัติจากการยืนยันตัวตนด้วย API Key ไม่จำเป็นต้องส่ง workflow_id เพิ่มเติม

ชื่อ ID คำอธิบาย
log_id รหัสบันทึกการรันของ Workflow
workflow_run_id รหัสการรัน Workflow หนึ่งครั้ง ใช้ระบุการรัน Workflow ครั้งนั้น ๆ
input ข้อมูลอินพุตของการรัน Workflow ครั้งนี้
output ข้อมูลเอาต์พุตของการรัน Workflow ครั้งนี้

วิธีการ

GET

URL

https://api-${endpoint}.gptbots.ai/v1/workflow/run/logs

การยืนยันตัวตน

ใช้ Workflow API Key ในการยืนยันตัวตนการเรียกใช้งาน

คำขอ (Request)

ตัวอย่าง

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}'

                    
บล็อกโค้ดนี้ในหน้าต่างลอย

Headers

ฟิลด์ ประเภท คำอธิบาย
Authorization Bearer ${API Key} ตรวจสอบการเรียกใช้งานด้วย Authorization: Bearer ${API Key} กรุณาใช้ Workflow API Key

พารามิเตอร์คำขอ

ฟิลด์ ประเภท จำเป็น คำอธิบาย
conversation_type string Y ประเภทแหล่งที่มาของการรัน รองรับ: ALL, API, AGENT, SHARE, C_WORKFLOW ไม่รองรับการทดสอบรัน DEBUG
user_id string N รหัสผู้ใช้ ใช้กรองบันทึกการรัน Workflow ของผู้ใช้ที่ระบุ
start_time number Y เวลาเริ่มต้นของการค้นหา (timestamp, มิลลิวินาที)
end_time number Y เวลาสิ้นสุดของการค้นหา (timestamp, มิลลิวินาที)
page number Y หมายเลขหน้า เริ่มจาก 1
page_size number Y จำนวนรายการต่อหน้า ค่าที่กำหนดได้ 10-100

การตอบกลับ (Response)

ตัวอย่าง

{ "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
list[].workflow_run_id string รหัสการรัน Workflow หนึ่งครั้ง
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