Reputation: 21
I am trying to get other users feed in PHP using Facebook Graph API PHP sdk, but with no success.
i got my feed properly using
$request = new FacebookRequest(
$session,
'GET',
'/me/feed'
);
$response = $request->execute();
$graphObject = $response->getGraphObject();
But i trying to get other user feed like
$request = new FacebookRequest(
$session,
'GET',
'/534551234549753/feed'
);
$response = $request->execute();
$graphObject = $response->getGraphObject();
is return me this blank response
Facebook\GraphObject Object
(
[backingData:protected] => Array
(
)
)
is there any way to get other user's feed ?
Upvotes: 0
Views: 653
Reputation: 73974
You can only read the feed of a user if he authorized your App. And you can only get his feed with his very own User Access Token.
Since you will not get read_stream
approved at all, i suggest using the new user_posts
permission: https://developers.facebook.com/docs/apps/changelog#v2_3
But again: You can ONLY get the feed of the authorized user, not from anyone else. That would be a major privacy issue.
Upvotes: 2
Reputation: 31479
A look in the Facebook docs might have saved you the time for writing your question:
You can read other user's feeds if you have an app which requests the appropriate permissions during OAuth login:
Permissions
Any valid access token is required to view public links. If the app has been granted the
read_stream
oruser_posts
permission the app can read:
- The user's posts on their own Timeline.
- The posts others have made on the user's Timeline.
- The posts others have tagged the user in.
Upvotes: 0