> ## Documentation Index
> Fetch the complete documentation index at: https://docs.acedata.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# Digital Human 任務查詢 API

> Digital Human 整合指南 - Ace Data Cloud

使用 `POST /digital-human/tasks` 查詢自己的影片或聲音任務。先透過 [影片生成指南](https://platform.acedata.cloud/documents/digitalhuman-videos-integration) 建立任務，再儲存返回的 `task_id`。

## 查詢最終結果

```bash theme={null}
curl --request POST 'https://api.acedata.cloud/digital-human/tasks' \
  --header "Authorization: Bearer $ACEDATACLOUD_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{"task_id":"YOUR_TASK_ID"}'
```

### 處理中回應 JSON

```json theme={null}
{
  "success": true,
  "task_id": "YOUR_TASK_ID",
  "trace_id": "YOUR_TRACE_ID",
  "state": "pending",
  "progress": 0
}
```

### 完成回應 JSON

```json theme={null}
{
  "success": true,
  "task_id": "task_...",
  "trace_id": "...",
  "state": "succeed",
  "progress": 100,
  "video_url": "https://cdn.acedata.cloud/634d760216.mp4",
  "duration": 17.2,
  "width": 1280,
  "height": 720
}
```

省略 `action` 時返回平鋪的任務結果。讀取 `state` 和 `progress`，在 `state=succeed` 後讀取影片的 `video_url` 或聲音的 `voice_id`。`state=failed` 表示執行失敗，讀取 `error` 並結束輪詢。任務查詢的 `success` 描述查詢是否成功，生成是否完成由任務狀態決定。

## 詳細記錄與歷史

查詢詳細記錄時提交 `{"action":"retrieve","id":"YOUR_TASK_ID"}`，原始請求位於 `request`，輸出位於 `response`。也可以使用 `task_id` 欄位代替 `id`。

讀取最近歷史時提交 `{"action":"retrieve_batch","limit":20}`，可依 `type`、`created_at_min` 和 `created_at_max` 篩選。結果包含 `count` 與 `items`。這裡的 `retrieve_batch` 返回最近任務歷史，指定若干任務 ID 時逐一查詢即可。

刪除操作使用 `action=delete` 和單一 ID，執行前確認確實需要刪除這筆任務記錄。完整參數與回應欄位見 [任務 API 參考](https://platform.acedata.cloud/documents/digitalhuman-tasks)。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.