How to get my own Facebook user timeline using Graph API? - facebook

I would like to get all the posts and updates that are normally displayed in FB official application for MY account (this includes updates from my friends and liked pages).
I wasn't able to find any details how to get that, the only thing I've managed to get is my own posts.
Anyone got any experience with that using current Graph API verion (3.3)?
All the alternate FB clients (ex. Friendly) must be doing this somehow.

There is no way to get ANY data of users who did not authorized your App. Which means, there is no way to get posts of friends. You can only get your own friends, with the user_posts permission and the /me/posts endpoint. If some Apps access friend data without their authorization, they are most likely doing something that is not allowed.

Here is what I found in their API docs:
There are two scopes:
The user feed requires the user's permission
The public feed has fewer capabilities but doesn't require perms

Related

Fetch users who has checked in at particular location or page from Facebook Graph API

I would like to fetch the users list from Facebook Graph API 2.0 who has checked in at particular place or a page. I tried to use this way:
https://developers.facebook.com/docs/graph-api/reference/v2.0/page
But it does not provide that information. Can this be a privacy issue?
Is there a way that if I am a page admin of the place, where people check in, I can fetch the user ids of those users?
Any kind of help or guidance will be very appreciated.
Regards
This is not possible IMHO, because the user's checkins are bound to the OAuth access restrictions, meaning that every user need to give your app the permission to request his data.
As you already refrences, the Page itself has no edge for the checkins: https://developers.facebook.com/docs/graph-api/reference/v2.0/page#edges

How to get news feed exactly how it appears in facebook homepage newsfeed using api

I am using /me/feed and /me/home to get my feed and my homepage feed respectively.
But the /me/home only shows updates from my friends. I am following many people but not friends with them. My facebook homepage shows all the updates including my friends and the people I am following.
How to get the news feed exactly like the one appears in the fb website?
As #Fabio said, the Graph API does not support it as of now (and I don't think it'll do that in the future). You can only obtain yours and your friends' feeds using the Graph API.
In order to obtain the feeds from a specific person who's not in your friend list, you need a valid User Access Token from that user with a read_stream permission.
There is however a way to read the public feeds of user status updates and page status updates as they are posted to Facebook. This can be done by using the Public Feed API. This will include all feeds that have their privacy set to ‘public’ are included in the stream. Also, you cannot apply to use the API at this time as its access is limited. Its page says:
Access to the Public Feed API is restricted to a limited set of media
publishers and usage requires prior approval by Facebook. You cannot
apply to use the API at this time.
But I think it's just a fancy way of saying that this API is not free and you'll be charged few dollars (which you can find out by getting in touch with someone at Facebook) for using this service.

Using single access token to get the 'likes' of other users

Using the normal Facebook website, one can get to a page showing which pages a user has 'liked'.
From the graph API, it is possible to get this for pretty much all pages, using graph.facebook.com/userid/likes?access_token=MYACCESSTOKEN.
However, I need to be able to do the same - i.e. get the list of pages a user has 'liked' for normal Facebook users (and not 'pages' who have 'liked' other pages).
Is this possible with the single access token? Judging by the fact you can get this info from the normal Facebook web page, I would expect it to be possible.
Privacy works slightly differently for applications accessing the API and for users accessing the actual site.
An application doesn't have access (by default) to your friends' likes to prevent data mining. In order to get a users friend's likes, you'll need to request the friends_likes permission.
You can read about this permission and others in the documentation.

Get all posts on a friend's wall

I'm trying to find an API call (or set of calls) that will allow an app to get the posts that one would see if viewing a friend's wall. Either a REST call or a FQL call would do.
I tried /feed and /posts, compare the results with what I see on my friend's wall, and the results I get from it are incomplete.
I know this is possible because apps like Friendly are able to do it.
Any hints?
Well, there's two different API endpoints for querying the posts of a given user; home and feed. Home includes posts from other people and pages (basically what you see when you log in and go to your home page) and feed is the stuff the user is sharing. Assuming your application has authenticated the user and they've allowed the read_stream permission, you can then make queries to the Graph API using their access token:
https://graph.facebook.com/{SOME_USER_NAME}/home?access_token={SOME_ACCESS_TOKEN}
and
https://graph.facebook.com/{SOME_USER_NAME}/feed?access_token={SOME_ACCESS_TOKEN}
The only hint I could give you is that "incomplete" is pretty standard with the Facebook API. You can only do the best you can with what they give you. Counts will be wrong. Data will be wrong. It's a fluctuating, moving target, so code to that fact.
You can interact with posts by retrieving the read_stream and publish_stream for a given User's ID.
Once you have the ID of the User that you are interested in you can use FQL to retrieve posts from streams that you have the permissions for.
This stackoverflow answer goes into more detail and contains further links to the documentation on the Facebook Developers site.
We do it like this:
1) we use Facebook Platform PHP5 client
2) then what you do is:
$this->facebook = new facebook($key, $secret);
$out = $this->facebook->api_client->call_method("facebook.stream.get", array('viewer_id'=>0, 'source_ids'=>$uid, 'limit'=>$limit));
then just operate with out, which contains all posts on asked page.
but, afaik, it will work only with pages, not with normal users. but dig that way to get answer.
You should make a graph call to https://graph.facebook.com/< FBID >/statuses?access_token=xxxxx
Here access_token shall have read_stream permission and offline_access permission ..

Facebook Graph API shows different results in me/home

When I do a GET with my browser (already logged-in at Facebook):
https://graph.facebook.com/me/home?access_token={token}
the results are different than doing the same via a FB app using Facebook C# SDK.
Specifically, what the API is not returning are feeds posted by other applications.
Why can be this happening? Can't an application retrieve updates from other applications even if it has the read_stream permission?
I even requested for additional permissions: read_stream,user_activities,friends_activities,friends_likes,user_likes,read_requests
but nothing has changed.
What I need is to get ALL and the same stories an user would see at his FB news feed.
I use
me/feed
me/posts
me/statuses
me/links
Sample for a page: http://apps.facebook.com/anotherfeed/wallfeed.php uses the /pageid/feed
In filtering for my wall plugin. Even with perms, if a friend has interacted with a post and is not sharing interaction the post will not show in Graph. Technically unless you have perms from all friends, and friends of friends you can not fully emulate the wall feed.
I noticed the results are different according the geo-localisation.
If your server is hosted in another country it might be the reason why