Facebook图API响应大小限制(错误代码1) [英] Facebook graph API response size limiting (error code 1)

查看:283
本文介绍了Facebook图API响应大小限制(错误代码1)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

只要分享我在测试我的应用程序时遇到的一些信息。



Facebook Graph API按照文档页面。今天我正在尝试从CNN Facebook页面检索该Feed,我收到以下 500 错误:




{error:{code:1,message:请减少您要求的数据量,然后重试您的请求}}
/ p>

这是我试图测试的查询:




https :?//graph.facebook.com/v2.3/5550296508/feed栏= ID,操作,应用,标题,CREATED_TIME,说明,从,图标,is_hidden,链接,留言,message_tags,名称,OBJECT_ID,图片,地点,隐私,性质,来源,status_type,故事,story_tags,到,类型,updated_time,with_tags,股票,likes.limit(50),comments.filter(流).limit(50){附件,CREATED_TIME,从,ID, like_count,message,message_tags,comments {attachment,created_time,from,id,like_count,message,message_tags}}& access_token = xxxxxxx

解决方案

我试图设置不同的限制值来减小大小,最终 有效。通过检查响应大小并播放一下,我发现当响应达到(大致) 200k 阈值时,会发出错误。



我使用Graph API 2.3 - 2.4 - 2.5 - 2.6进行了测试。



我在facebook API文档中没有找到有关此响应大小限制的文档,因此可能将来会更改。



只要您使用自己的API对某些内容进行建模,分享即可。


Just sharing some information I came across while testing my application.

Facebook Graph API implements rate limiting as described on their documentation page. Today I was trying to retrieve the feed from CNN facebook page and I got the following 500 error:

{"error":{"code":1,"message":"Please reduce the amount of data you're asking for, then retry your request"}}

This is the query I was trying to test:

https://graph.facebook.com/v2.3/5550296508/feed?fields=id,actions,application,caption,created_time,description,from,icon,is_hidden,link,message,message_tags,name,object_id,picture,place,privacy,properties,source,status_type,story,story_tags,to,type,updated_time,with_tags,shares,likes.limit(50),comments.filter(stream).limit(50){attachment,created_time,from,id,like_count,message,message_tags,comments{attachment,created_time,from,id,like_count,message,message_tags}}&access_token=xxxxxxx

解决方案

I tried to set different limit values to reduce the size, and eventually it worked. By inspecting the response size and playing around with it a bit, I found that the error is thrown when the response reaches (roughly) the 200k threshold.

I tested with Graph API versions 2.3 - 2.4 - 2.5 - 2.6

I found no documentation about this response size limit on the facebook APIs documentation, so it's possible that it will be changed in the future.

Just thought it might be useful to share if you are modelling something using their API.

这篇关于Facebook图API响应大小限制(错误代码1)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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