媒体素材

GET accounts/:account_id/media_creatives

检索与当前账号关联的部分或所有媒体素材的详细信息。

资源 URL

https://ads-api.twitter.com/10/accounts/:account_id/media_creatives

参数

名称 说明
account_id
必需

所使用账号的标识符。出现在资源路径中,通常是所有广告商 API 请求的必要参数,不包含 GET accounts。指定账号必须与已验证的用户关联。

类型:string

示例:18ce54d4x5t

campaign_id
可选

将响应范围限定为与指定广告活动关联的媒体素材。

类型:string

示例:8gdx6

count
可选

指定每个不同请求尝试检索的记录数量。

类型:int

默认值:200
最小值、最大值:11000
cursor
可选

指定光标以获取下一页结果。参阅分页了解更多信息。

类型:string

示例:8x7v00oow

line_item_ids
可选

通过指定以逗号分隔的标识符列表,将响应范围限定为与指定行项目关联的媒体素材。最多可提供 200 个 ID。

类型:string

示例:8v7jo

media_creative_ids
可选

通过指定以逗号分隔的标识符列表,将响应范围限定为所需的媒体素材。最多可提供 200 个 ID。

类型:string

示例:1bzq3

sort_by
可选

根据支持的属性,按升序或降序排序。参阅排序了解更多信息。

类型:string

示例:created_at-asc

with_deleted
可选

在请求中包含已删除的结果。

类型:boolean

默认值:false
可能值:truefalse
with_total_count
可选

包含 total_count 响应属性。

注意:不包含此参数和 cursor

注意:包含 total_count 的请求速率限制较低,目前设置为每 15 分钟 200 次。

类型:boolean

默认值:false
可能值:truefalse

请求示例

GET https://ads-api.twitter.com/10/accounts/18ce54d4x5t/media_creatives?media_creative_ids=1bzq3

响应示例

{
  "request": {
    "params": {
      "account_id": "18ce54d4x5t",
      "media_creative_ids": [
        "1bzq3"
      ]
    }
  },
  "next_cursor": null,
  "data": [
    {
      "line_item_id": "8v7jo",
      "landing_url": "https://dev.twitter.com",
      "creative_type": "INTERSTITIAL_LANDSCAPE_TABLET",
      "id": "1bzq3",
      "entity_status": "ACTIVE",
      "created_at": "2017-07-05T06:00:42Z",
      "account_media_id": "10miy",
      "updated_at": "2019-01-11T20:21:26Z",
      "approval_status": "ACCEPTED",
      "deleted": false
    }
  ]
}

GET accounts/:account_id/media_creatives/:media_creative_id

检索与当前账号关联的特定媒体素材的详细信息。

资源 URL

https://ads-api.twitter.com/10/accounts/:account_id/media_creatives/:media_creative_id

参数

名称 说明
account_id
必需

所使用账号的标识符。出现在资源路径中,通常是所有广告商 API 请求的必要参数,不包含 GET accounts。指定账号必须与已验证的用户关联。

类型:string

示例:18ce54d4x5t

media_creative_id
必需

请求中对正在操作的媒体素材的引用。

类型:string

示例:43853bhii885

with_deleted
可选

在请求中包含已删除的结果。

类型:boolean

默认值:false
可能值:truefalse

请求示例

GET https://ads-api.twitter.com/10/accounts/18ce54d4x5t/media_creatives/1bzq3

响应示例

{
  "request": {
    "params": {
      "media_creative_id": "1bzq3",
      "account_id": "18ce54d4x5t"
    }
  },
  "data": {
    "line_item_id": "8v7jo",
    "landing_url": "https://dev.twitter.com",
    "creative_type": "INTERSTITIAL_LANDSCAPE_TABLET",
    "id": "1bzq3",
    "entity_status": "ACTIVE",
    "created_at": "2017-07-05T06:00:42Z",
    "account_media_id": "10miy",
    "updated_at": "2019-01-11T20:21:26Z",
    "approval_status": "ACCEPTED",
    "deleted": false
  }
}

POST accounts/:account_id/media_creatives

账号媒体对象与指定行项目相关联。

使用此端点在 Twitter 受众平台上推广插播广告(当账号媒体 creative_typePREROLL 时)或图片广告(例如 BANNERINTERSTITIAL)。

注意:要将媒体资源添加到账号媒体资源中,可使用 POST accounts/:account_id/media_library 端点。

资源 URL

https://ads-api.twitter.com/10/accounts/:account_id/media_creatives

参数

名称 说明
account_id
required

所使用账号的标识符。出现在资源路径中,通常是所有广告商 API 请求的必要参数,不包含 GET accounts。指定账号必须与已验证的用户关联。

类型:string

示例:18ce54d4x5t

account_media_id
required

请求中对正在操作的账号媒体实体的引用。

类型:string

示例:10miy

line_item_id
required

请求中对正在操作的行项目的引用。

类型:string

示例:8v7jo

landing_url
sometimes required

将用户定向到的网站的 URL。只能用于 TAP 图像(即“展示素材”)。如果用于前置广告资源,此值将被忽略。要将 URL 与前置广告资源关联起来,可使用 POST accounts/:account_id/preroll_call_to_actions 端点。

注意:行项目目标设置为 WEBSITE_CLICKS 时为必需。

类型:string

示例:https://blog.twitter.com/

请求示例

POST https://ads-api.twitter.com/10/accounts/18ce54d4x5t/media_creatives?line_item_id=8v7jo&account_media_id=10miy

响应示例

{
  "request": {
    "params": {
      "line_item_id": "8v7jo",
      "account_media_id": "10miy",
      "account_id": "18ce54d4x5t"
    }
  },
  "data": {
    "line_item_id": "8v7jo",
    "landing_url": "https://dev.twitter.com",
    "creative_type": "INTERSTITIAL_LANDSCAPE_TABLET",
    "id": "1bzq3",
    "entity_status": "ACTIVE",
    "created_at": "2017-07-05T06:00:42Z",
    "account_media_id": "10miy",
    "updated_at": "2019-01-11T20:21:26Z",
    "approval_status": "ACCEPTED",
    "deleted": false
  }
}

DELETE accounts/:account_id/media_creatives/:media_creative_id

删除属于当前账号的指定媒体素材。

资源 URL

https://ads-api.twitter.com/10/accounts/:account_id/media_creatives/:media_creative_id

参数

名称 说明
account_id
必需

所使用账号的标识符。出现在资源路径中,通常是所有广告商 API 请求的必要参数,不包含 GET accounts。指定账号必须与已验证的用户关联。

类型:string

示例:18ce54d4x5t

media_creative_id
必需

请求中对正在操作的媒体素材的引用。

类型:string

示例:1bzq3

请求示例

DELETE https://ads-api.twitter.com/10/accounts/18ce54d4x5t/media_creatives/1bzq3

响应示例

{
  "request": {
    "params": {
      "media_creative_id": "1bzq3",
      "account_id": "18ce54d4x5t"
    }
  },
  "data": {
    "line_item_id": "8v7jo",
    "landing_url": "https://dev.twitter.com",
    "creative_type": "INTERSTITIAL_LANDSCAPE_TABLET",
    "id": "1bzq3",
    "entity_status": "ACTIVE",
    "created_at": "2017-07-05T06:00:42Z",
    "account_media_id": "10miy",
    "updated_at": "2021-04-16T21:02:55Z",
    "approval_status": "ACCEPTED",
    "deleted": true
  }
}