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

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

Related

Instagram Graph API unusual error during GET request for insights

I am trying to extract instagram insights data to further analyze it locally and store it. For that I generated a system user access_token with the required permissions. Now I am trying to perform a GET request just as described in this documentation: https://developers.facebook.com/docs/instagram-api/reference/ig-user/insights
For that my call URL looks like this:
https://graph.facebook.com/v15.0/{instagram-id}/insights?metric=impressions,reach,profile_views&period=day&access_token={system_user_token}
This gives following response:
{
"error": {
"message": "(#100) The value must be a valid insights metric",
"type": "OAuthException",
"code": 100,
"fbtrace_id": xxx }
}
Thinking maybe this is due to my system user token not beeing elegible for this call I tried the Graph API explorer in the browser and a generated access token with the needed permissions. I am not quite sure where to go from here. Thank you for your help
I tried different access_tokens generated in the business manager and also generated in the meta for developers website. I tried to use a variety of different metrics described in the documentation. All gave the same output as described above. I also tried different api versions (15.0 and 16.0)

Permission issue when publish comment with Facebook Graph API v2.12

I am testing the facebook graph API comments
https://developers.facebook.com/docs/graph-api/reference/v2.12/object/comments
I checked my permission for the access token it contains the permission, which required by API. see the screenshot
I test my object-id (1797963943566411_1975256375837166) which is correct see me screenshot
Change the request method to POST and adding post data {"message": "haha"}
I get the error message shows:
"(#3) Publishing comments through the API is only available for page access tokens" see my screenshot
As you can see the first step checking, I have all the permission that the
API required.
Can any one see any sort of error in this process?
Try another way still not work.
I have a user who post a photo on his own facebook page.
I logged in with this user and give this user all permissions see the screenshot
enter image description here
call /me/accounts to get page access token
enter image description here
copy the page access token into the Graph API Explorer's access token field
call
GET: 1797963943566411_1975256375837166/likes
is working fine
But call POST: 1797963943566411_1975256375837166/likes
Get error response:
{
"error": {
"message": "(#200) Permissions error",
"type": "OAuthException",
"code": 200,
"fbtrace_id": "GtEaBfyXrUD"
}
}
The reason is Facebook changed the API behaviour. We are no longer to use api to like any POST on our time line. API can only like or comments on facebook page. Sad face !!!!

Facebook Open Graph event search

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.

Unusual behavior of facebook grap API ("type": "GraphMethodException", "code": 100)

I am having some unusual errors while fetching some data for some users via graph API.
As for example w all know we can get basic user info via graph.facebook.com/username
And it works. But it is not working for some users. Like the user www.facebook.com/sanzida.tanzum is a valid facebook user. So, we should get her basic info via graph.facebook.com/sanzida.tanzum. But when you will try that, you will get the error
{
"error": {
"message": "Unsupported get request.",
"type": "GraphMethodException",
"code": 100
}
}
And it is not a permission issue because use user herself gets the same error when she try to retrive her own data via graph API. Actually the user sanzida.tanzum is invisible to graph API. For example user sanzida.tanzum is on my friend list. You can check here. my friendlist.(it is public). But when I retrive my friendlist via graph API, my friendlist is shown excluding the user sanzida.tanzum ! But she is in my friendlist!
I have tried to contact facebook for this matter because I did not find any doccument related to this matter. They replied it is usual. (probably they did not read my mail at all. I am including the email conversation with facebook)
Hi তৌফিক,
They are getting errors because they are not you... they dont have
permissions to see the same things you do. They might also be missing
an access token. Either way: no bug here.
Thanks,
Emrakul Security Facebook
-----Original Message----- From: *****#ovi.com To: Subject: Report a Security Vulnerability - Unusual bug in facebook graph API
Your Email Address: *****#ovi.com Do you have technical details of
a security vulnerability?: Yes Vulnerability Type: Privacy /
Authentication Vulnerability Scope: Platform Developer API Title:
Unusual bug in facebook graph API Product / URL:
https://graph.facebook.com/sanzida.tanzum Description and Impact: I
was doing some graph API calls for testing purpose. Mostly I was doing
mostly user profile calls. (https://graph.facebook.com/exampleuser)
Somehow I realized facebook is giving following errors for some users
even they are on my friendlist. Same thing occurs when they try by
themselves.
As for eample the user "https://www.facebook.com/sanzida.tanzum" is on
my friendlist. (My friendlist is public.You can check if you want.)
So, according to facebook graph API, I can request the user's basic
info using (https://graph.facebook.com/sanzida.tanzum) But it returns
this error:
"{ "error": {
"message": "Unsupported get request.",
"type": "GraphMethodException",
"code": 100 } }"
Actually graph API can't access nothing of this user. Another
example.. When I request my friendlist via graph API , All friends of
my friendlist is shown except the user (sanzida.tanzum). But she is in
my friendlist! check here (my friendlist is public)
"https://www.facebook.com/toufiqueimam/friends". So why is this
happening only for few users?
Just now I got confirmation that the user herself gets the same error
if she tries to access (https://graph.facebook.com/sanzida.tanzum)
{ "error": {
"message": "Unsupported get request.",
"type": "GraphMethodException",
"code": 100 } }
Reproduction Instructions / Proof of Concept: Reproduction: first go
to https://www.facebook.com/sanzida.tanzum You will see it is a valid
profile. Now try https://graph.facebook.com/sanzida.tanzum You will
get following error
{ "error": {
"message": "Unsupported get request.",
"type": "GraphMethodException",
"code": 100 } }
This isn't a bug, the error means that the data you're trying to access is not accessible to you, does not exist, has been deleted, is not available because you haven't provided an access token from a user who can see it, etc.
See this answer for an example of this error message in relation to Facebook pages: https://stackoverflow.com/a/6847088/21062 - the same is true when trying to access user profiles if that user has blocked you, blocked your app, disabled their account or disabled all apps from accessing their information.
Just an FYI, I ran into this problem, and it wasn't because the user had blocked all applications. In my scenario, my application was attempting to force-convert Facebook's 64 bit integers into a 53 bit JavaScript integer (Node application). It was mangling the value, so when I was making the Facebook GET Request later on in my application lifecycle, I was doing so with the mangled value, and Facebook was trying to tell me "Um, this UserId doesn't exist".
So in my application, I had to use the Node Big-integer add-on, along with the Mongoose mongoose-long plugin for my Mongodb.
Long story short, if you are converting the UserId to it's native 64 bit integer, don't do so unless the intger type in your application is at least 64 bits.

Search for places with an App Access Token suddenly stopped working

i am calling the graph API with an App Access token (grant_type=client_credentials) to search for places on facebook. Quering for
https://graph.facebook.com/search?type=place&center=50.785361,6.0334127
Used return the search result reliably but suddenly stopped working with the following error:
{
"error": {
"message": "An unknown error has occurred.",
"type": "OAuthException",
"code": 1
}
}
I have tested the call on the Graph API Explorer. With my facebook user's access token the request still returns the desired data. Other requests with this app access token still work, so the token is good.
Any ideas?