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?
Related
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.
Following my question (to which I self-answered): Is possible to use Facebook's (Page) Graph API without having an role in that page?
I would now like to know if I can get an access token for an app (created in https://developers.facebook.com/apps/) instead of a page (of which I can get an access token in Graph Explorer), to query Facebook's graph API?
e.g. with my page's (which is not the page I'm querying the graph about) access token:
GET https://graph.facebook.com/24HourFitness/posts?access_token=(*)
(*) access token generated in Graph Explorer (page access tokens) for one of the pages I admin
This is much too broad. It will always depend on WHAT you want to query with the App Access Token, because not all object allow using App Access Token, but require a User or Page Access Token...
Refer to the object's docs to see if it's possible for the purpose you desire, e.g.
https://developers.facebook.com/docs/graph-api/reference/page#Reading
says
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.
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.
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
I used read_stream, publish_stream and manage_pages as the permissions for the facebook graph api so that i can access and manipulate a user's feed. I tried using the type parameter to filter the feed and return posts that have messages i.e. by adding 'type=message' to the url but this does not seem to work.
I have tried using the sample in facebook developers' page and it work there. I then compared the two urls (one from the facebook developers' page and the other from my web app) but the only difference was they had different access_tokens. Thus, i concluded that the problem might be the permissions so i am wondering what permission will allow me to perform this operation.
When you said 'Sample in Facebook Developers' page were you referring to the Graph API Explorer?
If so, the explorer automatically requests metadata on queries by silently adding a '?metadata=1' to the query.
If you need the metadata, you should add this too, bearing in mind that there's a namespace collision between the properties of some objects and the metadata (i.e some objects have a field named 'type' which is suppressed if you force the metadata to be returned - you get the 'type' field from the metadata instead)