← 返回目录
📁 API Reference › Reporting

下载异步报表任务结果

您可以使用本接口在异步报表任务完成后,下载报表的任务结果。

v1.2与v1.3版本对比

以下表格概括了 v1.2与v1.3接口的变化。 ``xtable |变化内容{30%}|v1.2{35%}|v1.3{35%}| |---|---|---| | 接口路径 | /v1.2/reports/task/download/ | /v1.3/report/task/download/ | | 请求参数类型|advertiser_id: number |advertiser_id: string | | 新增返回参数| / |code: number<br>message: string<br>data: object<br>download_url: string<br>file_name: string<br>output_format: string<br>request_id`: string |



## 请求

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

**方法** GET

**Header**

```xtable
|字段|类型|描述|
|---|---|---|
|Access-Token {必填}|string|授权访问令牌。请使用您在[创建异步报表任务](https://ads.tiktok.com/marketing_api/docs?id=1740302766489602)中使用的访问令牌。  |

参数

|字段|类型|描述|
|---|---|---|
|advertiser_id{必填}|string|广告主ID。<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。 |

示例

(code curl http)
curl --get -H "Access-Token:xxx" \
--data-urlencode "task_id=TASK_ID" \
https://business-api.tiktok.com/open_api/v1.3/report/task/download/
(/code)

返回

CSV文件流或JSON格式。
下表为JSON格式的返回信息。

注意
如果您在/report/task/create/接口中将output_format设置为CSV_DOWNLOAD或XLSX_DOWNLOAD,返回信息为JSON格式。

参数

|字段|类型|描述|
|---|---|---|
|code |number|返回码。完整返回码列表及描述,可见[附录 - 返回码](https://ads.tiktok.com/marketing_api/docs?id=1737172488964097)。|
|message |string|返回信息。更多信息可见[附录 - 返回码]([附录-返回码](https://ads.tiktok.com/marketing_api/docs?id=1737172488964097)。|
|data|object|返回数据。|
#| download_url | string | 文件下载URL。有效期1小时。若URL失效,您可以使用接口[/report/task/download/](https://ads.tiktok.com/marketing_api/docs?id=1740302808815618)获取新的URL。|
#| file_name | string |文件名称。|
#| output_format | string |输出格式。 枚举值:`CSV_DOWNLOAD`,`XLSX_DOWNLOAD`。|
|request_id |string|请求的日志ID,唯一标识一个请求。|

示例

CSV文件流返回:

(code Success-Response http)
Campaign ID,Campaign Name,Ad Group ID,Ad Group Name,Age,Gender,Cost,Impression,Click
482,Test Campaign 1,578,Test Ad Group 1,13-17,female,107.56,29056,280
482,Test Campaign 1,578,Test Ad Group 1,18-24,female,101.74,22992,203
482,Test Campaign 1,578,Test Ad Group 1,13-17,male,58.78,17063,126
482,Test Campaign 1,578,Test Ad Group 1,18-24,male,57.36,18467,115
622,Test Campaign 2,765,Test Ad Group 2,18-24,male,32.9,267635,1172
482,Test Campaign 1,578,Test Ad Group 1,25-34,female,25.97,8143,105
810,Test Campaign 3,746,Test Ad Group 3,35-44,female,20.31,119359,3214
···
(/code)

JSON返回:

(code Success-Response http)
{
    "code": 0,
    "message": "OK",
    "request_id": "202207282320310102452431071406594F",
    "data": {
        "output_format": "XLSX_DOWNLOAD",
        "file_name": "test_file_name_07_26.xlsx",
        "download_url": "https://ads.tiktok.com/wsos_v2/statistics/object/wsos62e082e99504cb02?expire=1659054031&skipCookie=true&timeStamp=1659050431&sign=1ccc8bd4665a65a941b168652ccd392707798a1dcb9f1eec2229123aca5a0bff"
    }
}
(/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 每日平台更新简报 →