Facebook Open Graph event search - facebook

On Graph API Explorer I can do this search: search?q=Barcelona&type=event
But when I try the same with my app access token I get this error:
{
"error": {
"message": "(#200) Must have a valid access_token to access this endpoint",
"type": "OAuthException",
"code": 200
}
}
The other searches work well.

UPDATE 2017-11-27:
As Facebook doesn't allow an event search based on location anymore, I'd recommend to use https://github.com/tobilg/facebook-events-by-location-core
Original answer:
Please refer to https://developers.facebook.com/docs/reference/api/search/#access_tokens
There, it's stated that all searches except for pages and places require an user access token.

Related

App access token, can't get user information

When I try to use the already generated access token, on this https://graph.facebook.com/4921782178422?fields=id&access_token=ACCESS_TOKEN, it gives me this in response:
{
"error": {
"message": "Unsupported get request. Object with ID '4921782178422' 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",
"type": "GraphMethodException",
"code": 100,
"fbtrace_id": "F2ot2MGcBBM"
}
}
Facebook writes that all access tokens have permissions to public_profile, but i can't use the link above.
4921782178422 is a user id.
It works fine, when I use my own user access token, but that's only valid for 1 hour, and I need it longer than that.
I have followed these steps:
facebook: permanent Page Access Token?
What do I do wrong?

How to get the result in Facebook Graph Api Explorer.? Getting error message (#15) This method must be called with an app access_token

I was Unable to get the search result in Facebook Graph Api Explorer For Topic search API. I am getting the following error. I also have the access token included.
{
"error": {
"message": "(#15) This method must be called with an app access_token.",
"type": "OAuthException",
"code": 15,
"fbtrace_id": "CJiZqVSATXu"
}
}
Well, the error message actually contains the problem. You're not using an App Access Token, but seemingly an User Access Token (from the Access Token structure in your screenshot).
You must select an app of yours in the upper right Applications dropdown, and then select Get App Token in the dropdown below.
Still, that will probably not help much in this case. Are you aware that only whitelisted apps can use the Topic Search API?
See
https://developers.facebook.com/docs/graph-api/using-graph-api#search
https://developers.facebook.com/docs/mediasolutions/topic_search/v2.5

Facebook Graph API | Page feed

I am having a problem with the facebook graph API, when I try to read a Page feed using graph../{pageId}/feed it works only for some pages. On other pages I get the following error:
{
"error": {
"message": "(#200) Requires extended permission: ads_management or manage_pages",
"type": "OAuthException",
"code": 200
}
}
The Page is restricted by location, as we found out in the comments. If it works for one user, most likely the other one is not allowed to view the page - which means that you can´t grab the feed with his User Token. The Page could also be unpublished, but i guess that´s not the case.
If you are unsure, try lifting the restriction and test it.
If that does not work, you should file a bug.

Facebook Open Graph API Examples - How to get the access token?

Facebook has some great-looking examples of Open Graph requests here:
https://developers.facebook.com/docs/reference/api/examples/
The problem is that since I don't have an access token, most of the examples just return
{
"error": {
"message": "An active access token must be used to query information about the current user.",
"type": "OAuthException",
"code": 2500
}
}
I understand access tokens, but how do I get the token so that I can experiment with these example requests?
As long as you only want to test...
Use the Graph API Explorer to generate a token with the permissions you want.
Don't hesitate to select all of them.
Then, just copy/paste the token at the end of each graph.facebook.com URL. For instance:
https://graph.facebook.com/v1.0/me/friends?access_token=<ACCESS_TOKEN>
The day you want to get the access taken for an app...
Start by reading this doc.

Remove A Tab (App) from A Page Using The Open Graph

Is it possible remove an app from a page using the Open Graph?
From the official documentation they say that is possible: https://developers.facebook.com/docs/reference/api/page/#tabs
But when I use it with the delete on the graph explorer:
graph.facebook.com/128003037303086/tabs/app_333139666735547
I am getting this error:
{
"error": {
"message": "(#210) Subject must be a page.",
"type": "OAuthException",
"code": 210
}
}
From: http://developers.facebook.com/blog/post/524/
The Graph API Explorer makes it easy to read and update your Page settings interactively. If you get a ‘subject must be a Page’ error, you are likely not using the Page access token for the request.