Retrive location specific posts via application access token - facebook-graph-api

I have a webpage that retrieves facebook posts of a fan page.
The web-page does not require visitors to log in via FBConnect. Instead a Facebook application was created and an application secret was obtained via the following link :
graph.facebook.com/oauth/access_token?client_id=[APP_ID]&client_secret=[CLIENT_SECRET]&grant_type=client_credentials
I am thus able to retrieve posts from the fan page via code-behind(php/.net) with the above application's access_token using the following url :
graph.facebook.com/cocacola/posts?access_token=[APPLICATION_ACCESS_TOKEN]
Problem : I cannot find any location specific posts. By location specific posts, I mean posts that are visible only to people from specific countries.
Has anybody been able to achieve this?
Thanks

Related

Facebook Graph API - Can't access some Pages

I am using an external server to retrieve events from multiple Facebook Pages. In about 1% of all cases, I get an error of the following type:
Unsupported get request. Object with ID '...' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api
The common link I've found between the Pages that aren't working is that they are kind of private: if you log out of Facebook, you can't access their page, even though you can access other pages.
I am using an App Access Token to do this. Is there a way to access these Pages' events anyway?
UPDATE
I've found some explanation in the Facebook Docs.
Permissions
For pages that are published, you need:
An app or user access token to view fields from fully public pages.
A user access token to view fields from restricted pages that this person is able to view (such as those restrict to certain demographics like location or age, or those only viewable by Page admins).
A page access token can also be used to view those restricted fields.
This probably means that these particular pages aren't "fully public pages". Is there still some work around?

Facebook Page Likes over time

I'm not the owner of a facebook page (eg. TESLA) but I'm trying to use graph api to get the number of user that liked the pages over time. Based on graphi api documentation (insight/page_fans), I'm just getting empty json documents. Any ideas how I can get this data?
Only two page-related metrics are available publicly, page_fans_country and page_storytellers_by_country.
Everything else is only accessible to an admin user of the page, resp. using a page access token.
You can not get the data you want for pages you do not have admin access to.

Is possible to use Facebook's (Page) Graph API without having an role in that page?

For example, let's say I need to "crawl" (not manually since it looks against Facebook's policies but via graph API) some information from a Facebook's brand page (e.g. https://www.facebook.com/nike/ ).
For example I may need to collect the following fields from a set of brand pages (not just one, such as the one mentioned above, for which I could definitely do it manually), when they are publicly available:
("About tab")
- description
- address
- website
- ...
I was reading Facebook's graph API docs and permissions.
However these permissions are related to users and I already worked with that. What I learned it that it works by
Facebook login --> auth the app to use my data --> the app has access to my data as a Facebook user.
However I'm now interested in brand pages for which I found this docs and this (access token). However it seems that to be able to use this access token I need to be a user with some role in the page (e.g. admin) and not any user who just liked that page.
So, is it possible to access brand pages' data (read-only, i.e. GET) via graph API without actually owning/admin/publishing on that page?
Apparently no "special" access token is required to access pages' public info.
For example I can create any page (not app) in my Facebook account and then use
GET https://graph.facebook.com/(*1)/feed?access_token=(*2)
(*1) the page's name (nike) or ID
(*2)my "bridge" page (i.e. empty page, only used to have an access token. not the page I'm using the graph api on)'s access token
Similarly for /posts/ etc.

Facebook different users posting to different pages as the page itself

I have a facebook application and want to use it to allow my users to post simple messages on a page.
I used api explorer and made a few api calls to post but all that I post is not visible for other users than the one I am logged with and for not-logged-in users. I want my api-made posts to be visible for everyone, not just for the user that posted them.
I mention that if I make a post using the textbox directly (manually) on the page then those posts are visible to everyone, even for non-logged-in.
Is there a step-by-step tutorial for this?
What I finally want is to allow users of my site to post messages to facebook directly (after login to facebook of course). Posts should be done by different users to different pages as the respective page.
Code samples are much appreciated.
For posting to a page as the page, get a page access token: https://developers.facebook.com/docs/facebook-login/access-tokens/
To post as the page, you need an access token with manage_pages permission. And there’s no build-in way for a page admin to get notified when someone wants to post to their page as the page, because that’s not a common use case. But the page admin can grant you manage_pages once so you get a page access token, and then you can use that in your app to post to the page, you just have to set that access token explicitly when doing so.

Facebook PHP SDK : Post a Check in without a PAGE_ID

I would like to know If it's possible to add a Check in on Facebook with PHP but without any Page id.
Because I have a database with a lot of places but I do not have a corresponding Facebook Page Id.
ANy idea?
To my knowledge, it is not possible to do a Check In without a page_id.
You can refer to How to get place_id before checkin? to find out how to get Facebook Page Id for your places.