视频网站卡片

注意:要将卡片关联到推文,请通过 POST accounts/:account_id/tweetPOST statuses/updatePOST accounts/:account_id/scheduled_tweets 端点,使用 card_uri 参数来完成。

GET accounts/:account_id/cards/video_website

检索与当前账号关联的部分或所有视频网站卡片详细信息。

资源 URL

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

参数

名称 说明
account_id
必需

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

类型:string

示例:18ce54d4x5t

card_ids
可选

通过指定以逗号分隔的标识符列表,将响应范围限定至所需的视频网站卡片。最多可提供 200 个 ID。

类型:string

示例:5a4vf

count
可选

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

类型:int

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

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

类型:string

示例:8x7v00oow

q
可选

可选查询,按 name 指定卡片范围。省略此参数可检索所有卡片。最大长度:80 个字符。

注意:执行不区分大小写的前缀匹配。

类型:string

示例:dtc

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/cards/video_website?card_ids=5a4vf

响应示例

{
  "request": {
    "params": {
      "card_type": "video_website",
      "card_ids": [
        "5a4vf"
      ],
      "account_id": "18ce54d4x5t"
    }
  },
  "next_cursor": null,
  "data": [
    {
      "video_poster_height": "9",
      "name": "video website card",
      "website_shortened_url": "https://t.co/zadeUSVD18",
      "video_height": "9",
      "media_url": "https://video.twimg.com/amplify_video/vmap/958224897255211013.vmap",
      "content_duration_seconds": "8",
      "video_owner_id": "756201191646691328",
      "media_key": "13_958224897255211013",
      "website_display_url": "developer.twitter.com",
      "id": "5a4vf",
      "video_width": "16",
      "website_dest_url": "https://developer.twitter.com",
      "created_at": "2018-01-30T06:30:01Z",
      "card_uri": "card://958225772740714496",
      "title": "Twitter Developers",
      "website_url": "https://developer.twitter.com",
      "updated_at": "2018-01-30T06:30:01Z",
      "poster_media_url": "https://pbs.twimg.com/amplify_video_thumb/958224897255211013/img/EnyDab6vErGm4Avd.jpg",
      "video_poster_width": "16",
      "deleted": false,
      "card_type": "VIDEO_WEBSITE"
    }
  ]
}

GET accounts/:account_id/cards/video_website/:card_id

检索与当前账号关联的特定视频网站卡片。

资源 URL

https://ads-api.twitter.com/10/accounts/:account_id/cards/video_website/:card_id

参数

名称 说明
account_id
必需

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

类型:string

示例:18ce54d4x5t

card_id
必需

请求中对正在操作的视频网站卡片的引用。

类型:string

示例:5a4vf

with_deleted
可选

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

类型:boolean

默认值:false
可能值:truefalse

请求示例

GET https://ads-api.twitter.com/10/accounts/18ce54d4x5t/cards/video_website/5a4vf

响应示例

{
  "request": {
    "params": {
      "card_type": "video_website",
      "card_id": "5a4vf",
      "account_id": "18ce54d4x5t"
    }
  },
  "data": {
    "video_poster_height": "9",
    "name": "video website card",
    "website_shortened_url": "https://t.co/zadeUSVD18",
    "video_height": "9",
    "media_url": "https://video.twimg.com/amplify_video/vmap/958224897255211013.vmap",
    "content_duration_seconds": "8",
    "video_owner_id": "756201191646691328",
    "media_key": "13_958224897255211013",
    "website_display_url": "developer.twitter.com",
    "id": "5a4vf",
    "video_width": "16",
    "website_dest_url": "https://developer.twitter.com",
    "created_at": "2018-01-30T06:30:01Z",
    "card_uri": "card://958225772740714496",
    "title": "Twitter Developers",
    "website_url": "https://developer.twitter.com",
    "updated_at": "2018-01-30T06:30:01Z",
    "poster_media_url": "https://pbs.twimg.com/amplify_video_thumb/958224897255211013/img/EnyDab6vErGm4Avd.jpg",
    "video_poster_width": "16",
    "deleted": false,
    "card_type": "VIDEO_WEBSITE"
  }
}

POST accounts/:account_id/cards/video_website

创建关联到指定账号的新视频网站卡片。

资源 URL

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

参数

名称 说明
account_id
必需

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

类型:string

示例:18ce54d4x5t

media_key
必需

在本卡片中使用的视频媒体密钥。

注意:视频必须位于账号的媒体库

注意:宽高比必须为 16:9 或 1:1。

类型:string

示例:13_1168079965037467209

name
必需

卡片名称。最大长度:80 个字符。

类型:string

示例:video website card

title
必需

卡片标题。最大长度:70 个字符。

类型:string

示例:Twitter Developers

website_url
必需

重定向用户转到的网站 URL。

类型:string

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

请求示例

POST https://ads-api.twitter.com/10/accounts/18ce54d4x5t/cards/video_website?name=video website card&title=Twitter Developers&media_key=13_958224897255211013&website_url=https://developer.twitter.com

响应示例

{
  "data": {
    "video_poster_height": "9",
    "name": "video website card",
    "website_shortened_url": "https://t.co/zadeUSVD18",
    "video_height": "9",
    "media_url": "https://video.twimg.com/amplify_video/vmap/958224897255211013.vmap",
    "content_duration_seconds": "8",
    "video_owner_id": "756201191646691328",
    "media_key": "13_958224897255211013",
    "website_display_url": "developer.twitter.com",
    "id": "5a4vf",
    "video_width": "16",
    "website_dest_url": "https://developer.twitter.com",
    "created_at": "2018-01-30T06:30:01Z",
    "card_uri": "card://958225772740714496",
    "title": "Twitter Developers",
    "website_url": "https://developer.twitter.com",
    "updated_at": "2018-01-30T06:30:01Z",
    "poster_media_url": "https://pbs.twimg.com/amplify_video_thumb/958224897255211013/img/EnyDab6vErGm4Avd.jpg",
    "video_poster_width": "16",
    "deleted": false,
    "card_type": "VIDEO_WEBSITE"
  },
  "request": {
    "params": {
      "video_poster_height": "9",
      "name": "video website card",
      "website_shortened_url": "https://t.co/zadeUSVD18",
      "video_height": "9",
      "media_url": "https://video.twimg.com/amplify_video/vmap/958224897255211013.vmap",
      "content_duration_seconds": "8",
      "video_stream_content_type": "video/mp4; codecs="avc1.42E01E, mp4a.40.2"",
      "video_owner_id": "756201191646691328",
      "media_key": "13_958224897255211013",
      "website_display_url": "developer.twitter.com",
      "account_id": "18ce54d4x5t",
      "video_width": "16",
      "website_dest_url": "https://developer.twitter.com",
      "title": "Twitter Developers",
      "website_url": "https://developer.twitter.com",
      "poster_media_url": "https://pbs.twimg.com/amplify_video_thumb/958224897255211013/img/EnyDab6vErGm4Avd.jpg",
      "video_poster_width": "16",
      "card_type": "VIDEO_WEBSITE"
    }
  }
}

PUT accounts/:account_id/cards/video_website/:card_id

更新属于当前账号的指定视频网站卡片。

资源 URL

https://ads-api.twitter.com/10/accounts/:account_id/cards/video_website/:card_id

参数

名称 说明
account_id
必需

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

类型:string

示例:18ce54d4x5t

card_id
必需

请求中对正在操作的视频网站卡片的引用。

类型:string

示例:5a4vf

media_key
可选

在本卡片中使用的视频媒体密钥。

注意:视频必须位于账号的媒体库

注意:宽高比必须为 16:9 或 1:1。

类型:string

示例:13_1168079965037467209

name
可选

卡片名称。最大长度:80 个字符。

类型:string

示例:star card

title
可选

卡片标题。最大长度:70 个字符。

类型:string

示例:The Official Twitter Blog

website_url
可选

重定向用户转到的网站 URL。

类型:string

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

请求示例

PUT https://ads-api.twitter.com/10/accounts/18ce54d4x5t/cards/video_website/5a4vf?name=star card

响应示例

{
  "data": {
    "video_poster_height": "9",
    "name": "stars card",
    "website_shortened_url": "https://t.co/zadeUSVD18",
    "video_height": "9",
    "media_url": "https://video.twimg.com/amplify_video/vmap/958224897255211013.vmap",
    "content_duration_seconds": "8",
    "video_owner_id": "756201191646691328",
    "media_key": "13_958224897255211013",
    "website_display_url": "developer.twitter.com",
    "id": "5a4vf",
    "video_width": "16",
    "website_dest_url": "https://developer.twitter.com",
    "created_at": "2018-01-30T06:30:01Z",
    "card_uri": "card://958225772740714496",
    "title": "Twitter Developers",
    "website_url": "https://developer.twitter.com",
    "updated_at": "2018-01-30T06:47:51Z",
    "poster_media_url": "https://pbs.twimg.com/amplify_video_thumb/958224897255211013/img/EnyDab6vErGm4Avd.jpg",
    "video_poster_width": "16",
    "deleted": false,
    "card_type": "VIDEO_WEBSITE"
  },
  "request": {
    "params": {
      "account_id": "18ce54d4x5t",
      "card_type": "VIDEO_WEBSITE",
      "card_id": "5a4vf",
      "name": "stars card"
    }
  }
}

DELETE accounts/:account_id/cards/video_website/:card_id

永久删除属于当前账号的指定视频网站卡片。

注意:此操作为硬删除。删除后,将无法恢复删除的卡片。

资源 URL

https://ads-api.twitter.com/10/accounts/:account_id/cards/video_website/:card_id

参数

名称 说明
account_id
必需

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

类型:string

示例:18ce54d4x5t

card_id
必需

请求中对正在操作的视频网站卡片的引用。

类型:string

示例:48fj0

请求示例

DELETE https://ads-api.twitter.com/10/accounts/18ce54d4x5t/cards/video_website/4h053

响应示例

{
  "data": {
    "name": "twitter blog card",
    "id": "4h053",
    "created_at": "2017-07-01T00:23:06Z",
    "updated_at": "2017-07-01T00:28:31Z",
    "deleted": true,
    "card_type": "VIDEO_WEBSITE"
  },
  "request": {
    "params": {
      "card_id": "4h053",
      "account_id": "18ce54d4x5t"
    }
  }
}