madphp
madphp

Reputation: 1764

facebook graph api bringing in users public album

Im trying to bring in a user photo album. How do i get the album id? Im using the javascript sdk and graph api.

--Mark

Upvotes: 0

Views: 1480

Answers (2)

grigb
grigb

Reputation: 1171

This will get the album ID for every album for a USER_ID:
SELECT aid FROM album WHERE owner IN (SELECT uid2 FROM friend WHERE uid1 = me() and uid2="USER_ID" )

This will get the src for every image in every album for a USER_ID:
SELECT src FROM photo WHERE aid IN (SELECT aid FROM album WHERE owner IN (SELECT uid2 FROM friend WHERE uid1 = me() and uid2="USER_ID" ) )

Note the use of "uid1 = me()", without this, FB seems to have a permission issue, even if the current user is signed in.

Also, make sure you ask for permissions when you sign in your user.
http://developers.facebook.com/docs/authentication/permissions/

Upvotes: 1

eh1160
eh1160

Reputation: 694

You could loop through all the user's albums with this call:

http://graph.facebook.com/-the-users-id-/albums

Upvotes: 1

Related Questions