Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I retrieve photos from a Facebook group using the graph API?

When I try to retrieve photos from an open group on Facebook, I get an empty list instead.

This URL http://graph.facebook.com/275206825900621/photos gives me an empty list. I was expecting to see a list with the photo that I have uploaded to my test group.

{
   "data": [      
   ]
}

The problem might be security related, but I do not get any access errors. If I remove /photos from the end of the URL, I get access to the basic public info, http://graph.facebook.com/275206825900621.

like image 838
Jan Aagaard Avatar asked Oct 09 '22 04:10

Jan Aagaard


2 Answers

Strange thing is that if you do /group_id/albums it does retrieve all the albums inside the group including album_id, name, url and even the count of images inside that group's album. But if you then use that album_id and call /album_id/photos then it returns the empty data array.

If you can do /group_id/albums, then the group albums are valid albums therefore calling /photos on it should retrieve it's photos just like it happens in normal albums.

Have you figured this out?

I just tried with FQL and I can manage to retrieve a lot of information regarding the group album so it means the group album is just a normal album.

SELECT description, owner, photo_count, type, like_info, cover_pid, comment_info FROM album WHERE object_id = '1382173765340875'

{
  "data": [
    {
      "description": "10 Desafio Outros!!!", 
      "owner": 1455136613, 
      "photo_count": 8, 
      "type": "normal", 
      "like_info": {
        "can_like": true, 
        "like_count": 1, 
        "user_likes": true
      }, 
      "cover_pid": "6249764165120950711", 
      "comment_info": {
        "can_comment": true, 
        "comment_count": 0, 
        "comment_order": "chronological"
      }
    }
  ]
}

Edit 2014 :I submitted a bug report to facebook and 6 months later I got a reply:

They said to check the graph api documentation and I there I could see that there is no connection between the 'groups' object and 'album' or 'photos' object so any extra information that I am currently getting from my query is considering just a bug..

Ah! I think it's just a bug that they did not link groups to albums but whatever...

like image 74
Fred John Avatar answered Oct 16 '22 03:10

Fred John


Per the documentation at (https://developers.facebook.com/docs/reference/api/group/) there is no "photos" connection on a group object. However, there is a picture connection. Maybe someday Facebook will expand their API with a photos connection for a group object.

like image 39
DMCS Avatar answered Oct 16 '22 02:10

DMCS