Edwin Toh
Edwin Toh

Reputation: 163

Graph API - photo id does not return picture

I've an app which has requested for the "user_photos" permission. I've been trying to get the picture data with a photo id. eg. https://graph.facebook.com/123456/picture but I keep getting the error below:

"type": "OAuthException", "message": "A user access token is required to request this resource."

What I'm actually trying to achieve in the end is to retrieve the cover_photo of every album a user has. I'm using the AS3 Facebook API's Facebook.getImageUrl(id) function - which is working well with profile pictures - but not this.

Has anyone got the same problem?

Upvotes: 0

Views: 632

Answers (1)

ifaour
ifaour

Reputation: 38135

The error describes the problem and suggest the solution, you need the access_token of the current (logged-in) user or an indefinite access_token (using offline_access permission) before you are able to get what you want.

Some objects on Facebook don't require access_tokens:

https://graph.facebook.com/cocacola/picture
https://graph.facebook.com/ifaour/picture

But some do:

https://graph.facebook.com/cocacola/feed

Upvotes: 2

Related Questions