time range filter on ads endpoint (Facebook API)

ぐ巨炮叔叔 提交于 2019-12-11 04:53:41

问题


We are trying to filter results of ads using date parameters on the /v2.7/{ad-account-id}/ads endpoint

According to the docs, you can use a time_range parameter, but it doesn't seem to be working properly using the PHP SDK or the graph explorer, example:

act_{1234456}/ads?time_range={'since':'2016-08-01','until':'2016-08-12'}

The documentation is pretty unclear on this because there is 2 references to the same ads endpoint but each with different params

https://developers.facebook.com/docs/marketing-api/reference/adgroup

https://developers.facebook.com/docs/marketing-api/reference/ad-account/ads/

Has anyone found a way to successfully filter by date/time range on the ads endpoint?


回答1:


The right way to use the time_range param is as follows:

&time_range[since]=YYYY-MM-DD&time_range[until]=YYYY-MM-DD

make sure that square brackets are not url-encoded.



来源:https://stackoverflow.com/questions/38959704/time-range-filter-on-ads-endpoint-facebook-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!