Facebook Graph Api me/home Seems To Return Same as me/feed - facebook

I know there have already been a lot of questions asked about replicating the users home feed and using me/home, but my question is slightly different.
A few months ago I wrote code to authenticate with Facebook (get user access token) and then retrieve their home feed with me/home. This worked fine at the time as far as I can recall. I've just gone back to the code today, and it doesn't appear to work. The result I get back looks almost the same as me/feed, which is to say it is almost entirely posts from the same account and not posts from 'friends'. Just one post from someone else, a change to their profile pic, shows up but the rest are all 'self posts'.
This only happens with tokens for my own app. If I use graph explorer using the same token, I get the same result. If I use graph explorer with it's own token then it shows me something much more like the actual home feed on the Facebook site. Generating new tokens doesn't help. I have checked the permissions on the tokens used are the same, in fact I even copied the permission list from the generated graph token into my app and re-authenticated, but it didn't help. If my app does the request, then I get almost nothing from other people from me/home. This is the same if I use myuserid/home. Makes no difference.
So my question is, why? Have Facebook changed something and is there a way to change my app so it gets a better version of the home feed?
Secondly, while researching this I've discovered posts saying read_stream won't be granted by Facebook to any app on any platform that has an 'official facebook app'. Does this mean I'm out of luck anyway, even if I get this working for testing purposes using the account that owns the app, I won't actually be able to publish it so others can use it?
Thanks.

Related

Graph API empty events list of page [duplicate]

Using the latest version (2.12) of the Facebook API I'm trying to get (public) events for a page, using the Graph API Explorer.
However, I can't seem to get it working:
When I hover over the greyed out "id" or "name" on the left, it says "Field is empty or disallowed by the access token".
Now the page I'm using as an exmple here is Techcrunch, and they have plenty of events coming up. So "empty" doesn't seem to be the issue.
On the "disallowed" side I've checked the API reference on https://developers.facebook.com/docs/graph-api/reference/page/events/.
However, I can't seem to find any issue here either. It says "Reading Page events requires a valid Page access token or User access token with basic permissions.".
What am I missing here? Any hints are greatly appreciated!
Visit https://developers.facebook.com/docs/graph-api/changelog/breaking-changes#pages-4-4
Currently Facebook is not returning events for pages using Pages API unless you use an user accesss token and that user has been invited to any of the events of the page or is attending/interested in any of the events of the page.
As unknow_b said :
currently to access events you can also use a user endpoint such as ‘/me/events’ or ‘/me/events/not-replied’ using an access token valid for that user. you can get the events that the user was invited to or is going/interested
But the access token user, is only working for 1 hour !
Does someone have another better idea?
I'm trying to do the same thing: getting public events from a page. Related to the above suggestions:
I tried the short-lived user access token two weeks ago, which worked for a short time. Now it does not anymore. Does it for any of you?
Both the long-lived user token, a page token generated with either a short- or long-lived user token do also not return any events.
At https://developers.facebook.com/docs/apps/review/#platforms, Facebook states:
Beginning April 4, 2018, all apps, including those formerly approved, must undergo App Review in order to gain access to the Events API, Groups API, and Pages API. Apps accessing the Events API and Groups API will lose access and require review once App Review resumes.
So being reviewed might help. I will report further.
Update 1: an answer on this related bug reports states it more clearly:
App review required to use the following edges: GET /page/events and GET /me/events
Meanwhile they cancelled all pending review requests for the Graph API 3.0 changes, so I have to resubmit.
Update 2: My project got rejected & I'm not bothering to continue it now.
Yep. Facebook has taken down the Graph API for page access tokens. I had this code in production for 2 years and it worked great. The only way to retrieve data (or was a week or so ago), was a temporary user token that lasts about 2 hours. It's totally broken my band's schedule page. I've been through every avenue and even spoke with a facebook ad team employee on the phone that was aware of it. She seemed to empathize but had no solution for me. I would count on it being down for a while.
I just created a python script, you can see here. It queries the given facebook page and it's events, and puts the data into a mysql table.
It looks like it won't be working anymore due to the scandal with Facebook Analytics (see Why does Facebook Graph API say my account is non-active?).
In the popular plugin facebook-events-by-location-core, you can take a look into the issue#29 discussion. It's well explained there, and I don't think so there's a way we'll get the data in a public API available anymore.
There were also some rumours it was a competition for their (dead?) Facebook Local app, but not sure about this.
I have finally figured out a work around for this. On your fb application, you have to disable the secret key requirement. This can be found under the advance settings of your fb application console. It's called " Require App Secret".
Once you generate a fb PAGE access token, you get a fb page token, and then extend it. here is the token debugger: https://developers.facebook.com/tools/explorer/
You can extend the access token programmatically as explained here: https://developers.facebook.com/docs/facebook-login/access-tokens/expiration-and-extension
AND
https://developers.facebook.com/docs/facebook-login/access-tokens/#pagetokens
OR
There is also an extend tool in the access token debugger (just click on the debug and the extend button is bottom left): https://developers.facebook.com/tools/accesstoken/
Yes , we had a working product back in 2016 ( almost like it's successor Fb Local ) . We were monetised and ready and selling events tickets on the messenger chatbot.
Idea was to solve discovery + booking for hyperlocal events. We went out of business and now its a heart ache to see Fb local.
enter image description here

How to get all the pictures my facebook page is tagged in?

I have a page and I want to run a contest for that page I am the admin of that page. I want people to post pictures on their wall and tag my page in their picture. at the end i want to get all the pictures my page is tagged in using graph api. Is there a way to do this ?. I have tried all the things. I created a app the i got the access token with all the permissions including manage_pages. then i got the page access toke using me/accounts endpoint. then using that access token me/photos/tagged. no luck so far. I am not getting all the pictures.
A little help would be appreciated Thanks.
Your question (and additional info in the comments) suggests that this stems from how Facebook deals with privacy. There are many scenarios in which using a page access token people cannot access content that is owned by a personal profile, even if the admin (personal profile) of the page owns that content.
If you have reason to believe that the API is not returning all the information that it should, you can file a bug with Facebook. If you do, please be sure to include all the necessary steps for them to reproduce the issue or they won't be able to fix it.

Deprecated offline access in Facebook

I just created last week an App and I've read that offline access doesn't work with newly created apps.(I haven't found any tutorial on the web. I am really new to facebook apps)
with this new change in facebook, I don't know how to use the current thing.
I badly need this feature because I don't want the user keeps logging-in in facebook everytime he visits and posts a status in my site as well in his facebook wall. I just want the user to be stayed connected and be able to post on his wall automatically thru my site once he authorized my app.
Thank you.
There are very clear and simple instructions on the following documentation to explain what you need to do to switch to long-life access tokens:
https://developers.facebook.com/roadmap/offline-access-removal/
Also, from your description, it sounds like you are spamming and breaking Facebook Platform Policies. Users will hate any app that automatically posts on their behalf, so I recommend you do not do that, as either people will stop using your app or they'll report it and it'll get banned.

How to show your own facebook data on a website

I got "The question you're asking appears subjective and is likely to be closed." when I started to write my this and a lot of similar titles popped up.
So I've browsed them all and only two might actually help me solve the problem, but they weren't answered.
So... I will continue to ask my question and hope that it wont be closed.
Here it goes:
All I want is to show the feed of a facebook page on a separate website. I.e. status updates, photos, videos, events, comments and likes, all public.
I've googled and also looked at some docs on the facebook developer pages, but all I found was about how to make the visitor grant my fb-app rights to do stuff. Then I would get an access_token which I could use, BUT this token expires.
Never mind... I DONT want to make the visitor grant stuff, I only want to show MY stuff, which is already public.
Preferably I would like to do it with javascript and ajax. PHP might not be supported where I have my site. So if you have an answer for me please say it in javascript first :)
Although ALL answers are more than welcome.
Please, pretty please, with sugar on top, help me with this one.
Getting public data of a facebook page is easy, you don't even have to own the page for that.
You will need a facebook application for that, once you have that you can then authenticate against facebook as the application (from your servers) as explained in the Authenticating as an App guide. You can try it with a simple curl request to:
https://graph.facebook.com/oauth/access_token?
client_id=YOUR_APP_ID
&client_secret=YOUR_APP_SECRET
&grant_type=client_credentials
After you authenticate you receive an app access token and you can use it to make api requests for public data.
For example, try the South Park page object, feed connection, photos connection and events connection.
The token used in the graph explorer is a user token, but you can paste there the access token you got from the curl request for example and it will work.

How can i show the wall (feed) of my page to app on facebook?

How can i show the wall (feed) of my page to app on facebook? As i see in the page
www.facebook.com/kesha?sk=app_178091127385 and
www.facebook.com/pages/Khanduna-Yengu-Nangsu-Amuktang/187317137978077
I want show the wall(feed) of my page to my app of facebook. Please Help me.
I also try and see graph api as below
graph.facebook.com//feed
But Fail,
Please Help any one.
As I understand your question, you want to take the wall of your page and show the content of that on another page controlled by an app you have made, so that is the question I will answer.
There are a couple of things you need to do.
Facebook now requires you to have an access_token to get that information. You can get this in two different ways. Either you get your users permission to grab an access_token for them, or you create an access_token for one of the admin users with offline_access and manage_pages permissions.
There are problems with both cases:
1: Getting an access_token per user requires people to give permissions to your app which is quite annoying if they just gain access to the contents of the feed.
2: Having one access_token is also a problem seeing as Facebook puts a limit on how many requests you can make per access_token in a given time.
You need to balance these things out if you want the feed to be shown. Which case would you most likely use? If you don't have many users the second case might be the best, but if you go over the request limit no content will be shown and that could confuse your users.
Anyways.. Once you are past the access_token problem, you can access the information by getting the content from the page:
https://graph.facebook.com/YOUR_PAGE_ID/feed?access_token=YOUR_ACCESS_TOKEN.
You then get a nice json output you can use. If you are using the Javascript API you can simply use the information here:
http://developers.facebook.com/docs/reference/javascript/FB.api/
If you are ever unsure how to get the information you need there is a nice tool for that developed by Facebook called Graph API Explorer which you can find here:
http://developers.facebook.com/tools/explorer/