Facebook Ads creative object returns story_id that throws a GraphMethodException 100 error - facebook

I am building a data warehouse that pulls data from both the OG Insights and Ads API.
Issue:
I am querying the creative object in the Ads API which returns the story_id field for type 27 ads. For most story_ids that are returned I am able to do a OG query for the story_id and have a valid response returned. However, for some story_ids I get GraphMethodException.
Creative query:
https://graph.facebook.com/6003446971120?access_token=TOKEN
The token has been exchanged with user who created the ad and has advertiser role on the page which the story_id was posted to (based on the object_id of the creative). The token has the following scope: ads_management email manage_pages offline_access read_insights
Creative query returns:
{
"url_tags": "",
"story_id": "123 - example",
"type": 27,
"object_id": "456 - example",
"name": "REMOVED",
"run_status": REMOVED,
"preview_url": "REMOVED",
"count_current_adgroups": REMOVED,
"id": "REMOVED",
"creative_id": "REMOVED"
}
Query for story_id:
https://graph.facebook.com/123?token=TOKEN
I have tried 2 tokens, the first the the same as above, and the second is for a user that has the read_insights role on the project and has the following scope: ads_management manage_pages read_insights
Story_id query returns:
{
"error": {
"message": "Unsupported get request.",
"type": "GraphMethodException",
"code": 100
}
}
It looks there have been many posts on the GraphMethodException error. The common issue is that the token is from a person that is restricted from seeing the content (page age wall, targeted post, ect). However, I think I should have full access to the page based on my privileges. I tried to validate this by having the page manager do the same query, which also returned the GraphMethodException error.
So the net net is - How can I have an creative referring to a story_id which I cannot get a valid response for?
Thanks guys,
Aaron
PS - I also tried querying 456_123 (the pageid_postid format a post) and I still get the same result.

This exception does not necessarily relate to access permissions but can also mean that the object cannot be accessed.
For example, it is possible that a creative references a story which has been deleted. In this case, you will not be able to read the details of the story from the Graph API and this exception will be thrown.
You should check whether the story does exist or not by reading the graph for the page that this story was created under.

Related

getting error on facebook catalog batch api on using app token

api works for user token but does not when i put app token
https://graph.facebook.com/v9.0/<my-catalog-id>/batch?access_token=<my-app-token>&requests=[{"method": "UPDATE","retailer_id": "retailer-id","data":{"availability": "in stock", "price": "10", "currency": "USD"}}]
{
"error": {
"message": "Unsupported post 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",
"type": "GraphMethodException",
"code": 100,
"error_subcode": 33
}
}
If the id in ****** is your catalog id then your app must be missing permission. To access catalog, your app should have catalog_management and ads_management permissions. For better understanding you can refer this url. This document has example of real estate listings.
If the id in ****** is your catalog id then your app must be missing permission. To access catalog, your app should have catalog_management and ads_management permissions. For better understanding you can refer this url. This document has example of real estate listings.

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.

How to get likes_count with only publish_action permission?

I have a web application that uses Facebook API. Now, I'm facing with an issue on getting the total of likes from a user's post.
I have a long lived "userToken" valid for 2 months with the following scopes: public_profile, email, manage_pages, publish_actions
I use "POST /feed" to send a link into the user's timeline and I get a post ID.
Then, I try to get the total of likes for this post with "GET /{POST_ID}/likes?sumary=true" and I get ZERO likes even if the post has many likes.
{
"data": [
],
"summary": {
"total_count": 0
}
}
I tried to use only "GET /{POST_ID}" to get post information and I get the following json response:
{
"error": {
"message": "Unsupported get request. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api",
"type": "GraphMethodException",
"code": 100
}
}
I have this issue only when I post to a user's timeline. However, when I post to a Facebook page, I can get the post ID and the numer of likes.
I made a test by adding read_stream scope and I can get the post information. However I read in API documentation that this permission has a limited use: "This permission is granted to apps building a Facebook-branded client on platforms where Facebook is not already available"
Then, I started to check other applications that get post likes and I noticed that they are using only public_profile, email, manage_pages, publish_actions. They are not using read_stream.
So, my question is how they can get this information only with these scopes?
I hope anyone of you will be able to help me?
Thanks
Can you please check, if the post is public.
If you have the post id of a public post you can fetch the likes simply by requesting the endpoint you already mentioned.
To get your feed you need the read_stream or user_posts permission.

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.

Can access facebook object via web, but can't do it with API

I'm trying to get info about object by id (mostly links, photos, statuses..). And I find that there are some posts that I can access from a browser(I can share, comment, like..), but for some reason I'm getting
{
"error": {
"message": "Unsupported get request.",
"type": "GraphMethodException",
"code": 100
}
}
while accessing the same object through API (either via Graph Explorer, or with PHP SDK).
In Graph Explorer I've tried all permissions. My FB App has no restrictions and there are lot of posts, that I can GET.
What can be the problem, that API returns me an error instead of a post, that I can freely see from my account on facebook.com?
P.S. If I try to get /user-id/feed of the user, whos post I can't access, it often gives me an empty array data:[]
"Unsupported Get Request" means you've requested something which can't be returned to you.
Some possible reasons, in order of how likely they are in my experience, are:
Object has some privacy or demographic restrictions and you haven't provided an access token from someone who meets those restrictions
Object was deleted
Object doesn't exist
Object is of a type not supported in the API at all