Graph API Facebook for private profile, no likes, no reactions and no comments - facebook

In the Graph API Facebook, for private profile, no more likes, reactions and comments appear. Is there a way to request them again?
For the pages must be administrators, but for private profiles?

Is there a way to request them again?
No, there isn’t. You can only get those made by the current user who’s access token you are using, everything else will be hidden from your app.
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: Album, Photo, Post, Video
https://developers.facebook.com/docs/graph-api/changelog/version3.0#reading:
The following edges and fields, when read with a User access token, return only the current user and only if applicable. […]
Regarding the comments, what is says does not seem to be strictly true - I can still see comments made by myself when requesting /me/feed?fields=comments; but everybody else’s don’t show up.

Related

Graph API sharedposts edge empty data issue

I'm facing a problem with /sharedposts edge it keeps returning empty array
{"data": []}
I'd like to share my case exactly with you, may be I'm doing something wrong.
I'm using Graph API Explorer / API ver 2.3
I'm trying to track a fan page post, and get the users' ids who shared this post
The page post is public
All the sharing is public too
My application has read_stream permission granted (at least on the testing users)
I even tried that when I'm the page Admin, App Admin, and I did the sharing myself to my timeline, all permissions are granted and I added manage_pages permission.
I tried using the {post_id}/sharedposts
I tried using the {page_id}_{post_id}/sharedposts
Based on other posts in this regard on StackOverflow, I added limit.
All the above trials, keep giving me the same results
{"data": []}
Please advise me what's wrong with my App, please if anybody has a successful experience with this issue please share, or advise me where could I find the problem?!!!
There seems to be a known bug with this API endpoint. The behaviour you're describing is the same as in this bug report: https://developers.facebook.com/bugs/1404733043148335/
The /sharedposts endpoint will -only- retrieve posts from users who have -also- granted your app. This means that even though a post might be public on a users' timeline, unless they have also granted your app permissions, you will not be able to retrieve that post.
For example: a user posted to a page and the post is public. This post can be retrieved with an access token. Let's assume that the user also shared this post to their own timeline. But, since the user has not granted permissions to your app, you will not be able to see this post using the /sharedposts edge on the original post (on the page). This also holds if the user shared their post publicly to his timeline.
This behaviour is by design; the API is more restrictive in returning user data than the website is. This holds for multiple endpoint and this is one of the examples where it is the case.

Facebook API for Share returning empty results set

I am new to Facebook API. I am building a Facebook app to fetch all the name of people who shared, commented and liked a post in a tabular format. I am able to get the like and comment details through Facebook API but can not find and proper API to get the share details.
I am using
https://graph.facebook.com/post_id?fields=sharedposts&access_token=my_access_token.
This API is returning an empty result set. And I have granted all the available permission to the access_tokn. Can anyone tell me ,Is there any other API that I can use. I saw a option of scraping the Facebook page for share,but I don't want to go that way because Facebook keeps on updating every thing.
I'm having the same problem as you, but I think I'm going a little step forward.
Try adding a limit to your sharedposts and maybe it will return some data:
Try this way:
https://graph.facebook.com/post_id/sharedposts?access_token=my_access_token&limit=1000
That should work for a regular post.
EDIT: Maybe the problem could be that althought you have granted all the perms to the token, the people who share that posts have to accept that permission too.
Otherway your JSON won't return any data.
The /sharedposts endpoint will -only- retrieve posts from users who have -also- granted your app. This means that even though a post might be public on a users' timeline, unless they have also granted your app permissions, you will not be able to retrieve that post.
For example: a user posted to a page and the post is public. This post can be retrieved with an access token. Let's assume that the user also shared this post to their own timeline. But, since the user has not granted permissions to your app, you will not be able to see this post using the /sharedposts edge on the original post (on the page). This also holds if the user shared their post publicly to his timeline.
This behaviour is by design; the API is more restrictive in returning user data than the website is. This holds for multiple endpoint and this is one of the examples where it is the case.
Source: https://developers.facebook.com/bugs/1404733043148335

Get likes of public photo on facebook

I'm trying to get photo data (like likes) using the graph api, but it appears that some photos give me the data, but others return "Unsupported get request".
I'm only testing public pictures, using GET /photo-id.
This photo, for example, returns "Unsupported get request", as you can see here.
Other photos do work, this one, for example.
Any ideas? Thanks a lot!
The difference is that one photo is created by a Page and the other one is created by a User. You can only get the User photos with a User Access Token, even if it´s a public one. For Page photos, you can use an App Access Token or a Page Access Token.
See those links for more information about Tokens:
https://developers.facebook.com/docs/facebook-login/access-tokens
http://www.devils-heaven.com/facebook-access-tokens/
Of course you also need to request the user_photos permission in the login process to get access to the User photos.
Btw, the user_photos permissions needs to get approved if you want to make it work for all Users. Without approval, it will only work for App Admins. See changelog and review guidelines:
https://developers.facebook.com/docs/apps/changelog
https://developers.facebook.com/docs/apps/review
Error 100 indicates a syntax error in the URL you are posting to. Are you using a custom graph URL set? If so, double check it.

How can I detect if a certain post on a Facebook page has been deleted?

I am planning to build a small side project that stores posts from particular public pages. And detect if they delete the post later. Something similar has been done for Twitter. But I couldn't find similar projects for Facebook.
Like this: http://politwoops.sunlightfoundation.com/
But for Twitter. I will do it in Python or C#
How can I go about it?
Any particular code or projects I can learn from?
The only way to check if a post is not there anymore on Facebook is to search for it with a User Access Token of the User who posted it. Every Object on Facebook gets a specific ID, you only have to check if that ID still exists. If not, you get an Error from the API.
For example: https://developers.facebook.com/tools/explorer/?method=GET&path=10203433018378479&version=v2.0
The path parameter is the ID of the Post.
Keep in mind that you need the read_stream permission for that, and you need to let Facebook approve it for other users or it will only work for Admins/Devs of your App. It is not very likely that you will get the permission approved for this though. It usually only gets approved for Apps on "Platforms without a native Facebook experience".
Edit: My bad, i was thinking about User posts, but your question was about Pages. In that case, all you need is an App Access Token (App-ID|App-Secret). The API Call would be the same, you just need to know the Post ID.
About Access Tokens:
https://developers.facebook.com/docs/facebook-login/access-tokens/
http://www.devils-heaven.com/facebook-access-tokens/
For getting the feed of a Facebook Page, see the Facebook docs (including code samples): https://developers.facebook.com/docs/graph-api/reference/v2.0/page/feed/
You can use graph api for this. If it's a public page, you can follow these steps:
Create your application in Facebook developers site
Setup the basic graph auth mechanism with your favorite language and get unexpired token.
Use your unexpired access token to do these tasks:
Enter the id of the pages you want to crawl http://graph.facebook.com/[insert page id or url here]/feed
Add post title, postID to your database.
Create a scheduled task on your server to do these tasks:
Select all / page based etc posts on your database and send a request to: http://graph.facebook.com/[insert post ID here]
if it returns it means it's still there. otherwise it will return an error.

List Facebook Page events on website for a Venue using FQL or Graph API

I am helping out a friend with a site for a venue that lists all events on FB with a location, ticket URI, time, etc.
I have found lots of info on how to get the data, but what I am unclear on is how to get public events without being logged in to FB.
What type of tokens do I need to have a website simply pull events data and display it to visitors?
Basically, what I am attempting to do is show a set number of upcoming events and assume that the visitors to the site are not logged in to FB.
On this page, https://developers.facebook.com/docs/reference/fql/event, it says this:
Permissions
To read the event table you need:
a generic access_token for public events (those whose privacy is set to OPEN)
a user access_token with user_events permission for a user who can see the event for non-public events
an app access_token with user_events permission (for non-public events, must be the app that created the event)
a page access_token with user_events permission (for non-public events, must be the page that created the event)
I am not looking to get help with the code really, I am just having trouble figuring out how the access/auth process works.
It appears FQL may be the best option so I can do queries based on date ranges, but alas, I am stuck on the access/auth/token part.
What do I need to have in place to be able to list a Page's events on a 3rd party site?
If anyone has any advice there, I would appreciate it. Thanks.
Just to explain to others, you cannot get ALL the events in the city by graph search. You need to refine it either by user details or some other metric.
I figured it out.
This question helped, but was not correct and there is a syntax error in an answer:
Get Facebook events from public fan page
From what I found, you need to become an FB developer, create an app, get an ID and secret.
Use the SDK (PHP in my case), and this question had a good example of returning the list I want:
Link from ticket_uri is opening a blank page
I am having the same issue though of getting blank pages on the ticket link if the user is not logged into FB.
But my original issue is solved.