I am using Koala gem to interact with Facebook Graph API. In its Github, the authors mentioned that Koala also supports Facebook REST API, which will be deprecated in the future, and give this example:
#rest = Koala::Facebook::API.new(oauth_access_token)
#rest.fql_query(my_fql_query) # convenience method
#rest.fql_multiquery(fql_query_hash) # convenience method
#rest.rest_call("stream.publish", arguments_hash) # generic version
My take from this is that FQL is a part of the REST api, and that I shouldn't use it if I don't have to. I couldn't confirm this by googling.
Is it true that FQL is part of REST api? If so, should I avoid it when possible?
You better do not user fql.
See this https://developers.facebook.com/docs/reference/fql/
Version 2.0 of the Facebook Platform API is the last version where FQL
will be available. Versions after 2.0 will not support FQL. Please
migrate your applications to use Graph API instead of FQL. Please see
our changelog for current version information.
Per documentation, FQL is nearly completely deprecated and you shouldn't use it for new projects (and also should migrate existing projects away from it as soon as possible). My old answer is below for posterity.
You can also make FQL query requests against the Graph API, like so:
http://graph.facebook.com/fql?
q=SELECT%20uid,%20name%20FROM%20user%20WHERE%20uid%20=%2015504121
Yields:
{
"data": [
{
"uid": 15504121,
"name": "Jimmy Sawczuk"
}
]
}
FQL has been deprecated from version 2.1.
Related
I am getting started on Facebook Graph API. I need to use Places Search Product, I have followed a tutorial to create a basic user app (generate user token), and am trying to run this simple request
https://graph.facebook.com/search?
type=place&
center=40.7304,-73.9921&
distance=1000&
q=cafe&
fields=name,checkins,website&
limit=3&
access_token=XXXX
I am always getting this error
{
"error": {
"message": "(#33) This object does not exist or does not support this action",
"type": "OAuthException",
"code": 33,
"fbtrace_id": "XXXXX"
}
}
You did not explicitly specify an API version in your call there, so this uses whatever the default API version for your app is.
Looks like for yours that might be v6.0 already (did you create the app id only recently?) - and with that, things have changed regarding the Places Search API.
There is a new feature called Page Public Metadata Access now, that you have to apply for, before you can use this search.
I tried your request with older apps that still can use lower API versions in Graph API Explorer - and this works fine for API versions v3.0 up to and including v5.0.
Using v6.0, I get the same error message you mentioned.
So, if your app is old enough to still be able to use older API versions, you could do that - at least for the time being. If not, then you will have to submit your app for review of this feature first.
The answer I found after investigations is that Facebook has deprecated places search from Facebook API, u would need to ask for it to use it!
I wanted to use Graph Api to fetch the groups where user is member. But since 2.4, FB has deprecated the user_groups permission. In Graph Api Explorer, when I tried it with v2.3, it returns the results as expected. After seeing this, I implemented the same in my app with the version parameter of GraphRequest. Doing this, did not show me the results, instead they showed the error of permission.
What should I do then? Is there any way to use v2.3 for Graph Api? As per the sdk, my current Graph Api is 2.9
Use user_managed_groups instead, there is no other way. You can only access groups you manage and you cannot go back to an older API version. Even with an older App it would be pointless, see deprecation info in the changelog: https://developers.facebook.com/docs/apps/changelog
When I use postman application or Graph API explorer then i get complete information or all fields of posts as explained in https://developers.facebook.com/docs/graph-api/reference/v2.0/post
I have not use fields attribute in above image even then it is showing all fields so i am looking for the answer to pass field attribute in query string.
But when i use SDK i get only 3 fields created_time, id and message, please refer following image:
Kindly tell how to get all fields of the posts using facebook sdk c#?
You need to specify the fields parameter, it´s called "Declarative Fields" and came with v2.4 of the Graph API: /me/posts?fields=field1,field2,field3,...
The possible fields can be found in the docs, you should use the latest version though: https://developers.facebook.com/docs/graph-api/reference/v2.7/post
Make sure you are using a newer Version of the API, you are trying to use v1.0 in Postman (which does not exist anymore).
With FQL being deprecated, is there an alternative graph-y way of fetching the post-comments from a specific user without resorting to downloading all comments first and enumerating them?
Before I could just trigger an FQL statement like
SELECT text FROM comment
WHERE post_id = '<postid>' AND fromid = '<uid>'
But since that is no longer supported without using the older API, I'm wondering if there's an alternative for v2.1 and up?
Why? I organise a fair amount of give-away-contests on Facebook and have a script that retrieves the amount of likes from the announcement post, picks a number of random ones and then retrieves the comments of those users on that same post.
As a side remark: I hate it that I as a page owner cannot retrieve a list of people that liked my own page via the API. I still have to check that manually each time.
Unfortunately there's no way to filter the comments by user directly with the current Graph API version.
If you're using a v2.0 app, you can still use FQL until August 7th 2016. I'd wait and see if FB amends the Graph API with similar functionality as FQL had in the future.
I am trying to perform a search via the Facebook API and getting the following error from Facebook - (#11) Post search has been deprecated
URL I am using to query graph:
https://graph.facebook.com/search?q=search_query&type=post&access_token={access_token}
Any ideas why this is happening as I can't seem to find anything about the post search being deprecated?
UPDATE
Graph API v1.0 has been fully deprecated and is no longer available as a workaround. Original answer below for reference.
Yes, version 2.0 of the GraphAPI does not let you search for posts anymore. See the updated documentation.
You can continue to search for posts by changing your API call to:
https://graph.facebook.com/v1.0/search?q=search_query&type=post&access_token={access_token}
I.e. add v1.0/ after https://graph.facebook.com/
As mentioned Niraj Shah, searching by the type "post" is already 'Legacy' API method and could be used with path '/v1.0/search?type=post', BUT there is one more trouble - your application can't use v1.0 API, if it was created after 30th April 2014. So be careful. According this answer.
According to Facebook, "All Facebook-enabled apps will be automatically upgraded to API v2.0 on April 30, 2015. If you have mobile apps, you'll need to update your app well before that date - leaving additional weeks for people to download your update from the store", and "Public post search is no longer available".
Check this for details: https://developers.facebook.com/docs/apps/upgrading