图批量API [英] Graph Batch API

查看:95
本文介绍了图批量API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我第一次计算器后。

this is my first post at stackoverflow.

我使用Facebook的图形API批次在一次从多个用户请求供稿更新。
但我真的不知道相应的错误处理是如何完成的。下面的例子应该证明我的问题:

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:

批次要求:

user1 - valid access_token
user2 - invalid (password change maybe?)
user3 - valid access_otken

从Facebook答案可能是这样的:

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?

处理OAuth的例外是相当困难,当你没有得到的信息,在该请求该属于例外

Handling the OAuth exception is quite hard when you don't get the information to which request this exception belongs.

有什么想法?

推荐答案

我不熟悉PHP SDK,但在使用Javascript SDK配料实际模拟各种调用自己和返回的响应数组与标题和这样的类似设置。

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.

我假设PHP SDK将使用类似的语义。

I assume that the PHP SDK will use similar semantics.

这篇关于图批量API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆