Question

I need to update a large number of facebook adgroups using the Graph API. According to facebook's documentation this can be done with an individual request for each adgroup:

curl  -F "name=newname"
"https://graph.facebook.com/6003493971234?access_token=___"

I am concerned about the time it will take to make hundreds of these individual update requests. I know that you can request information for multiple adgroups (or other graph api objects) with the ids parameter, such as:

"https://graph.facebook.com/?ids=6003493971234,6003493971235&access_token=___"

Is there similar functionality for updating adgroups? What do these requests look like? I'm envisioning something along the lines of sending json-encoded data which specifies the ids to be updated and the new values. I'd do some more trial-and-error testing (this has proved helpful when working with facebook), but I couldn't guess at what parameter name I should use to identify the json. eg:

curl -F "paramname={"id1": {"name":"name1"},"id2": {"name":"name2"}}
"https://graph.facebook.com/?access_token=___"
Was it helpful?

Solution

John, check out this blog post by a Facebook engineer describing the batch functionality in the Graph API.

https://developers.facebook.com/blog/post/480/

You can use this batch functionality to update many adgroups in parallel. It's also perfectly acceptable in your app to open multiple connections to Facebook and manipulate your adgroups in parallel across the connections. There are some rate limits in the Ads API, but they should be high enough for just about anyone.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top