You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've tried get_objects() which successfully retrieves several objects. But I can't seem to retrieve in one request several object/connection.
For example, if ['1','2'] are album ids, get_objects(['1','2']) successfully gives me those 2 albums. But I can't seem to do something like get_objects(['1/photos','2/photos'])
The text was updated successfully, but these errors were encountered:
The library does not currently have any explicit methods for batch API requests (the get_objects method only returns multiple objects, not "connections" like an album's photos), but it is possible to construct them.
>>> from facebook import GraphAPI
>>> graph = GraphAPI("access-token-goes-here")
>>> batched_requests = '[{"method":"GET","relative_url":"me"},{"method":"GET","relative_url":"me/friends?limit=50"}]'
>>> graph.request("", post_args = {"batch":batched_requests})
[redacted information about Martey and 50 of his friends]
I could see that a method to make this easier, or a way to put GraphAPI objects into "batch mode" (where all calls are stored, and sent as a batch request when needed) would be useful, so I will keep this open.
Is there a way to issue batch requests?
I've tried get_objects() which successfully retrieves several objects. But I can't seem to retrieve in one request several object/connection.
For example, if ['1','2'] are album ids, get_objects(['1','2']) successfully gives me those 2 albums. But I can't seem to do something like get_objects(['1/photos','2/photos'])
The text was updated successfully, but these errors were encountered: