Oleksandr Hrin
Oleksandr Hrin

Reputation: 896

Facebook Marketing API returns error on "breakdowns call"

I'm trying to make an API call with the folowing URL

act_XXXXXXXX/insights?fields=ad_id,clicks,unique_clicks,impressions,reach,spend,date_start,date_stop,actions,action_values,unique_actions,account_id&level=ad&breakdowns=platform_position&time_range={"since":"2019-09-07","until":"2019-09-07"}

and the response is :

{
  "error": {
    "message": "(#100) Current combination of data breakdown columns (action_type, platform_position) is invalid ",
    "type": "OAuthException",
    "code": 100,
    "fbtrace_id": "XXXXXXXXXXXXXXXXXXXX"
  }
}

the reason is in "breakdown" value = "platform_position" but the problem is that I need exactly that breakdown :(

when I do an API call and change "breakdown" in URL to something else, for example to "publisher_platform":

act_XXXXXXX/insights?fields=ad_id,clicks,unique_clicks,impressions,reach,spend,date_start,date_stop,actions,action_values,unique_actions,account_id&level=ad&breakdowns=publisher_platform&time_range={"since":"2019-09-07","until":"2019-09-07"}

it is OK and responds with data. I don't know why it happens because I'm not specifying any "action_type" breakdown but it tells that I am :(

What I've tried: I tried to remove all the parameters from that URL one by one but it still returns an error

The main questions are: why the API call for "breakdown" value = "platform_position" fails and how to make it work.

Thanks. PS: you can use FB API testing tool to test requests to FB api. I'm using API version v8.0

Upvotes: 2

Views: 1512

Answers (1)

Kris
Kris

Reputation: 46

You will need both publisher and position:

breakdowns=publisher_platform,platform_position

Upvotes: 3

Related Questions