I am working on a Facebook app and I am trying to use this app to fetch comments on posts on Public Pages. When I am using the Graph API Explorer Tool, using the App Token, it returns an OAuthException. It says I need the pages_read_engagement permission or the 'Page Public Content' feature.
My problem is to request those permission, I need my app to be working. How am I suppose to get it working if I don't have those permissions?
Graph API Explorer Tool
Related
I have a Facebook Page where I am admin and I have a Facebook App where I am admin and have manage_pages permission - still, when using the Graph API Explorer with an App Token I get "(#10) This endpoint requires the 'manage_pages' permission or the 'Page Public Content Access' feature...".
It has not been possible to get Page Public Content Access permission even though we have several pages with different admins (and we do not like to many admins on our App) and sometimes need to access posts from collaborators - and the Facebook docs seems very confusing and sometimes even contradictory when searching for a solution.
Any ideas what I am missing here?
I'm facing trouble in getting access_token which I need to use in displaying ANY facebook feed on the website.
I have followed the instructions here in that given link, facebook: permanent Page Access Token?, but sadly not worked for me.
Below are my API details and my requirement is to display ANY facebook page posts via PHP code in my website.
App ID: 1250216098473345
App Secret: c637f7640a185b8137e567295abe568f
All I need is a non-expire access token to put in my code to display feeds.
$userPosts = $fb->get('/ESPN/posts?fields=story,shares,likes.summary(true),comments.summary(true),full_picture,permalink_url,message,updated_time&limit=8', $accessToken);
Tried given tokens to display data of public fb pages, but failed.
https://graph.facebook.com/oauth/access_token?client_id=1250216098473345&client_secret=c637f7640a185b8137e567295abe568f&grant_type=client_credentials
https://graph.facebook.com/oauth/access_token?client_id=1250216098473345&client_secret=c637f7640a185b8137e567295abe568f&grant_type=fb_exchange_token&fb_exchange_token=EAARxEJ5xJYEBAGXFLgn98sPHGqZA74pkipbxLPTCn0jx7vtZBipmoPcG7CYaBXqRol2IUhtAI9wlX4bpFOJ1oGWSEmucCzUYKQnCwH42BnCEZARuIgEPGR3r0ZCjvI343S5yLd1C8mPLQJHNKiAOskwhmP4FU0ZC6eEvVOZB1XnWYleZA639EntpCYedUNp9itjy9c2joZBZBqAZDZD
First of all you shouldn't share you app secret publicly (hence the name).
There is no token that would allow you to display any Facebook page feed. Looking at your example call you most likely refer to pages you or your app users don't have a role in therefore you can apply for Page Public Content Access feature which then would allow you to access public page's data/feeds.
The other option would be requesting manage_pages permission from a page admin for the specific page you want to access.
I can use Facebook login to login as an admin of the Facebook app that represents my website. Then, I can call this endpoint:
"https://graph.facebook.com/comments/?access_token=".$tokens["access_token"]."&ids=".$source
here, $tokens["access_token"] is an access token provided by the Facebook login process and $source is the URL for which I want to get the comments.
Facebook's API response is this:
To use 'Page Public Content Access', your use of this endpoint must be
reviewed and approved by Facebook. To submit this 'Page Public Content
Access' feature for review please read our documentation on reviewable
features: https://developers.facebook.com/docs/apps/review.
Initiating the review process for my app in the Facebook developer dashboard, the requirement for obtaining access for this is:
Please give them detailed step-by-step instructions for how to see
this permission the same way people using your app would.
And:
We need to see your app using Page Public Content Access so we can
see that it doesn't violate our policies. Upload a video screencast walkthrough using any method, (even recording with your
phone).
(In both cases, the emphasis is mine.)
I can not show what I can not show. I have no access to this endpoint, so I can not show, in action, my site using this endpoint.
What's more, I am the admin of the Facebook app representing the website for which I want to get access to the comments, and want to access the comments through that, my, account, only; I don't want any regular user account to access the comments for the pages on my website.
So, how do I get programmatic access to the Facebook comments made on pages on my website?
i am trying to use facebook javascript api to get the details of a public photo uploaded by a user. The photo_id is 645046238933001, and i am using this code:
FB.api('/645046238933001', function(response){...} ). the code is executed in a browser when a user is logged in to my app using facebook.
Using graph api explorer and an app access token i am able to get the photo object but with any other valid user access token (not the user uploaded the photo) facebook returns "unsupported get request..." (using graph api explorer)
what might be the problem?
thank you
That´s intentional. Even if the photo is public, you still need a User Token of the correct user to get access with the API.
The Facebook docs are a bit misleading, the info seems to be outdated because it actually would only be possible for photos on Pages:
Any valid access token for any photo with public privacy settings.
...in the next line there´s the correct info:
For any photos uploaded by someone, and any photos in which they have
been tagged - A user access token for that person with user_photos
permission
Also, even if you would get the photo of another user: It is not possible to like a post/photo on Facebook with the API.
I have a website that query Facebook graphApi and get the available public data of pages.
I have some profiles, where graphApi does not return any data i.e. post/status data marked public on profile.
Even when I try to visit profile manually i.e. by typing url in IE - https://www.facebook.com/ndalloul, it redirects me to Facebook login page.
But when I do it manually i.e. login to my Facebook Account and try to view the profile Ex:https://www.facebook.com/ndalloul shows me the data marked as public.
How to get this data from Facebook using API or Library?
Any help is appreciated.
Thanks.
Apart from the fact that Facebook is switching to the Graph API 2.0, you should not get any kind of redirect to login if you use your app access tokens and talk to the graph via cURL 8ro qeuivalent) .
The endpoint to get public statuses from fan pages, is page_id/feed/ You need an access token from an app with with read_stream permission and only those who grant you that permission will show the latest posts. More info here
You may now have to be approved by facebook to read the stream, by the way.