Facebook provides a nice guide on how to authenticate to the Facebook API via the client-side JavaScript SDK. The following JavaScript code will print out the user’s data.
FB.api('/me', function(response) {
console.log(response);
});
I have an authentication system up and running with the following FB login button
<div class="fb-login-button" data-show-faces="true" data-width="200" data-max-rows="1" scope="user_relationships,friends_relationships,user_photos,friends_photos"></div>
How do I get user_relationships, friend_relationships, user_photos, friends_photos using a similar JavaScript API call? I am not really sure what to replace ‘/me’ with.
Thanks!
You’r application requires permissions to access user_photos, user_relationship_details, friends_relationship_details,friends_photos
(Reference).
Once the user grants them, then you’r app will be able to access them.
For user relationship status
/me?fields=relationship_statusand for friend’s relationship status/<friend-user-id>?fields=relationship_statusFor user albums you can use
/me/albumsand/me/photos/for the photos in which the user was tagged and for friend’s photos and albums the same as above