推广账号
GET accounts/:account_id/promoted_accounts¶
检索与当前账号的一个或多个行项目关联的部分或所有推广账号的详细信息。
使用 GET users/lookup 获取响应中由 user_id
标识的用户账号的用户数据。
如果指定的行项目均未配置为包含推广账号,则会返回 HTTP 400。
资源 URL¶
https://ads-api.twitter.com/10/accounts/:account_id/promoted_accounts
参数¶
名称 | 说明 |
---|---|
account_id 必需 |
所使用账号的标识符。出现在资源路径中,通常是所有广告商 API 请求的必要参数,不包含 GET accounts。指定账号必须与已验证的用户关联。 类型:string 示例: |
count 可选 |
指定每个不同请求尝试检索的记录数量。 类型:int 默认值: 200 最小值、最大值: 1 、1000 |
cursor 可选 |
指定光标以获取下一页结果。参阅分页了解更多信息。 类型:string 示例: |
line_item_ids 可选 |
通过指定以逗号分隔的标识符列表,将响应范围限定为与指定行项目关联的推广账号。最多可提供 200 个 ID。 类型:string 示例: |
promoted_account_ids 可选 |
通过指定以逗号分隔的标识符列表,将响应范围限定为所需的推广账号。最多可提供 200 个 ID。 类型:string 示例: |
sort_by 可选 |
根据支持的属性,按升序或降序排序。参阅排序了解更多信息。 类型:string 示例: |
with_deleted 可选 |
在请求中包含已删除的结果。 类型:boolean 默认值: false 可能值: true 、false |
with_total_count 可选 |
包含 注意:不包含此参数和 注意:包含 类型:boolean 默认值: false 可能值: true 、false |
请求示例¶
GET https://ads-api.twitter.com/10/accounts/18ce54d4x5t/promoted_accounts?promoted_account_ids=19pl2
响应示例¶
{
"request": {
"params": {
"promoted_account_ids": [
"19pl2"
],
"account_id": "18ce54d4x5t"
}
},
"next_cursor": null,
"data": [
{
"line_item_id": "9bpb2",
"user_id": "756201191646691328",
"id": "19pl2",
"entity_status": "ACTIVE",
"created_at": "2017-07-05T05:54:13Z",
"updated_at": "2017-07-05T05:54:13Z",
"approval_status": "ACCEPTED",
"deleted": false
}
]
}
GET accounts/:account_id/promoted_accounts/:promoted_account_id¶
检索对与当前账号下行项目关联的账号的特定引用。
资源 URL¶
https://ads-api.twitter.com/10/accounts/:account_id/promoted_accounts/:promoted_account_id
参数¶
名称 | 说明 |
---|---|
account_id 必需 |
所使用账号的标识符。出现在资源路径中,通常是所有广告商 API 请求的必要参数,不包含 GET accounts。指定账号必须与已验证的用户关联。 类型:string 示例: |
promoted_account_id 必需 |
请求中对正在操作的推广账号的引用。 类型:string 示例: |
with_deleted 可选 |
在请求中包含已删除的结果。 类型:boolean 默认值: false 可能值: true 、false |
请求示例¶
GET https://ads-api.twitter.com/10/accounts/18ce54d4x5t/promoted_accounts/19pl2
响应示例¶
{
"request": {
"params": {
"promoted_account_id": "19pl2",
"account_id": "18ce54d4x5t"
}
},
"data": {
"line_item_id": "9bpb2",
"user_id": "756201191646691328",
"id": "19pl2",
"entity_status": "ACTIVE",
"created_at": "2017-07-05T05:54:13Z",
"updated_at": "2017-07-05T05:54:13Z",
"approval_status": "ACCEPTED",
"deleted": false
}
}
POST accounts/:account_id/promoted_accounts¶
将账号 (user_id
) 与指定行项目相关联。
如果指定的行项目未配置为与推广账号相关联,则会返回 HTTP 400 INCOMPATIBLE_LINE_ITEM
错误。如果指定用户不符合推广条件,则会返回 HTTP 400,并且不会推广任何用户。如果提供的用户已被推广,则会忽略该请求。
有关推广账号的更多信息,请参阅广告活动管理页面。
注意:无法更新 (PUT) 推广的账号实体。
资源 URL¶
https://ads-api.twitter.com/10/accounts/:account_id/promoted_accounts
参数¶
名称 | 说明 |
---|---|
account_id 必需 |
所使用账号的标识符。出现在资源路径中,通常是所有广告商 API 请求的必要参数,不包含 GET accounts。指定账号必须与已验证的用户关联。 类型:string 示例: |
line_item_id 必需 |
请求中对正在操作的行项目的引用。 类型:string 示例: |
user_id 必需 |
请求中对正在操作的用户的引用。使用 GET users/lookup 检索某个显示名称的用户 ID。 类型:long 示例: |
请求示例¶
POST https://ads-api.twitter.com/10/accounts/18ce54d4x5t/promoted_accounts?line_item_id=9bpb2&user_id=756201191646691328
响应示例¶
{
"data": {
"line_item_id": "9bpb2",
"user_id": "756201191646691328",
"id": "19pl2",
"entity_status": "ACTIVE",
"created_at": "2017-07-05T05:54:13Z",
"updated_at": "2017-07-05T05:54:13Z",
"approval_status": "ACCEPTED",
"deleted": false
},
"request": {
"params": {
"user_id": "756201191646691328",
"line_item_id": "9bpb2",
"account_id": "18ce54d4x5t"
}
}
}
DELETE accounts/:account_id/promoted_accounts/:promoted_account_id¶
取消账号与指定行项目的关联。
资源 URL¶
https://ads-api.twitter.com/10/accounts/:account_id/promoted_accounts/:promoted_account_id
参数¶
名称 | 说明 |
---|---|
account_id 必需 |
所使用账号的标识符。出现在资源路径中,通常是所有广告商 API 请求的必要参数,不包含 GET accounts。指定账号必须与已验证的用户关联。 类型:string 示例: |
promoted_account_id 必需 |
此标识符代表与行项目关联的推广账号的实例。 类型:string 示例: |
请求示例¶
DELETE https://ads-api.twitter.com/10/accounts/18ce54d4x5t/promoted_accounts/19pl2
响应示例¶
{
"data": {
"line_item_id": "9bpb2",
"user_id": "756201191646691328",
"id": "19pl2",
"entity_status": "ACTIVE",
"created_at": "2017-07-05T05:54:13Z",
"updated_at": "2017-08-23T18:53:15Z",
"approval_status": "ACCEPTED",
"deleted": true
},
"request": {
"params": {
"promoted_account_id": "19pl2",
"account_id": "18ce54d4x5t"
}
}
}