Facebook API 2.0 - Is Profile Public for View - facebook

I'm searching and yet cant find a way,
how to check if page is public for view in facebook
example
www.facebook.com/zuck - is public
www.facebook.com/jacek.pietal - is not public
I mean, by public, a page can be observable (for public persons)
I need to check this with PHP API
I know there was SUPPOSED to be a is_published field on /me GET but there isn't
I know accessing /user_id should get this but I can only do this from app-level session and it always can read that because users have accepted my app

Those are not pages, those are user profiles. The is_published field is only available for pages, as you can see in the docs:
https://developers.facebook.com/docs/graph-api/reference/v2.3/user
https://developers.facebook.com/docs/graph-api/reference/v2.3/page

Related

How to access a public Facebook page using Graph API

I have a Facebook page of my own. What I would like is to access the posts in that page as a JSON by sending an API call. I do not need to return the content as a embedded web page like we get in the oEmbed. What is the approach to that?
In the Facebook developer dashboard I have created an application, which means, I have Client Token and App ID incase I need to have access_token to pass.
I know the Page ID of the Facebook page that I need to access
Is that a must Facebook Login integrated to retrieve such public page content?
When I run following command (True values of page_id, app_id & client_access removed here)
curl -i -X GET "https://graph.facebook.com/page_id?access_token=app_id|client_access"
I'm getting following error
{
"error":{
"message":"(#100) Object does not exist, cannot be loaded due to missing permission or reviewable feature, or does not support this operation. This endpoint requires the 'pages_read_engagement' permission or the 'Page Public Content Access' feature or the 'Page Public Metadata Access' feature.. Refer to https:\/\/developers.facebook.com\/docs\/apps\/review\/login-permissions#manage-pages, https:\/\/developers.facebook.com\/docs\/apps\/review\/feature#reference-PAGES_ACCESS and https:\/\/developers.facebook.com\/docs\/apps\/review\/feature#page-public-metadata-accessfor details. ",
"type":"OAuthException",
"code":100,
"fbtrace_id":"Aal5TRTWtw_phIz7-rHzj1L"
}
}
https://developers.facebook.com/docs/graph-api/reference/v9.0/page/feed
This documentation explains how to access the posts.
You will need to navigate to this URL ( https://developers.facebook.com/tools/explorer/
) and add the required permissions for page access. Then choose the Page Token on the right side where it says "User or Page"
You will need page token to access anything page related

Page Public Content Access\', your use of this endpoint must be reviewed and approved by Facebook

This is my code:
var getPageToken = 'https://graph.facebook.com/v3.3/'+pageid+'…;
request(getPageToken, function(errorPageToken, responsePageToken) {
console.log(errorPageToken);
console.log(responsePageToken);
});
For few pages I'm getting the Page Token. Whereas, with few pages I'm getting the below error.
Error:
Page Public Content Access\', your use of this endpoint must be reviewed and approved by Facebook
Few pages have access via Business Manager, few pages have access via personal account. In both cases I'm facing the issue, its very random and I'm unable to identify the cause, any help would be appreciated.
Finally figured out that the problem was with the access_token I was passing to retrieve the pageid.
I had multiple accounts set up to fetch data. While linking the page with access_token I made a mistake.
That was the cause for the error.

Facebook graph API returns false for existing and public event

There is a public Facebook event, for example: http://www.facebook.com/events/197276753679964/
I want to get information about this event using Facebook graph API.
I'm using this query url: http://graph.facebook.com/197276753679964
Facebook returns "false", but event is existing and public, so what's the problem?
There are a few more events with this annoying behaviour, but other ~95% I can read succesfully using FB graph API.
If the event is owned by a group or page which is restricted demographically, you can only access that even with the access token of a user who can see the event / page.
(this appears to be the case with the example in this question)
In general (one current bug excepted), 'false' means a privacy check failed

Access token error when trying to post a Facebook score in a canvas application

I'm trying to integrate the scoring system in my canvas app with Facebook's, implemented using MVC 3 and the 5.2.1.0 Facebook SDK.
A simplified hello-world variant of my game controller looks like:
public class MyController : Controller
{
[CanvasAuthorize("publish_action" /*And some others*/)]
public ActionResult Index()
{
var fb = new FacebookWebClient();
var scores = fb.Get("/me/scores"); // Works (I think)
fb.Post("/me/scores", new { score = 10 }); // Throws an exception
}
}
The call to get scores looks like it's giving me something sensible; the call to write a score value throws "(OAuthException) (#15) This method must be called with an app access_token."
What've I missed? The application id and secret are correctly set in my web.config - for example, I can successfully post an application apprequest in other parts of the actual application not shown in this stripped down test copy. Rummaging around with the debugger shows me that the FacebookWebClient object contains a non-empty access token field, and that that's included in the URI that fb.Post eventually uses.
The Facebook scores page (that Björn links to) mentions only publish_actions but I've tried including other pertinent sounding permissions, such as offline_access and user_games_activity to no effect.
I am assuming that the CanvasAuthorize attribute does the login correctly - it certainly seems to let me send an application apprequest, so it looks as if it's doing the right thing...
Your app needs the permission to write to the users profile. You can use the Graph API to request the required permissions from the user. If granted, Facebook will give you the required access token that you can then use in your request to Facebook. This practice ensures that you only perform actions, the user allowed you to.
Edit_: After looking at the docs: Are you sure you have the required permissions from the user like described here http://developers.facebook.com/docs/score/ ?
Please see this link. You'll need to get an facebook app. Using the apiId and SecretId, you can then post using the information in the link below. The key is adding &scope=manage_pages,offline_access,publish_stream to the url.
like so:
"https://graph.facebook.com/oauth/access_token?client_id={0}&client_secret={1}&grant_type=client_credentials&scope=manage_pages,offline_access,publish_stream";

are there Different permissions with touch.facebook.com and www.facebook.com?

have a facebook page that has public info that can be accessed without logging in.
However, when I access it through touch.facebook.com, it demands a login.
The page is : http://www.facebook.com/soho.sushi.bar
and the touch : http://touch.facebook.com/soho.sushi.bar
Figured it out - touch.facebook.com requires login. m.facebook.com however, leaves public info public.