Facebook见解API调用,其中product_id发生故障会引发错误 [英] Facebook insights API call with breakdown on product_id throws error

查看:222
本文介绍了Facebook见解API调用,其中product_id发生故障会引发错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想基于广告系列ID进行见解API调用,并在product_id上进行细分:

i want to make an insights API Call based on a campaign id with a breakdown on product_id:

/{campaign_id}/insights?fields=clicks,ad_id,adset_id,campaign_id,account_id,impressions,cpc,cost_per_inline_link_click,cost_per_inline_post_engagement,cpm,ctr,inline_link_click_ctr&time_range={"since":"2017-07-30","until":"2017-07-30"}&level=ad&breakdowns=product_id&limit=15

如果我添加另一个字段,例如inline_link_clicks或频率,则会出现以下错误

if I add another field like inline_link_clicks or frequency i get the following error

{
"error": {
"code": 1,
"message": "Please reduce the amount of data you're asking for, then retry your request"
}
}

我已经将时间段限制在一天之内,所以我不知道如何进一步减少数据量.

I already limited the the Time period on one day so i don't know how to reduce the amount of data furthermore.

如果我分成不同的调用以减少数据量,我将很快达到API调用限制.

If I split up in different Calls to reduce the amount of Data I will fastly get to the API call limitation.

我也尝试过

/{ad-id}/insights?fields=ad_id&breakdowns=product_id&limit=15&level=ad&date_preset=yesterday

它仍然引发我该错误...

and it still throws me that error...

但是,如果我将"fields"留空,则会得到以下JSON:

BUT if I leave "fields" blank i get this JSON:

{
"data": [
{
"date_start": "2017-08-21",
"date_stop": "2017-08-21",
"impressions": "3",
"spend": "0",
"account_id": "{act-id}",
"campaign_id": "{camp-id}",
"adset_id": "{adset-id}",
"ad_id": "{ad-id}",
"product_id": "1234, ABCD«"
}

P.S.我正在使用带有thttprequest组件的Talend Studio进行API调用.

P.S. I am using Talend Studio with a thttprequest component for making the API call.

我还尝试将/&method=GET与POST请求一起使用,在此我也遇到相同的错误.

I also tried to use a POST request with /&method=GET and I get the same error there, too.

编辑24.08.17:

Edit 24.08.17:

我现在尝试通过使用product_id_limit参数来减少数据量.

I now tried to reduce the amount of data by using the product_id_limit parameter.

act_XXXX/insights?fields=account_name,ad_id&limit=10&date_preset=yesterday&level=ad&breakdowns=product_id&product_id_limit=1

但仍然出现错误以减少数据.以我的理解,将product_id限制为1,我应该只能获得与不使用product_id细分一样多的数据?!

but still I get the error to reduce the data. In my understanding limiting product_id to 1 i should only get as much data as if i was not using the product_id breakdown?!

推荐答案

所以我自己解决了这个问题.

So I resolved this question by myself.

要获取来自Facebook Insights的大量数据,例如与product_id的故障有关,我不得不使用异步请求在Facebook上:

For a huge load of Data from Facebook Insights e.g. with a breakdown on product_id I had to use an Async Request on Facebook:

我对查询发出了POST请求,而不是GET请求.在答案中,我找到了可以提出GET请求的报告ID.然后,Facebook告知报告状态.在完成报告后,我在报告ID中查询了我的第一个POST请求作为GET请求,最后得到了我的结果.

Instead of a GET Request I made a POST request on my query. In the answer I found a Report ID on which I could make a GET request. Facebook then tells the status of the report. After the completion of the report I queried my first POST request as a GET request on the Report ID and finally got my results.

这篇关于Facebook见解API调用,其中product_id发生故障会引发错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆