Fenix Lam
Fenix Lam

Reputation: 386

How to get the photo from Facebook?

I have a photo id "2296309061879" and it work perfectly in http://www.facebook.com/photo.php?fbid=2296309061879

I use the Graph API link: https://graph.facebook.com/2296309061879 get false as ALWAYS...... How about it work with my Access Token generated in my application that create by myself immediately?

https://graph.facebook.com/2296309061879?access_token=AAABnQBRA8V0BAF6Idy3ZBXD0As7kEt3ogZCp5yZB435MaZBVZCUV8xZCawgoHewciScXWDdMuiBk5sIWZCI1uJM64H3oWAl6eenZBlSutDwB9D5sT3kahRcK

still get false as ALWAYS......

So, how to get the photo from facebook with the photo id?

Another serious problem is, I use facebook's api to upload a photo to my account, and it return me the photo id. then I goto my facebook to check the photo: it does not exist in any album!!

What's wrong with facebook?

Upvotes: 0

Views: 1446

Answers (1)

Brian Roach
Brian Roach

Reputation: 76918

Because your app doesn't have rights to access it.

This is a public photo from my facebook:

https://www.facebook.com/photo.php?fbid=2651141672758

It also returns false if I try to use https://graph.facebook.com/2651141672758

If I try it in the explorer I also get false:

https://developers.facebook.com/tools/explorer/?method=GET&path=2651141672758

If I click on the "get access token" button, and select the user_photos permission ... it then works.

Edit: Note the first set of bullet points in the Graph API docs for photos: https://developers.facebook.com/docs/reference/api/photo/ - It would appear they're wrong, or there's a bug currently as it states any valid access token should be able to see public images and that's demonstrably not working. In order for the explorer app to list my albums and/or photos I have to explicitly grant it the user_photos permission

Upvotes: 2

Related Questions