Facebook图谱API:获取小组相册中的照片

3

在我提出问题之前,先给出一些我已经能够实现的信息:

  1. I'm able to get the group feed in JSON format

    • I am accessing a group. I have got a long lived access token and i could access the feed.
    • Inputs I have are: group_id, acess_token.
    • URL USED:
      https://graph.facebook.com/v2.1/{group_id}/feed?access_token={access_token}
      • The URL gave JSON formatted output of all the posts etc.
  2. I'm able to achieve the albums of the group

    • URL USED:
      https://graph.facebook.com/v2.1/{group_id}/albums?access_token={access_token}
      • The URL gave JSON formatted output of all the albums (their IDs, name, etc.).
  3. What I'm NOT able to achieve:

    • URL USED:
      https://graph.facebook.com/v2.1/{album_id}/photos?access_token={access_token}
    • URL USED:
      https://graph.facebook.com/v2.1/{album_id}?fields=photos&access_token={access_token}
    • URL USED:
      https://graph.facebook.com/v2.1/{album_id}/photos?fields=picture,source,name&type=uploaded&access_token={access_token}

      {
          "data": [
      
          ]
      }
      
    • I even tried the above in the 'Graph API Explorer', I get the same output.

    • I have tried for various group ids to see if some group ids may be the source of the problem. But I get the same output as shown above.
    • I have gone through all related questions on Stack Overflow. I am using the same URL formats as mentioned in the posts. They say that they can see the photos' data in JSON.
1个回答

3
由于权限限制,除非用户上传了这些相册,否则无法检索所有组相册中的照片。 Graph API reference提到要检索常规相册,需要以下之一:
- 如果相册是公共的,则需要任何有效的访问令牌。 - 用户访问令牌user_photos权限,以检索会话用户上传的任何相册。
奇怪的是,/{group_id}/albums边缘是未记录的。从我的经验中,我学到了如何访问组相册:
- 具有user_photos权限的用户访问令牌将允许访问用户上传的相册信息和照片。 - 任何尝试访问用户没有上传的任何相册(包括公共组中的公共相册)都将返回相册数据,但不是照片信息。
您正在使用正确的查询。为了完整起见,我将在此重述它们。 相册信息

https://graph.facebook.com/v2.1/{group_id}/albums?access_token={access_token}

照片

https://graph.facebook.com/v2.1/{album_id}?fields=photos&access_token={access_token}

您仍然可以从/{group_id}/feed访问照片附件(但不包括相册)。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接