Facebook 营销 API 的多重过滤(日期范围、国家/地区、impression_device 等)

Multiple filtering on Facebook Marketing API (date range, country, impression_device etc.)

我们希望根据多重过滤(日期范围、国家/地区、impression_device 等)从 Facebook 营销 API(见解 API - https://developers.facebook.com/docs/marketing-api/insights)中获取营销成本.).

我一次可以应用 1 个过滤器,例如:

但不能在一个查询中应用这两个,得到下一个响应:

{
"error": {
    "message": "Service temporarily unavailable",
    "type": "OAuthException",
    "is_transient": false,
    "code": 2,
    "error_subcode": 1504018,
    "error_user_title": "Your request timed out",
    "error_user_msg": "Please try a smaller date range, fetch less data, or use async jobs",
    "fbtrace_id": "ADKphoammbM"
  }
}

我还尝试 运行 报告为异步作业(通过按此处所述发出 POST 请求 - https://developers.facebook.com/docs/marketing-api/insights/best-practices/#asynchronous),作业已成功启动:

{
"id": "317371612321115",
"account_id": "<ACCOUNT_ID>",
"time_ref": 1545121794,
"async_status": "Job Started",
"async_percent_completion": 0,
"is_running": true,
"date_start": "2018-12-17",
"date_stop": "2018-12-17"
}

但后来得到 "job failed" 状态:

{
"id": "317371612321115",
"account_id": "<ACCOUNT_ID>",
"time_ref": 1545121794,
"async_status": "Job Failed",
"async_percent_completion": 0,
"date_start": "2018-12-17",
"date_stop": "2018-12-17"
}

是否可以像我下面描述的那样应用多个过滤器?
是否存在一些限制或文档如何应用多个过滤器?
谢谢。

您可以在同一个请求中应用过滤器数组。尝试:

filtering=[{field:"impression_device","operator":"IN","value":["iphone","ipad"]},{"field":"country","operator":"EQUAL","value":"GB"}]

这将 return 印象 iPhone 或 iPad GB 设备。