Facebook public objects not retrievable through Graph API or FQL - facebook

I am searching the public feed and once I get the objects I want to get more information on them. I login with an auth token and when I try to get more information through both the graph API and FQL I get the following results.
Graph API - I run the following request "https://graph.facebook.com/{pid or object_id}"
Results - I get the error "Unsupported get request."
FQL query - I run something like "Select {fields} from photo where pid = '{pid}'"
Document - "To read the photo table you need any valid access_token if it is public and owned by the Page."
Results - I get an empty data array.
This used to work and I am not sure if I am doing something wrong or this functionality has changed?
Thank you for any insight you might have,
Stefanie

Facebook says this is "By Design" via developers.facebook.com/bugs/285682524881107

Related

Facebook graph API {post-id}/likes returns empty data

This request returns an empty array: graph.facebook.com/773227196065108/likes, but this request returns a normal array: graph.facebook.com/576234822476425/likes.
First post - post from user, second post - post from page.
How do I get a normal result in the first case?
http://graph.facebook.com/773227196065108 returns
{
error: {
message: "An access token is required to request this resource.",
type: "OAuthException",
code: 104
}
}
since its a user post and probably not public, you will have to access it using a proper access token on behalf of the user . also the number of likes obtained via graph api is dependant on the the privacy settings of people who liked the post .
the second post is one from a page and is public, so its directly accessible for you .
773227196065108 is a user whereas 576234822476425 is a page. Public page posts can be inspected in the API, public user posts have certain restrictions applied to them such as, the queried user must be using the application as well. If the queried user isn't using the querying application the response will be empty.
In addition /me/likes/773227196065108 will not work as /me/likes are only for pages not posts.

How can I get user's facebook interests?

I am trying to get interest from Facebook Api but empty array is returned.
I have searched for other issues like:
How to get user Interests? (//stackoverflow.com/questions/12422714/how-to-get-user-interests)
How can I get the interests of my friend through facebook api?(//stackoverflow.com/questions/6587373/how-can-i-get-the-interests-of-my-friend-through-facebook-api)
In "Graph API Reference" (developers.facebook.com/docs/graph-api/reference/v2.1) is defined a full list of nodes. If I click in 'user' and click in 'interest' I am redirected to "/{user-id}/interests" (//developers.facebook.com/docs/graph-api/reference/v2.1/user/interests) description. In this description are defined serveral points:
Endpoint: GET /user/interests
Permission: user_interests
Descrption: The interests listed on someone's profile under "Likes > Interests" (//www.facebook.com/me/likes_interests).
I am using Graph API Explorer for to test. I have used all api versions (from unversioned to v2.1).
If I get a valid access token with aproppiated permission and I do a request to endpoint "/me" I have a successfully response with data.
If I do a request to endpoint "/me/interests" I have a empty response:
{
"data": [
]
}
My user in Facebook is following a list of interest for example: stackoverflow group.
If I do a request to movies or books the response are empty too. But if I do a "like action" in a book or movie and try again I have a successfull response. If I try again with "/me/interest" response is empty yet.
I believe that I do not understand concept of "interest" or something is wrong and I can not see it.
Which is the way for to recovery the interests of an user?
The interests are specified in the Profile section, and not via Like actions! The list you linked is not an interest either.
Books and Movies can be requested with the user_likes permission, so if you didn't request that the response will be empty as well.

Facebook notification FQL query problems

I want to retrieve the current user's notifications from the past 8 hours. I'm using the Graph API Explorer on FQL mode before I put this into my app. On permissions, I have user_about_me and manage_notifications. The request i'm searching for is this:
SELECT notification_id FROM notification WHERE recipient_id={0}
But it returns:
{
"error": "Request failed"
}
What am I doing wrong?
The error Request failed
generally occurs when the your request in not correct.
If you read the documentation properly, this API is used to fetch -
The current user's notifications
So, only valid recipient_id could be the current user's id or me(); not his friends or any other user.
If you have tried the current user's id to the recipient_id, that means the id you've provided with {0} is not correct (some syntactical error).
So, instead you could simply write recipient_id = me()

I want to get the public post from user only from facebook graph api

I want to get the public post from user only. For example when I run below query -
https://graph.facebook.com/search?q=buy+AND+nokia+AND+lumia&limit=100&type=post
I get post from category = community. I want to get the post from users only not communities. Is there way to filter the results

using facebook graph API vs FQL insights

I'm trying to get insights from facebook for some pages I have admin rights to. I'm able to get the correct data with the graph API but when I try with FQL I get an empty JSON object. Any idea what the problem may be?
I think the query is correct because I do not get any 400/500 errors. I also think the permissions are correct because I'm using the same framwork with the graph API solution and it works fine. Maybe you need additional permissions to use FQL? I have manage_pages and read_insights.
I'm implementing with basic text replacement on the template URIs from facebook's documentation.
EDIT: I think the problem may be that I don't actually have the read_insights permission. I do have the manage_pages permission. Perhaps this explains why I can access insights through Graph API but not FQL?
Graph API query:
string insight_str = "https://graph.facebook.com/APP_ID/insights/FIELD/FREQ?access_token=ACCESS_TOKEN";
string url = insight_str.Replace("FIELD", "page_impressions").Replace("FREQ","day").Replace("APP_ID", accounts[i].id).Replace("ACCESS_TOKEN", accounts[i].access_token);
https://graph.facebook.com/xxxxxxxx/insights/page_impressions/day?access_token=xxxxxxxx
Graph API parsed JSON result:
page_impressions
2011-12-28 412
2011-12-29 971
2011-12-30 373
FQL query:
string query_str = "https://graph.facebook.com/fql?q=QUERY&access_token=ACCESS_TOKEN";
string query = "SELECT+metric,value+FROM+insights+WHERE+object_id=APP_ID+AND+metric='FIELD'+AND+end_time=1322722800+AND+period=86400";
string url = query_str.Replace("QUERY",query).Replace("FIELD","page_impressions").Replace("APP_ID",accounts[i].id).Replace("ACCESS_TOKEN",accounts[i].access_token);
https://graph.facebook.com/fql?q=SELECT+metric,value+FROM+insights+WHERE+object_id=xxxxxxxx+AND+metric='page_impressions'+AND+end_time=1322722800+AND+period=86400&access_token=xxxxxxxx
FQL JSON result:
{"data":[]}
I have the same problem with Facebook C# SDK version 5.4.1 and 5.3.2 (see my post Error with FQL query with library 5.4.1)
I always receive an empty response like you.
You must have the read_insights permission.
I think the end time in your example is slightly off. It needs to fall exactly at midnight PST. I obtained a value once I moved the time forward an hour, to 1322726400.