Is fb graph user search api not working anymore? - facebook

https://graph.facebook.com/search?q=sharma&fields=name&type=user&access_token=
I was this URL along with access token and it was giving me user name list that i was using in my project. Only names are my requirement but when today i started to use it i am not getting any data nor any error.
Its only returning this
{
"data": [
]
}
Recently a month ago it was working for me.
Can anyone tell me if they have the same issue or if something has changed?
Is there any other was of getting users name mainly first + last name from fb?

I have found answer of my question which is Fb is no more giving user results for graph search api.
https://developers.facebook.com/docs/graph-api/changelog/breaking-changes#search-4-4
Search API
You can no longer use the /search endpoint with the following object types:
event
group
page
user
I dont know whether its a permanent revoke or temporary but it has something to do with Cambridge analytica data leak issue
https://www.google.co.in/search?biw=1360&bih=662&tbm=nws&ei=-iTXWrrkCYrxvgTTy5GgCw&q=cambridge+analytica+data+leak&oq=cambridge+analytica+data+leak
I hope it will help others to find out why their API is not working anymore.

Related

Searching public profiles using Facebook Graph API

I am looking to search Facebook public profiles using the Graph API with parameters like name, location and age. To accomplish this I created a Facebook app to get an app ID but I am unsure as to how to proceed to make the query to the API.
To try it out I tried using the explorer (https://developers.facebook.com/tools/explorer/) but I am unable to get any results that does not contain "me". I made sure to get a access token and enter a query like the following:
search?q=tobias&type=user&fields=id,name
The only reply is:
{
"data": [
]
}
I feel like I am missing something but I have been unable to figure out what, please advice.
The search endpoint is broken since 2018-04-04 for certain search types, including pages and users.
Search API
You can no longer use the /search endpoint with the following object types:
event
group
page
user
See
https://developers.facebook.com/docs/graph-api/changelog/breaking-changes#search-4-4
Due to what has recently been in the news, searching for users has been deprecated, and is not supported through Facebook APIs.

Facebook | Can't get profiles that are mentioned in a facebook profile post

I have an App that needs to query a users's profile post.
For any post, I'm trying to figure out:
the number of people (profiles) mentioned and
the names of the people (profiles) mentioned
Assume the user has already given the App access to view their profile data.
See here: https://developers.facebook.com/docs/graph-api/reference/v2.3/post
According to the documentation, if a user mentions 2 profiles, say "Friend1" and "Friend2" then I should be able to get back a response that includes the field:
which has some profile information for "Friend1" and "Friend2".
The problem I'm having is given the GET query
https://graph.facebook.com/v2.3/10207722160149556_10207755501343065
I get the response:
{:created_time "2015-11-08T09:29:54+0000", :message "Friend1 Friend2 testing again sorry just ignore", :id "10207722160149556_10207755501343065"}
I don't get a to field or for that matter a bunch of other information?
Does anyone know how I can get back what is listed in the documentation as what I should be getting?
Any help would be appreciated
In case this helps, these are the permissions I'm currently requesting:
["user_photos" "user_friends" "publish_actions"
"user_posts" "user_likes" "user_relationships"
"user_about_me" "email" "public_profile"
"user_tagged_places"]
Kind regards,
Jason.
Sorry, bad case of not reading the documentation and a library that I was using that got in the way.
I have to include a "field" query param to specify what I want returned.
After that and validating with a curl call I can get the information I need.

Empty response to API call to Facebook Graph

I have been hammering away at this problem for the last day. I really hope someone can help me out. I would be very grateful.
What I am trying to do is fetch event data from a Facebook Page. I looked over the documentation, which says this about reading Pages data:
Reading
A Facebook page
Permissions
For pages that are published, you need:
An app or user access token to view fields from fully public pages.
So what I did was I obtained an app access token via:
GET https://graph.facebook.com/oauth/access_token?
client_id=YOUR_APP_ID
&client_secret=YOUR_APP_SECRET
&grant_type=client_credentials
which then returned
access_token=MY_APP_ID|MY_APP_ACCESS_TOKEN
After this I followed the documentation and made the following call
https://graph.facebook.com/v2.4/129511477069092/events?fields=id,cover,name,venue,description&access_token=MY_APP_ID|MY_APP_ACCESS_TOKEN
This returned:
{
"data": [
]
}
So after some fiddling around I was able to make the call by switching to version V2.2 and by creating an access key with Facebook API Graph explorer tool(no permissions granted).
GET https://graph.facebook.com/v2.2/129511477069092/events?
fields=id,cover,name,venue,description&
access_token=ACCESS_TOKEN_FROM_FACEBOOK_API_EXPLORER_TOOL
The page I am trying to retrieve data from is public and so are the events, so I can't figure out what is going on. I know I am super close since I am able to retrieve the data with the token provided by the Facebook API Graph Explorer Tool. The thing with using this token is that it only last a few hours and I need something that is going to last longer such as an app access token. I have done some research on Stackoverflow and found similar questions, but none of them solve my problem. Any help will be appreciated to the max! Thanks.
Looks like a bug of v2.4 to me. It works with v2.3 if you remove the deprecated venue field:
https://developers.facebook.com/tools/explorer/145634995501895/?method=GET&path=129511477069092%2Fevents%3Ffields%3Did%2Ccover%2Cname%2Cdescription&version=v2.3
If the version is changed to v2.4, it returns an empty result.
https://developers.facebook.com/tools/explorer/145634995501895/?method=GET&path=129511477069092%2Fevents%3Ffields%3Did%2Ccover%2Cname%2Cdescription&version=v2.4
There's no documentation about this in the changelog at
https://developers.facebook.com/docs/apps/changelog#v2_4
so I guess it's a bug. There's already a bug report at
https://developers.facebook.com/bugs/443054055873667/
with status assigned. If you have an app that supports v2.3, I'd suggest you prefix your request like this:
GET /v2.3/129511477069092/events?fields=id,cover,name,description

I can't use "friends locations" with the Graph api explorer anymore

as the title says, I can no longer use friends locations with the graph api explorer any more(in https://developers.facebook.com). Even if I click all access token checkboxes,(trying to get me/friends?fields=locations.fields(place)) I still get error(
{
"error": "Request failed"
}). But me/locations?fields=place works, so it must be someting with "friends" that makes it to crash.
I was able use it 2 weeks ago, and I have not done any changes, it just suddenly stoped working. if I login with my test Account I can get all the parameters I request, but not on my primary account. Is there any one that has any idea what the problem can be? or why it occurred? I have done everything that I can think of, from using diffrent web browers, deleting all history, use diffrent computer. I have compared the settings for both my test account and my main account, both have the same settings.
I am sincerely sorry if i have misspelled anything.
It happens for me as well for any of the locations methods, but the location method with out the s works. I don't know if that data is usable for you.
me/friends?fields=location,hometown
I have figured out the reason to this problem. I has to do with requests from facebook's api, if i lower the Limit per request it works. Then to save the information I use offset.

facebook graph api returns empty data array

I wanted to get the events for a closed group (which has tons of events) via the facebook graph api, but I only got
{
"data": [
]
}
in the Graph API Explorer even though I was using an auth token with user_events enabled. Just to be sure, I enabled every single permission for the token but got the same result.
what am I doing wrong?
I think I just found the answer to my problem; there was nothing wrong!
What I thought were events coming up were actually events that happened in the past, shown in the group/events page; I guess those aren`t aren't accessible.
I think I'll settle with using FQL as offered as a solution in this question.