Why `time_range` doesn't work in request to Facebook API? -


i try data facebook marketing api. result correct have problem data. seems parametr time_range doesn't work.

https://graph.facebook.com/v2.7/act_<my_act>/ads?fields=name,adcreatives{object_story_id},insights{spend,unique_clicks},effective_status&params=time_range={%22since%22:%222016-11-15%22,%22until%22:%222016-11-17%22}&limit=2000&access_token=<my_token> 

result:

{    "data": [       {          "name": "xx",          "adcreatives": {             "data": [                {                   "id": "xx"                }             ]          },          "effective_status": "disapproved",          "id": "xx"       },       {          "name": "xx",          "adcreatives": {             "data": [                {                   "id": "xx"                }             ]          },          "insights": {             "data": [                {                   "spend": xx,                   "unique_clicks": "34",                   "date_start": "2016-10-19",                   "date_stop": "2016-11-17"                }             ],             "paging": {                "cursors": {                   "before": "mazdzd",                   "after": "mazdzd"                }             }          },          "effective_status": "campaign_paused",          "id": "xx"       },...} 

i tried encode it, write in different way, each time results last month, date_start 2016-10-19 , date_stop 2016-10-17, not range put parametr in query. how can fix it?

edit: tried instead of &params=time_range={%22since%22:%222016-11-15%22,%22until%22:%222016-11-17%22} &date_preset=yesterday (yesterday or other correct value listed in documentation) still exact same dates...

you can use following insights within time_range:

/act_<acct_id>/insights?level=ad&time_range={"since":"2016-11-15","until":"2016-11-17"} 

Comments

Popular posts from this blog

account - Script error login visual studio DefaultLogin_PCore.js -

xcode - CocoaPod Storyboard error: -