← 返回目录
📁 API Reference › Images

获取图片信息

您可以使用本接口从素材库中获取指定图片的信息。

v1.2与v1.3版本对比

以下表格概括了 v1.2与v1.3接口的变化。 xtable |变化内容{30%}|v1.2{35%}|v1.3{35%}| |---|---|---| |接口路径|/v1.2/file/image/ad/info/|/v1.3/file/image/ad/info/| |请求参数类型 |`advertiser_id`: number|`advertiser_id`: string| |新增返回参数| / |`is_carousel_usable`| |废弃返回参数| / | `id`: string |

请求

地址 https://business-api.tiktok.com/open_api/v1.3/file/image/ad/info/

方法 GET

Header

|字段|类型|描述|
|---|---|---|
|Access-Token {必填}|string|授权访问令牌,可以通过[获取Access token](https://ads.tiktok.com/marketing_api/docs?id=1738373164380162)接口获取。 |

参数

|字段|类型|描述|
|---|---|---|
|advertiser_id {必填}|string|广告账号。 |
|image_ids {必填}|string[]|图片 ID 列表。单次最多请求 100 个。<br><p><span style="color:darkred"><b>注意</b></span>:若您在TikTok 广告管理平台创建广告后,使用[/ad/get/](https://ads.tiktok.com/marketing_api/docs?id=1735735588640770)获取对应广告缩略图的图片ID,则这些缩略图的图片ID不支持传入本字段,因为这些缩略图未上传到素材库,也未和广告账户绑定。  |

示例

(code curl http)
curl --location  --request GET 'https://business-api.tiktok.com/open_api/v1.3/file/image/ad/info/?advertiser_id={{advertiser_id}}&image_ids=["{{image_id}}"]' \
--header 'Access-Token: {{Access-Token}}'
(/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|返回数据。 |
#|list |object[]|图片信息列表。 |
##|image_id |string|图片 ID,用于广告投放中创建广告。|
##|material_id|string|素材ID。|
##| is_carousel_usable | boolean | 该图片的来源是否适用于轮播广告。  <br><p><span style="color:darkred"><b>注意</b></span>:若要在轮播广告中使用图片,需确保: <ul><li>本字段的值为`true`,<strong>且</strong></li><li>图片满足[创建轮播广告-步骤-创建一个广告](https://ads.tiktok.com/marketing_api/docs?id=1766217791987713)中列出的规格要求。  </li></ul>|
##|width |number|图片宽度。 |
##|format|string|图片格式。 |
##|image_url |string|图片URL,1小时有效期,过期后需重新获取。 |
##|height |number|图片高度。 |
##|signature |string|图片MD5。 |
##|size |number|图片大小,单位Byte。|
##|file_name |string |图片名称。|
##|create_time |string |创建时间。UTC 时间,格式:2020-06-10T07:39:14Z。 |
##|modify_time |string |修改时间。UTC 时间,格式:2020-06-10T07:39:14Z。 |
##|displayable|bool |图片能否在平台中展示|
|request_id |string|请求的日志id,唯一标识一个请求 |

示例

(code Success-Response http)
HTTPS/1.1 200 OK
{
    "code": 0,
    "message": "OK",
    "request_id": "{{request_id}}",
    "data": {
        "list": [
            {
                "is_carousel_usable": true,
                "size": 39779,
                "format": "jpeg",
                "modify_time": "{{modify_time}}",
                "create_time": "{{create_time}}",
                "displayable": false,
                "width": 750,
                "material_id": "{{material_id}}",
                "image_url": "{{image_url}}",
                "file_name": "{{file_name}}",
                "image_id": "{{image_id}}",
                "signature": "{{signature}}",
                "height": 422
            }
        ]
    }
}
(/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 每日平台更新简报 →