88API88API
使用指南AI 應用API 文件幫助支援
介面模組使用指南

任務中心模組

功能說明

介面前綴統一為 https://88api.ai

查詢目前帳戶的非同步任務(如影片生成任務),可檢視任務狀態、進度、消耗和結果。

🔐 使用者鑑權

獲取我的任務

  • 介面名稱:獲取我的任務
  • HTTP 方法:GET
  • 路徑:/api/task/self
  • 鑑權要求:使用者
  • 功能簡介:分頁獲取當前使用者的任務列表,支援按平臺、任務 ID、狀態等條件過濾

💡 請求示例:

const response = await fetch('/api/task/self?p=1&page_size=20&task_id=cgt-20261014093000-x7k2m&status=SUCCESS&action=textGenerate&start_timestamp=1640908800&end_timestamp=1640995200', {
  method: 'GET',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer your_user_token',
    'New-Api-User': 'your_user_id'
  }
});
const data = await response.json();

✅ 成功響應示例:

{
  "success": true,
  "message": "",
  "data": {
    "items": [
      {
        "id": 1,
        "created_at": 1640908800,
        "updated_at": 1640909000,
        "task_id": "cgt-20261014093000-x7k2m",
        "platform": "54",
        "user_id": 1,
        "quota": 1000,
        "action": "textGenerate",
        "status": "SUCCESS",
        "fail_reason": "",
        "submit_time": 1640908800,
        "start_time": 1640908900,
        "finish_time": 1640909000,
        "progress": "100%",
        "properties": {},
        "data": {}
      }
    ],
    "total": 25,
    "page": 1,
    "page_size": 20
  }
}

❗ 失敗響應示例:

{
  "success": false,
  "message": "獲取任務列表失敗"
}

🧾 欄位說明:

  • p (數字): 頁碼,預設為 1
  • page_size (數字): 每頁數量,預設為 20
  • platform (字串): 任務平臺編號,可選,一般無需填寫
  • task_id (字串): 任務 ID 過濾,可選
  • status (字串): 任務狀態過濾,可選值:"NOT_START"、"SUBMITTED"、"QUEUED"、"IN_PROGRESS"、"FAILURE"、"SUCCESS"、"UNKNOWN"
  • action (字串): 任務型別過濾,如 "textGenerate"(文生影片)、"generate"(圖生影片)等
  • start_timestamp (數字): 開始時間戳,可選
  • end_timestamp (數字): 結束時間戳,可選

🧾 返回欄位說明:

  • id (數字): 記錄 ID
  • task_id (字串): 任務 ID
  • platform (字串): 任務平臺的內部編號,可忽略
  • user_id (數字): 使用者 ID
  • quota (數字): 消耗的配額
  • action (字串): 任務型別
  • status (字串): 任務狀態
  • fail_reason (字串): 失敗原因
  • submit_time (數字): 提交時間戳
  • start_time (數字): 開始時間戳
  • finish_time (數字): 完成時間戳
  • progress (字串): 進度百分比
  • properties (物件): 任務屬性
  • data (物件): 任務結果資料
  • total (數字): 符合條件的任務總記錄數
  • page (數字): 當前返回的頁碼
  • page_size (數字): 每頁展示的任務記錄數