> ## Documentation Index
> Fetch the complete documentation index at: https://germeytechnology-docs-remove-4o-image-nav.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Publisher Tasks

> Publisher Cross-Platform Automatic Publishing 集成指南 - Ace Data Cloud

## 介绍

Publisher Tasks API 用于查询发布任务的执行状态。每个通过 Publish API 创建的任务都可以通过 Tasks API 跟踪其进度，获取发布结果和已发布的 URL。

## 基本用法

### 查询单个任务

```bash theme={null}
curl -X POST 'https://api.acedata.cloud/publisher/tasks' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "action": "retrieve",
    "id": "f1e2d3c4-b5a6-7890-abcd-ef1234567890"
  }'
```

### 响应示例

```json theme={null}
{
  "id": "f1e2d3c4-b5a6-7890-abcd-ef1234567890",
  "request": {
    "title": "Introduction to AI APIs",
    "content": "# Introduction...",
    "channel": "zhihu"
  },
  "response": {
    "success": true,
    "task_id": "f1e2d3c4-b5a6-7890-abcd-ef1234567890",
    "channel": "zhihu",
    "state": "completed",
    "url": "https://zhuanlan.zhihu.com/p/123456789"
  },
  "created_at": 1705312200.0,
  "started_at": 1705312205.0,
  "finished_at": 1705312260.0
}
```

### 批量查询任务

```bash theme={null}
curl -X POST 'https://api.acedata.cloud/publisher/tasks' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "action": "retrieve_batch",
    "ids": [
      "f1e2d3c4-b5a6-7890-abcd-ef1234567890",
      "a9b8c7d6-e5f4-3210-abcd-ef1234567890"
    ]
  }'
```

## 任务状态说明

| 状态        | 说明               |
| --------- | ---------------- |
| pending   | 任务已创建，等待执行       |
| running   | 任务正在执行中          |
| completed | 任务已完成，可获取发布的 URL |
| failed    | 任务执行失败，可查看错误信息   |

## 注意事项

* 任务查询为免费操作，不消耗积分
* 任务结果会保留 30 天
* 建议在提交发布任务后定期轮询任务状态
