Facebook comments collection - facebook

I want to ask I am retrieving Facebook data. I do not have page access tokens . I am using only page ids to extract Facebook comments and post but suddenly my scrapper stopped collecting comments. The API is returning only text and date but not the ID. This happens after 5th Dec 2022. Does any one else face the same issue? Is this some permission issue? My code is working fine I have tested it with other page ids with proper access tokens.Please guide me in this

Related

Facebook Graph API - comments from other users not showing

I'm using the Facebook Graph API and previously, using the /me/posts endpoint and including the comments field, I'd get a list of posts including all comments.
Now I've tried it again, it's not bringing back any comments unless they are my own. This is through the Facebook Graph Explorer and it's behaving the same there though so it's not my application
This is the endpoint I am using
me/posts?fields=from,message,comments
If I put .summary(1) at the end, it shows me there's, for example, 3 comments on a post but the 'data' will just be a blank area.
Has there been a change on Facebook recently in regards to this?
https://developers.facebook.com/docs/graph-api/changelog/version3.0#comments-edge
When read with a User access token, the /comments edge returns empty data for the following nodes...
A lot has changed in the last few weeks, for privacy reasons.
You need to access the comments with a Page Token, not a user or App token.

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

facebook wall feeds output - access_token issue

I've an apparently simple problem that is killing me. I read a lot on this topic but I cannot find any solution.
when I access to my wall with this url:
Profile feed (Wall): https://graph.facebook.com/me/feed?access_token=(ACCESS_TOKEN GENERATED_BY_FACEBOOK),
I get all status feeds I've posted but if I use an access token generated by an app (that I own) I get feeds I've posted and comments I've posted to others posts on the same level.
how can I generate an app access token to obtain the same result as the facebook generated one?

Facebook return ID and me.name

I am really lost with these two problems with Facebook API...
All has been working fine posting to user walls, but I have one client with a page. The page was created from scratch, not via themselves as a user - ie they did not login and create a page they just started from the Facebook welcome screen>create page.
There page works fine, however,
1) Our system is submitting a post via API and receiving an ID in return (eg {"id":"123456_123456"} back from Facebook - this tells me facebook has accepted it and has given me an ID for the post.
However, the post DOES NOT appear on the page it relates to (and I have checked where it is submitting it to and it is the correct User ID). This system has been working fine for all other users.
2) When the login occurs via Javascript for this user, we get an empty value for "me.name" (we get me.email etc, just no name)
Is all this normal, or do pages have a different technique to posting and retrieving data?
Email is a private data of facebook user , It is a permission issue what you are encountering
The only way to get the users e-mail address is to request extended permissions on the email field.
After logging in .
This is how facebook api works , w.r.t revealing private data of its users
Ok I solved this one, I don't doubt the ability of anyone here - perhaps my question is still being misunderstood...
Some Facebook pages (especially business pages) where the page hasn't been created by an existing user are different to Facebook groups and user pages. You cannot just submit using an short ot long term access token.
You have to call facebook as http://graph.facebook.com/ID_OF_PAGE/accounts with your token first.
Facebook returns a list of pages, each with their own unique ID and a token for each.
You then grab the token for the page you want then resubmit with the page ID and that pages OWN token - and voila it posts to it!
Their are still bugs with Facebook as I found. It says on one business page I created for a client "Use Facebook as ." - ie the name is missing before the "." - it should say "Use Facebook as MYNAME."
This introduced another problem with the JS FB.login because the name of the person returns undefined. I had to verify their Email instead - other wise it says "You are logged in as ."
I think its because FB lets you create a page from scratch, as a new user, and without logging in as yourself - then some values are not being set and it messes up.
Perhaps may help someone...

Facebook Graph API post with attachment not showing on News Feed

I tried a number of methods of posting to Facebook using Graph API and I have a problem with creating a post with attachments not showing up in the News Feed.
If I post just a text message, it shows up in the News Feed. Anything that has an attachment goes only to the wall.
Does anyone have an idea on what is the cause of this and how to fix it?
I have no idea what was the cause of the issue, but I resolved it by creating a new Facebook App, with new ID. The same scripts that only posted to the wall started posting to the news feed on the new App ID.
I think it's because you're adding attachement or a link to your feed.
As per http://developers.facebook.com/docs/fbjs/streamPublish/
they say :
Updating a User's Status
You can use this method to simply update a user's status. When you do so, the status message appears at the top of the user's profile and on the Friends > Status Updates page. The message also appears in the stream with your application icon.
To use this method to set a user's status do the following:
* Do not include an attachment or action link. If you do, the story will get published and will appear in the stream and on the user's Wall only. It won't appear at the top of the profile or in the Status Updates page.
* Make sure the message is no longer than 420 characters. Otherwise, an error gets returned.
I know this is an old post but I was having the same issue and I resolved it. Since there wasn't a valid answer to this post and it came up in many of my searches in Google I thought I would add the answer.
The main issue that is happening here is a permissions issue with the App and Access Token created in https://developers.facebook.com.
You can both GET and POST attachements on a wall but you have to give the Users Access Token the permission to access it in the first place. You can do it like this.
1. Go to your application on FB
2. Click on Graph API Explore
3. Click on Get User Access Token
4. Click on user_photos and user_videos
There are many options here but to get the basic attachements which tend to be photos and video you can just select those two, but you can add as many as you want.
After clicking Get Access Token at the bottom to save it you have to login with your password then give your access toke permission for your account. Once you have done that you now how permission to access your feed attachements (photos and videos)
Here is what the Graph API output looks like showing the picture from the feed
Now keep this in mind this is a Short Lived Access Token which lasts about an hour and it will stop working. You have to convert this token to a permanent token and let me save you the time you will bang your head trying to figure that out because I wrote a php function that will generate your permanent token from your short lived token all in one shot for v2.9
Check out my post reply here
facebook: permanent Page Access Token?