如何检索大量已删除的营销活动、广告集和广告?
How can I retrieve a large number of DELETED Campaigns, Adsets, Ads?
任务
我正在尝试从与我们的业务管理器关联的各种帐户中检索所有广告活动、广告集和广告。
问题
我正在访问的特定端点是:
https://graph.facebook.com/v2.8/act_xxxxxxxxxxxxx/campaigns
https://graph.facebook.com/v2.8/act_xxxxxxxxxxxxx/adsets
https://graph.facebook.com/v2.8/act_xxxxxxxxxxxxx/ads
当我使用 filter
参数查询所有广告系列的 一些 这些帐户时,
[{'operator': 'IN',
'field': 'ad.effective_status',
'value': [
'ACTIVE',
'PAUSED',
'DELETED',
'PENDING_REVIEW',
'DISAPPROVED',
'PREAPPROVED',
'PENDING_BILLING_INFO',
'CAMPAIGN_PAUSED',
'ARCHIVED',
'ADSET_PAUSED']}]
Facebook API 总是 returns 这个错误:
{"error":{"code":1,"message":"Please reduce the amount of data you're asking for, then retry your request"}}
疑难解答
- 我为
filter
参数使用了各种值,例如 1、25、50、100、500。
- 我试过使用
date_preset
参数限制日期(这似乎无关紧要)。
- 我尝试通过在
filter
参数中包含 {'operator': 'IN','field':'campaign.id','value':['xxxxxxxxxxxxx']}
作为附加过滤器来过滤单个广告系列来限制查询。
- 我已尝试批量请求并查询
/insights
端点,但我还没有完成一项工作。
其他详情
当我在过滤器中只包含 ACTIVE
个活动时,查询有效。这让我推断出 DELETED
活动是问题所在。换句话说,这些帐户有大量 DELETED
个活动。
我正在使用 Postman 版本 5.0.0 (5.0.0) 发出请求。
我想如果我能弄清楚如何获得广告系列,广告集和广告就会相似。我该如何解决这个问题?
原因是API实际上不支持查询某些端点的已删除对象。我试图获取某个帐户的所有活动,这是响应。
Method: GET
Path:
https://graph.facebook.com/v2.10/act_XXXX/campaigns
Params: {'effective_status': '["ACTIVE","PAUSED","DELETED","ARCHIVED"]', 'fields': 'id,name,status', 'summary': 'true'}
Response:
{
"error": {
"code": 100,
"is_transient": false,
"error_subcode": 1815001,
"error_user_msg": "Requesting for deleted objects is not supported in this endpoint.",
"error_user_title": "Cannot Request for Deleted Objects",
"message": "Invalid parameter",
"type": "OAuthException",
"fbtrace_id": "FYDwMABcwxj"
}
}
在查看文档后我发现了这个
https://developers.facebook.com/docs/marketing-api/best-practices/storing_adobjects
他们在这里说
If you keep the deleted object id, you can continue to retrieve the
stats or object details by individually querying the object ID.
However you cannot retrieve the deleted objects as a connection object
from a non deleted node/object.
任务
我正在尝试从与我们的业务管理器关联的各种帐户中检索所有广告活动、广告集和广告。
问题
我正在访问的特定端点是:
https://graph.facebook.com/v2.8/act_xxxxxxxxxxxxx/campaigns
https://graph.facebook.com/v2.8/act_xxxxxxxxxxxxx/adsets
https://graph.facebook.com/v2.8/act_xxxxxxxxxxxxx/ads
当我使用 filter
参数查询所有广告系列的 一些 这些帐户时,
[{'operator': 'IN',
'field': 'ad.effective_status',
'value': [
'ACTIVE',
'PAUSED',
'DELETED',
'PENDING_REVIEW',
'DISAPPROVED',
'PREAPPROVED',
'PENDING_BILLING_INFO',
'CAMPAIGN_PAUSED',
'ARCHIVED',
'ADSET_PAUSED']}]
Facebook API 总是 returns 这个错误:
{"error":{"code":1,"message":"Please reduce the amount of data you're asking for, then retry your request"}}
疑难解答
- 我为
filter
参数使用了各种值,例如 1、25、50、100、500。 - 我试过使用
date_preset
参数限制日期(这似乎无关紧要)。 - 我尝试通过在
filter
参数中包含{'operator': 'IN','field':'campaign.id','value':['xxxxxxxxxxxxx']}
作为附加过滤器来过滤单个广告系列来限制查询。 - 我已尝试批量请求并查询
/insights
端点,但我还没有完成一项工作。
其他详情
当我在过滤器中只包含 ACTIVE
个活动时,查询有效。这让我推断出 DELETED
活动是问题所在。换句话说,这些帐户有大量 DELETED
个活动。
我正在使用 Postman 版本 5.0.0 (5.0.0) 发出请求。
我想如果我能弄清楚如何获得广告系列,广告集和广告就会相似。我该如何解决这个问题?
原因是API实际上不支持查询某些端点的已删除对象。我试图获取某个帐户的所有活动,这是响应。
Method: GET
Path:
https://graph.facebook.com/v2.10/act_XXXX/campaigns
Params: {'effective_status': '["ACTIVE","PAUSED","DELETED","ARCHIVED"]', 'fields': 'id,name,status', 'summary': 'true'}
Response:
{
"error": {
"code": 100,
"is_transient": false,
"error_subcode": 1815001,
"error_user_msg": "Requesting for deleted objects is not supported in this endpoint.",
"error_user_title": "Cannot Request for Deleted Objects",
"message": "Invalid parameter",
"type": "OAuthException",
"fbtrace_id": "FYDwMABcwxj"
}
}
在查看文档后我发现了这个 https://developers.facebook.com/docs/marketing-api/best-practices/storing_adobjects
他们在这里说
If you keep the deleted object id, you can continue to retrieve the stats or object details by individually querying the object ID. However you cannot retrieve the deleted objects as a connection object from a non deleted node/object.