Facebook Graph API - can't access insights - facebook

I would like to connect our klipfolio dashboard with the facebook graph api. The problem is that somehow the facebook documentation does not seem to comply with the actual statement needed in order to return any results.
Here ist my statement according to facebook: FB-Documentation
https://graph.facebook.com/v8.0/{mySite-ID}/insights?metric=(post_impressions_paid,post_impressions_organic)
The Error Message I receive when trying to execute this statement either with klipfolio or via the facbeook graph api explorer ist
{
"error": {
"message": "(#100) The value must be a valid insights metric",
"type": "OAuthException",
"code": 100,
}
}
Do you know what I'm doing wrong?
Thank you for your help.
Greetings from Vienna,
Christian
PD: be kind, I'm both new to this forum and also no developer ;)

Related

Commenting on posts Facebook graph api V2.10

Is it possible to comment on any post using the id of the post ? I tried with the V2.9 and the comment is successful but when I tried it with V2.10 it shows me the following error
{
"error": {
"message": "(#3) Publishing comments through the API is only available for page access tokens",
"type": "OAuthException",
"code": 3,
"fbtrace_id": "B7DlJt0HMOL"
}
}
This is what I did in the Graph api Explorer
When I switch the version to V2.9 the comment in the post is successful. Why does this happen or how can I fix it?
The error message tells you what the issue is, commenting on everything else than Page posts is deprecated since v2.10 and will not work anymore:
90-Day Breaking Changes
POST and DELETE /{comment-id} — This node now requires a valid page access token.
For more information, take a look at the changelog: https://developers.facebook.com/docs/graph-api/changelog/version2.10

Unsupported get request public information for a user on FB

We are try to update users information in our db related to their interests available on facebook. We are able to import data of almost everyone register with us but for the user with fb profile id 100012374975360 we are unable to do so we getting the following error even with fb graph api explorer with the following query params
100012374975360?fields=id,age_range,first_name,last_name,birthday,gender,email,education,devices,cover,about,hometown,currency,context,languages,is_verified,link,locale,location,name,middle_name,meeting_for,name_format,quotes,favorite_athletes,political,security_settings,timezone,sports,relationship_status,work,third_party_id,religion,likes.limit(10),tagged.include_hidden(true).limit(10),interested_in,photos.limit(10)
Error:
{
"error": {
"message": "Unsupported get request. Object with ID '100012374975360' 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": "FK9+dItscZj"
}
}
Can know why it is happening, what is wrong with this user.
Thanks

APIException$FailedRequestException Cannot determine the target object for this request

I'm new to the Facebook API and the Graph API Explorer, so any help understanding the tool is appreciated. I have been through quite a bit of the Facebook developer documentation trying to understand how to register an application, create and use access tokens and using Graph API Explorer to return a data I will eventually persist for use in analytic tools.
When I execute the following using Graph API Explorer it returns a message that I can't find any information on so I can track what I'm doing wrong.
https://graph.facebook.com/v2.6/CAMPAIGN_ID/insights
{
"error": {
"message": "(#275) Cannot determine the target object for this request. Currently supported objects include ad account, business account and associated objects.",
"type": "OAuthException",
"code": 275,
"fbtrace_id": "HbrtL4oBAh9"
}
}
When I execute the same URL in a browser:
https://graph.facebook.com/v2.6/CAMPAIGN_ID/insights?access_token=9999999999999999999999NnIi3URfZBtORdG7J6AwUjo0zzDO2AcsUrTGXYHRKj0YI4nWPUmYbMshXsxPApAEW3xUNvtIYhYEZA5wBqRLvjL4bPN8wzKq7KiJ9Rr3VQO1Ps2M8zbFl3T38cp8rhLxeLfm3OQlZBEZZZZZZZZZZZZZZZZZZ
also returns the same error message.
Thanks

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.

(#100) Invalid parameter OAuthException when creating event using Graph API Explorer

I am using Graph API Explorer to try and work out how to create a user event prior to coding it for real in Objective-C for an iOS app.
I have obtained an auth token which contains user_event, publish_actions and create_event permissions.
I am POSTing a request to https://graph.facebook.com/12345678/events with parameters of name set to Tester 2 and start_date set to 2013-06-27
In response I get
{
"error": {
"message": "(#100) Invalid parameter",
"type": "OAuthException",
"code": 100
}
}
I can't see what I'm doing wrong. Any help would be much appreciated.
Thanks
Andrew
It's because you need to use start_time instead of start_date.
Doc reference:
https://developers.facebook.com/docs/reference/api/event/