首页 文章

如何检索大量DELETED广告系列,广告,广告?

提问于
浏览
0

任务

我正在尝试从与我们的业务经理相关联的各种帐户中检索所有广告系列,广告和广告 .

问题

我正在访问的具体 endpoints 是:

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始终返回此错误:

{"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 endpoints ,但我还没有完成任务 .

其他细节

当我只在过滤器中包含 ACTIVE 广告系列时,查询会起作用 . 这让我可以推断 DELETED 活动是个问题 . 换句话说,这些帐户有大量的 DELETED 广告系列 .

我正在使用Postman 5.0.0版(5.0.0)发出请求 .

我想如果我能弄清楚如何获得广告系列,广告和广告将是类似的 . 我该如何解决这个问题?

1 回答

  • 2

    原因是API实际上不支持查询某些 endpoints 的已删除对象 . 我尝试获取某个帐户的所有广告系列,这就是回复 .

    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

    在这里,他们说

    如果保留已删除的对象ID,则可以通过单独查询对象ID继续检索统计信息或对象详细信息 . 但是,您无法从未删除的节点/对象中将已删除的对象检索为连接对象 .

相关问题