← 返回目录
📁 API Reference › Files

完成分片上传

您可以使用本接口完成分片上传任务。

v1.2与v1.3版本对比

以下表格概括了 v1.2与v1.3接口的变化。 ``xtable |变化内容{30%}|v1.2{35%}|v1.3{35%}| |---|---|---| |接口路径| /v1.2/file/finish/upload/|/v1.3/file/finish/upload/| |请求参数类型|advertiser_id: number|advertiser_id`: string|


## 请求

**地址** https://business-api.tiktok.com/open_api/v1.3/file/finish/upload/

**方法** POST

**Header**

``` xtable
|字段|类型|描述|
|---|---|---|
|Access-Token {必填}|string|授权访问令牌。可以通过[获取访问令牌](https://ads.tiktok.com/marketing_api/docs?id=1738373164380162)接口获取。|
|Content-Type {必填}|string|请求信息类型。<br>允许格式:`application/json`。|

参数

|字段|类型|描述|
|---|---|---|
|advertiser_id {必填}|string|广告主ID。|
|upload_id {必填}|string|上传任务ID。|

示例

(code Curl curl)
curl -H "Access-Token:xxx" -H "Content-Type:application/json" -X POST \\
-d '{
    "advertiser_id": "ADVERTISER_ID", 
    "upload_id": "UPLOAD_ID"
}' \\
https://business-api.tiktok.com/open_api/v1.3/file/finish/upload/
(/code)

返回

|字段|类型|描述|
|---|---|---|
|code |number|返回码,详见[附录-返回码](https://ads.tiktok.com/marketing_api/docs?id=1737172488964097)。|
|message |string|返回信息,详见[附录-返回码](https://ads.tiktok.com/marketing_api/docs?id=1737172488964097)。|
|data|object|返回数据。|
#|file_id|string|文件的ID,您可以通过`file_id`获取文件库中的文件,上传到TikTok投放平台素材库。有效时间24小时。|
#|file_name|string|文件名称。|
#|create_time|string|文件上传时间。格式:YYYY-MM-DD HH:MM:SS,UTC时区。示例:2020-06-10 07:39:14。|
#|size|number|文件大小,单位为字节。|
|request_id|string|请求的日志id,唯一标识一个请求。  |

示例

(code Success-Response http)
HTTPS/1.1 200 OK
{
    "message": "OK",
    "code": 0,
    "data": {
        "file_id": "444a00c2cdf498ffe4860045",
        "file_name": "test-start-upload",
        "create_time": "2021-01-13 09:49:54",
        "size": 1073741824
    },
    "request_id": "2021011407430001023102002329278"
}
(/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 每日平台更新简报 →