← 返回目录
📁 API Reference › Reporting

取消异步报表任务

您可以使用本接口取消队列中或处理中的异步报表任务。

取消不正确或处理时间过长的任务可以使队列中的其他任务进入处理中状态,帮助您节省任务的等待时间。

请求

地址 https://business-api.tiktok.com/open_api/v1.3/report/task/cancel/

方法 POST

Header

|字段{30%}|类型{15%}|描述{55%}|
|---|---|---|
|Access-Token {必填}|string|授权访问令牌。可以通过[获取访问令牌](https://ads.tiktok.com/marketing_api/docs?id=1738373164380162)接口获取。<br><br><p><span style="color:darkred"><b>注意</b></span>:需指定创建异步报表任务时使用的访问令牌,否则请求可能失败。|
|Content-Type {必填}|string|请求信息类型。<br>允许格式:`application/json`。|

参数

|字段{30%}|类型{15%}|描述{55%}|
|---|---|---|
| advertiser_id {必填} | string | 广告主 ID。<br><br><p><span style="color:darkred"><b>注意</b></span>:若您调用[/report/task/create/](https://ads.tiktok.com/marketing_api/docs?id=1740302766489602) (POST方法)时传入了`advertiser_ids`,您需将本字段设置为`advertiser_ids`中指定的广告主ID其中之一。|
|task_id {必填}|string| 队列中或处理中的异步报表任务的 ID。<br><br>若想获取满足条件的任务 ID,需先使用[/report/task/create/](https://ads.tiktok.com/marketing_api/docs?id=1740302766489602)创建异步报表任务,随后使用[/report/task/check/](1740302781443073.html)查询任务状态,确保任务的`status`为 `QUEUING`或 `PROCESSING`。 |

示例

(code curl http)
curl --location --request POST 'https://business-api.tiktok.com/open_api/v1.3/report/task/cancel/' \
--header 'Access-Token: {{Access-Token}}' \
--header 'Content-Type: application/json' \
--data '{
    "advertiser_id": "{{advertiser_id}}",
    "task_id":"{{task_id}}"
}'
(/code)

返回

|字段{30%}|类型{15%}|描述{55%}|
|---|---|---|
|code |number| 返回码。完整返回码列表及描述,参见 [附录 - 返回码](https://ads.tiktok.com/marketing_api/docs?id=1737172488964097)。|
|message |string| 返回信息。更多信息参见 [附录 - 返回码](https://ads.tiktok.com/marketing_api/docs?id=1737172488964097)。 |
|request_id |string| 请求的日志ID,唯一标识一个请求。 |
|data |object| 返回数据。 |
#|status |string| 任务状态。<br><br>枚举值:`CANCELED`(任务已取消)。<br><br>若任务成功取消,本字段值将为`CANCELED`。<br>若任务取消失败,将出现报错。 |

示例

(code Success-Response http)
HTTPS/1.1 200 OK
{
    "code": 0,
    "message": "OK",
    "request_id": "{{request_id}}",
    "data": {
        "status": "CANCELED"
    }
}
(/code)

内容来源:TikTok API for Business 官方文档 · 本地归档

在接这个接口时卡住了?
Stuck wiring this API into production? We build ad-delivery tooling on these platforms — campaign automation, reporting pipelines, error-handling and migration between API versions.
联系我们 · Talk to us 每日平台更新简报 →