Atagus Sood
Atagus Sood

Reputation: 61

Retrieving a photo using facebook graph api

I uploaded a photo to my own facebook profile, and made it public. Then I gave user_photos and friends_photos permission to my own app, and received the access token. I executed this call from my browser:

https://graph.facebook.com/*my_id*/photos?access_token=*access_token*

The response is an empty data set:

{
   "data": [
   ]
}

What am I doing wrong? This seems it should be so simple but not sure what I am screwing up. I would be grateful for any help, thanks.

Upvotes: 1

Views: 1508

Answers (1)

Philip
Philip

Reputation: 5021

You have to get the user albums first to get the album id's,

https://graph.facebook.com/*my_id*/albums?access_token=*access_token*

so with the album id you can call:

https://graph.facebook.com/*album_id*/photos?access_token=*access_token*

this will return all the photos inside the album.

Upvotes: 3

Related Questions