批量合规 API
创建批量合规任务
请求创建批量合规任务
HTTP URL | https://open.tiktokapis.com/v2/research/validation_task/create/ |
HTTP 请求方法 | POST |
权限范围 | research.data.basic (必要权限) |
请求头
Key | 类型 | 描述 | 示例值 |
Authorization | 字符串 (String) | 通过 /v2/oauth/token/ 获取的客户端访问令牌。 | Bearer clt.example12345Example12345Example |
请求体参数
需在请求体中使用 form-data 格式。
Key | 类型 | 描述 | 示例 | 是否必填 |
file_data | 文件 (File) | 包含视频 ID 或评论 ID 的文本文件。用户每次最多可提交 1 万个 ID。 | 是 | |
category | 文本 (Text) | 文件内容类别。支持 video 或 comment。 | video | 是 |
示例
curl --location 'https://open.tiktokapis.com/v2/research/validation_task/create/' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer abcdefg' \ --form 'file_data=@"/****/****/****/test file.txt"' \ --form 'category="video"'响应
响应体
Key | 类型 | 描述 |
data | 结构体 (Struct) | 任务关联的任务 ID。 |
error | ErrorStructV2 | Error 对象。 |
示例
{ "data": { "task_id": 12345678910987654321 }, "error": { "code": "ok", "http_status_code": 200, "log_id": "987654321", "message": "ok." } }获取批量合规任务状态
获取批量合规任务状态请求
HTTP URL | https://open.tiktokapis.com/v2/research/validation_task_status/get/ |
HTTP 请求方法 | POST |
权限范围 | research.data.basic (必要权限) |
请求头
Key | 类型 | 描述 | 示例值 |
Authorization | 字符串 (String) | 通过 /v2/oauth/token/ 获取的客户端访问令牌。 | Bearer clt.example12345Example12345Example |
请求体参数
Key | 类型 | 描述 | 示例 | 是否必填 |
task_id | 整数 (int) | 由创建批量合规任务 API 生成的任务 ID。 | 12345678910 | 是 |
示例
curl --location 'https://open.tiktokapis.com/v2/research/validation_task_status/get/' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer 1234567891011' \ --data '{ "task_id":12345678910 }'响应
响应体
Key | 类型 | 描述 |
data | 结构体 (Struct) | 当前任务状态。 有效值:Completed、Processing 和 Failed。 |
error | ErrorStructV2 | Error 对象。 |
示例
{ "data": { "task_status": "Completed" }, "error": { "code": "ok", "http_status_code": 200, "log_id": "12345678910", "message": "ok." } }下载已完成的批量合规任务
批量合规任务下载请求
HTTP URL | https://open.tiktokapis.com/v2/research/validation_task/download/ |
HTTP 请求方法 | POST |
权限范围 | research.data.basic (必要权限) |
请求头
Key | 类型 | 描述 | 示例值 |
Authorization | 字符串 (String) | 通过 /v2/oauth/token/ 获取的客户端访问令牌。 | Bearer clt.example12345Example12345Example |
请求体参数
Key | 类型 | 描述 | 示例 | 是否必填 |
task_id | 整数 (int) | 由创建批量合规任务 API 生成的任务 ID。 | 12345678910 | 是 |
示例
curl --location 'https://open.tiktokapis.com/v2/research/validation_task_status/get/' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer 1234567891011' \ --data '{ "task_id":12345678910 }'响应
点击“Send and Download(发送并下载)”,系统将自动下载包含有效 ID 的文本文件。