专辑请求的图形API行为不一致 [英] Inconsistent Graph API Behavior for Album Requests

查看:72
本文介绍了专辑请求的图形API行为不一致的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正尝试使用以下方法获得相册列表:

I am trying to get a listing of photo albums using:

https://graph.facebook.com/USER_ID/albums

对于某些用户来说,它运行良好,而其他用户却什么也没得到:

It is working perfectly for some users, and other users I am getting nothing:

{
   "data": [

   ]
}

我确信在两种情况下,用户ID都是正确且有效的.对于什么也没有返回的用户,以同一用户身份登录时,我可以看到相册,因此我看不到权限可能是个问题.

I am sure in both cases the user ID is correct and valid. For the users that return nothing I can see the albums when logged in as the same user, so I don't see how permissions could be an issue.

任何建议将不胜感激!

推荐答案

通过这样编写,您将获得更好的结果:

You'll get better results by writing it this way:

https://graph.facebook.com/USER_ID?fields=albums.fields(id)

我在玩 Graph API Explorer 时得到了这个结果. 在这里,

I got this result while playing with the Graph API Explorer. Here,

您必须生成一个新令牌,并选择 user_photos friends_photos . 然后,在列表中选择所需的内容:

you've to generate a new token with user_photos and friends_photos selected. Then, select what you need in the list:

它似乎显示了您的需求(至少如果您要查找的ID是您的朋友之一)!

And it seems to display what you need (at least if the ID you are looking for is the one of your friends)!

这篇关于专辑请求的图形API行为不一致的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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