In the past, I was using the legacy REST ads.getAdsGroup call which开发者_如何学Python allowed filtering on an accountId
, campaignIds
, and adGroupIds
all in a single call.
I've been staring at the Graph API documentation for the Ad group object and don't see an equivalent call to achieve all of the filtering in a single call.
Am I missing something obvious or do I need to figure out how to make multiple calls to the Graph API to achieve the same goal?
In short no, but here are the calls you'd use for each type of filtering (not sure if you already have discovered this or not, but here goes anyway.)
You can get multiple adgroups by id using the syntax:
graph.facebook.com?ids=<adgroup_id1, adgroup_id2, ...>
You can get adgroups by campaign by using the syntax:
graph.facebook.com/<campaign_id>/adgroups
You can get adgroups by ad account by using the syntax:
graph.facebook.com/act_<ad_account_id>/adgroups
精彩评论