I am using the following query in Graph API explorer and i only want to get the title fields of previously posted actions on timeline, but the problem is that using the code below i am getting all fields like: title, image, URL etc.
https://graph.facebook.com/me/app_namespace:read/article?fields=title
As far as I'm aware, fields only works on a subset of Graph API calls, e.g. /me, but the Facebook Documentation does say it should work in most areas. It could be a bug, but I don't see any reference to it being part of the Object / Actions.
I would file a bug and see if it's 'as designed'.
Related
I am trying to get a list of page posts only, using the {page_id}/posts edge with the v2.10 API.
But for whatever reason, it simply returns the exact same result as {page_id}/feed - which includes status updates (they use the 'stories' tag, rather than 'message')
The API clearly states I can use the /posts edge to get only public posts, yet it's not behaving how it should.
What are my options? Is there a way to exclude stories from the /feed edge?
Posting links via Graph to my feed, i am noticing that new "story" and "story_tags" fields are being implicitly added (without my intention). this is new behavior as of on our around 07/20/12, as if i look at links prior to that in my feed, they did not include these extra 2 fields.
one of the issues i have with this is that the "story" and/or "story_tags" field appears to be triggering something new that has unexpectedly altered the display of the link on my feed, as the new posts no longer resemble those i made 07/19 and earlier, IF the link is to a page on Facebook. specifically, my "picture," "caption" and "description" values seem to be getting overwritten by content pulled from the FB page i am linking to. if however i link to an external page then this does not occur (although curiously the "caption" field seems to now be overwritten with the link in this case, or simply ignored altogether).
furthermore, i have an Xbox 360 game that posts links to my page (it links to a page on Facebook for the game). i just did one now. when i look at it in my feed in Graph it does not contain a "story" or "story_tags" field. thus, their caption, description and picture fields are not being overwritten like mine are when i set my link to a Facebook page. how are they getting around this? is there some way i can do the same through Graph?
I am not sure what you mean exactly, but since I've started working with Graph i've noticed the story and story_tags.
As far as I could see a message is posted by a person itself, and a story is something like [user] is tagged in picture, or [user] liked a story.
And indeed the Story and story_tags do not contain a whole lot of info. But you should check for picture caption en description anyway because as I've noticed they aren't always there.
I'm doing a query of this form:
https://graph.facebook.com/search?q=Beshoff&fields=likes,checkins,products,name,talking_about_count,description,category&type=place¢er=37.327453,-121.813102&distance=400
I am interested in finding out the exhaustive list of fields that can be selected for a Place object.
In particular, on the facebook page for a specific place, there are often multiple categories listed which I have been unable to figure out if it's possible to retrieve using the Graph API.
e.g. On https://www.facebook.com/BeshoffInfiniti, there is an entry "Car Dealership" but the graph api call above returns "Local business".
If you leave out the "fields" attribute in your query you will get all the fields. The number of fields depends on the object type (for example owned pages vs. wiki pages)
Don't just look at the Graph API. Take a look at FQL. There are different fields available in FQL vs. the API. And yes, using the distance function you can look for places in an area.
Graph API != FQL
One thing to try is the Facebook Open Graph schema entry for Page and Place.
You'll find all the additional fields for Pages. You can think of places as a subclass of pages.
If you're curious about the types of page that might be returned, try having a look through the create a page flow.
Is there anyway to determine if an object in Open Graph has been liked?
The documentation seem to imply that I have to post a like action on my object and expect an Error 3501 when it has been liked before.
From an UI pov this doesn't make sense, I want to change my like button ui to an "unlike" state without having to like my object and see if it fails or not.
Thanks!
If you're looking specifically for likes on an Open Graph Object (as in the target of an Open Graph Action), and you're talking about built-in (og.likes) likes, Shawn's answer is mostly right, but you need to look in a different FQL table.
An Open Graph Object is just a URL that resolves to a page that has og:type meta in its header. Facebook treats these as link objects (you can check this with SELECT type FROM object_url where url='http://url.to/your/object')
You can find interesting information in the link and link_stat FQL tables, but what you're looking for is the join table where Facebook relates user likes to links: the url_likes table.
So, to tell if the current user has liked a given Open Graph Object, you'd use:
SELECT user_id FROM url_like WHERE user_id=me() AND url='http://url.to/your/object'
If you get a value back, the current user has already liked it. If you get an empty array, the current user has not liked it.
To my knowledge, there's no way to do this with the Graph API, only FQL. I'd love to be proven wrong, though.
Depending on the object, if the object has a like connection you can user the graph api to determain if current user has liked the object.
i use fql in a similar fasion to check if a user likes a post.
/fql?q=SELECT+user_id+FROM+like+WHERE+post_id=\''.$postid.'\'+AND+user_id=me()
refer to post / like https://developers.facebook.com/docs/reference/api/page/
I'm starting to use the Graph API to get my notifications, and in the REST interface, they had the object_id field. I used this to get the notification objects' id to then query the Graph for more information.
The Graph API object does not include this information.
Example of what I want to do:
Get user's notifications JSON object.
Grab single item
Identify if this item supports commenting/liking
Display comments and number of likes for that item
if user can comment or like item, display buttons for this
my process:
call me/notifications/?include_read=1
is pretty easy to do.
I can identify if the object refers to a group, event, random application, post, or photo using the URL. I know that posts, likes, photos and others support commenting/likes so I have a way of doing this, though it involves parsing the link attribute of the item
this is what I need help with. I can get the id of the object by parsing the link, but I don't get the full object some times using this. For example, to post on a comment, you need to have USERID_COMMENTID and the link only has the COMMENTID in this form http://www.facebook.com/USERNICKNAME/posts/COMMENTID
I also need help with this. I guess some fb objects can't been liked via the graph?
any help would be great!
The notification FQL table, which also replaced the REST notifications.get API, still has an object_id column. That's the closest thing that exists to what you're asking for. It doesn't look like the Graph API call is documented to have the object_id field unfortunately.