问题标签 [facebook-batch-request]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
0 回答
176 浏览

facebook - 图形 API 批处理请求不适用于 GET

以下批处理请求不起作用:

https://graph.facebook.com/?batch%3d[{%22method%22%3a%22get%22%2c%22relative_url%22%3a%22me%22}%2c%22{%22method%22%3a %22get%22%2c%22relative_url%22%3a%22me%2ffriends%3flimit%3d50%22}]%26access_token%3d

它有一个有效的访问令牌,我已经使用 UTF-8 对其进行了编码,以查看它是否有效,但我得到了

{

}

有人可以告诉我 Graph API 是否只支持批量请求的 GET 吗?提前致谢

0 投票
1 回答
5422 浏览

facebook - Facebook Graph - 从页面向用户发送私人消息的限制是什么?

我正在开发一个聊天机器人,可以处理 facebook 上的私人消息。该人向我拥有的页面发送私人消息,然后我将为每条消息发送答案。

一切正常,但我需要确保 Facebook 不会抱怨我将发送的消息量。此应用程序将同时接收大量交互,但在一些早期测试中,我收到的一条消息是这样的:

http://cl.ly/image/1C1n0Z2L0R05

我现在使用批量请求发送所有消息,间隔为 15 秒。

有人知道同时用多个用户和多条消息测试它的方法吗?垃圾邮件识别过程如何在 Facebook 上运行?我可以在什么时间范围内同时发送多少条消息来防止这种行为?

谢谢。

0 投票
1 回答
235 浏览

facebook - Facebook: field expansion in batch requests?

Is it possible to make a batch request with one (or more) of the batched requests using field expansion?

For instance, say I'd like information about me, my listen data. These are the three batch requests I wrap up:

But when I make the batch request, the first two responses come back with the data I expect and the third response comes back with data in this format (not the data I requested):

I read all about batch requests here:

https://developers.facebook.com/docs/graph-api/making-multiple-requests/

and about field expansions here:

https://developers.facebook.com/docs/graph-api/using-graph-api/

Am I missing something?

0 投票
0 回答
121 浏览

php - PHP:在这种情况下可以使用 FB API Batch Request 吗?

我有多个 Facebook 粉丝页面,我需要查询 FB.API(以获取有关每个页面的信息)。我注意到,当我需要查询 API 的粉丝页面数量变大时,就会出现严重的性能问题。

是否可以Batch Request用于这样的任务?如果是这样,与我目前拥有的代码相比,该代码的外观如何?

0 投票
1 回答
105 浏览

facebook - FQL 和 Graph API 的相关混合批处理请求中未引用帖子 ID

我正在使用批处理请求:

query1:使用 Graph API(以及其他字段和评论)获取页面帖子

query2:使用{result=query1:$.data.*.id}from query1获取所有帖子 ID 并获取 FQLuser_likes字段。

问题是{result=query1:$.data.*.id}未引用的帖子 ID 列表,因此我收到错误:

有没有办法解决这个问题?

0 投票
1 回答
212 浏览

android - Parser error with RequestBatch facebook


I wanna execute multiple requests with RequestBatch class in facebook sdk.
But I'm encountering a weird issues.That's requestBatch always return "error data" for 2nd response. The error response is:

And there is my source. In this code, I executed 2 requests. I sure that 2 requests are right, because if I execute a single request, RequestBatch will return right data. The problem will happen if I do 2 requests, and only 2nd request get the error response.

Behind this code, responses.get(1) will return the error response. Please help me find the fault.
Update I tested 2 behind requests with Graph API Explorer. they are ok but still get error with android. There is "batch" param:

Fixed It's my stupid fault. Change args1 to args2 to fix.

0 投票
1 回答
661 浏览

android - facebook 批处理请求返回空对象

我正在尝试创建一种从页面 id 列表返回页面名称和页面照片的方法,请求似乎返回 null,该问题的解决方案将与对即时消息的更好方法的建议一样受到赞赏试图达到。

脸书的回复如下

为什么它返回null?

0 投票
1 回答
4173 浏览

facebook - Facebook 图形 API 'ids' 变量限制

我正在进行 API 调用以从 Facebook 页面检索简单数据:

我知道我可以通过使用“ids”变量提供多个 id 来获得多个结果:

我的问题是我不知道我可以同时检索多少个 ID。我知道批量请求的限制是 50,但我找不到“ids”变量的文档。


更新:似乎这个限制已在图形 API 的 2.0 版中删除,但我仍在寻找官方答案。

0 投票
0 回答
168 浏览

android - Android Batch Request 有时返回:FacebookException: Unexpected number of results

我们正在使用 FB Android SDK RequestBatch::executeAndWait() 发送批处理请求以检索有关照片的一些信息。这批中的请求数少于 50。但是,有时我们会看到抛出异常:FacebookException: Unexpected number of results

进一步调查表明,抛出的异常在 Request::createResponseFromObject方法中。

此异常并非总是抛出,而是在某些 android 设备上随机抛出,并不总是在相同的查询中抛出。关于为什么会发生这种情况的任何线索都将非常有用。以下是示例批处理请求。

  • 要求:
  • 编号:42
  • 网址:https ://graph.facebook.com
  • 方法:POST
  • 用户代理:FBAndroidSDK.3.6.0
  • 内容类型:multipart/form-data;边界=3i2ndDfv2rTHiSisAbouNdArYfORhtTPEefj3q2f
  • batch_app_id:APP_ID
  • 批处理[{“relative_url”:“SOME_PHOTO_ID1?access_token=ACCESS_TOKEN&fields=images,place.fields(id)&format=json&sdk=android”,“方法”:“GET”},{“relative_url”:“SOME_PHOTO_ID2?access_token=ACCESS_TOKEN&fields= images,place.fields(id)&format=json&sdk=android", "method": "GET" }, { "relative_url": "SOME_PHOTO_ID3?access_token=ACCESS_TOKEN&fields=images,place.fields(id)&format=json&sdk=android" , "method": "GET" }, { "relative_url": "SOME_PHOTO_ID4?access_token=ACCESS_TOKEN&fields=images,place.fields(id)&format=json&sdk=android", "method": "GET" }, ....更多此类请求 < 50 ]

响应是这样的:Sorry, something went wrong. We're working on it and we'll get it fixed as soon as we can.见下面的例子。!http://www.weliveinbritain.co.uk/wp-content/uploads/2012/11/ss-facebook1.png

问题是这个异常是随机抛出的,并不总是在同一个查询中。所以并不是真正可重复的。任何有关可能原因的帮助将不胜感激。

0 投票
1 回答
311 浏览

facebook - Facebook 批量返回:您请求的某些别名不存在

我正在构建这个批次,以获取相册中所有图片的所有共享计数(以及对每张照片的喜欢和评论):

我的批次:

它总是返回Some of the aliases you requested do not existpage_story_id 编号,但是当我查询该故事 id 的图形 api 时,我得到了数据..

任何想法为什么?