I've setup the following permissions, both on my side and app's permissions' page:
(notice the "read_stream")
<fb:login-button autologoutlink="true" perms="read_stream, user_about_me, user_likes, user_location, user_birthday, user_education_history, user_work_history, friends_about_me, friends_likes, friends_location, friends_birthday, friends_education_history, friends_work_history"></fb:login-button>
Requesting for the user's profile works great:
FB.api('/me/friends', {
fields: "id,username,name,first_name,last_name,location,link,education,work,statuses.limit(1).fields(message)"
}, function(res){
console.log('FRIENDS', res.data);
});
However, getting the same for the user's friends doesn't work.
It gives a "500 (Internal Server Error)", with facebook object returning "unknown error".
FB.api('/me/friends', {
fields: "id,username,name,first_name,last_name,location,link,education,work,statuses.limit(1).fields(message)"
}, function(res){
console.log('FRIENDS', res.data);
});
I've traced the issue to the field I request. The part statuses.limit(1).fields(message) seems to be the source of the error, when removed the /me/friends returns data.
But I don't understand the reason for the error.
- It works for
/me. - According to FB docs
read_steamshould be for both user's statuses and user's friends' statuses. - With the above fields the API Explorer gets me the friends statuses without any issues.
Am I doing something wrong or is it a FB Graph API bug?
Thank you.