Graph Batch API
this is my first post at stackoverflow.
I am using the Facebook Graph Batch API to request the Feed-Updates from several users at once. But I really don't know how the appropriate error handling is done. Following example should demonstrate my problem:
Batch request:
user1 - valid access_token
user2 - invalid (password change maybe?)
user3 - valid access_otken
The answer from Facebook could look like this:
successful answer
unsuccessful answer (OAuth Exception)
successful answer
But reading the docs, it seems like that the ordering of the answer is not guaranteed. So my question is, how do I connect the answers with their specific partial requests from the batch request?
Handling the OAuth exception is quite hard when you don't get the infor开发者_开发技巧mation to which request this exception belongs.
Any thoughts?
I'm not familiar with the PHP SDK, but on the Javascript SDK batching actually simulates the various calls themselves and returns an array of responses with header
and body
and such-like set.
You can then iterate through that looking for errors and responses.
I assume that the PHP SDK will use similar semantics.
精彩评论