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

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.

Related

Is fb graph user search api not working anymore?

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.

An unknown error has occurred on Graph Facebook

I tried to get Data from Facebook Page with the graph of Facebook but I have a problem.
When I try to go on link like:
https://graph.facebook.com/ID-PAGE?access_token=MY_ACCESS_TOKEN
I always do this to have the Data from a Page but since today I have the error Message: "An unknown error has occurred".
Thanks for help.
EDIT:
The bug is fixed : https://developers.facebook.com/bugs/486654544831076/?search_id
Have a look at my answer at
How to get user email and birthday from Facebook API Version v2.4
You have to specify each field you want to query now with v2.4. If you want to explicitly use v2.3, you need to prepend your calls by /v2.3 like this:
/v2.3/{page_id}?access_token=MY_ACCESS_TOKEN
Seems like there's currently a bug regarding requests made with app access tokens instead of user access tokens:
https://developers.facebook.com/bugs/486654544831076/
At this moment, I pretty much figured out what is happening, and it looks like a bug in the Facebook API.
For v2.3 and lower:
The /PAGE-ID call will return an Unknown server error when you don't pass ?fields=username (for example). If you do pass the fields option, it will work. You can get it out of the docs.
For v2.4:
This will work, but you will miss a lot of data, so you'll also have to pass the fields options. But if you don't pass that, this version will give you back only the most basic of details. This is as described in the version release: https://developers.facebook.com/blog/post/2015/07/08/graph-api-v2.4/
So the solution for now, would be to add the ?fields= everywhere you need, or to wait for Facebook to maybe ever solve it.
(And while you're at it, you might as well upgrade to v2.4 ;-)

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

Facebook Test User error

I use facebook login in my app and have tests for it. I use the /{app-id}/accounts/test-users endpoint to create users for my tests but the endpoint fails with the very generic
{
"error": {
"message": "An unknown error has occurred.",
"type": "OAuthException",
"code": 1
}
}
(which says the API is possibly down). I tried this with 3 different appids/secrets, both with using app_id|app_secret as the token and with a token from the get token endpoint. I also tested this on the Graph Api Explorer and it's giving me the same error. It was working fine but then it suddenly stopped.
What I want to know is 1. is it down? and 2. if not, what did i do wrong or what changed since yesterday?
+1 this also started to me yesterday mid-morning, with code and an FB app which had been working previously and was unchanged.
When I look at https://developers.facebook.com/apps/FB_APP_ID/roles/test-users/, I can see the new users.
So the call is "working" in that new users are being created, but it is broken in that we get a 500 and we don't get an access_token.
I don't have an answer yet.
I ran into a similar problem last week. After long hours of debugging I found out that I would get this same error every time I tried to create multiple test users with the same name simultaneously (i.e. when running tests in multiple threads).
So instead of setting custom a user name I don't even use the name field and I just let Facebook generate one. This way everything works fine. Seriously. I love Facebook API so much. :)
Hope this helps someone.

ref=ts on facebook app url cause app not found error

I've create an facebook app and it run smoothly at
https://apps.facebook.com/icoloringstar/
But the problem is: when I search my app name "icoloring star" in facebook, it link to the app at url:
https://apps.facebook.com/icoloringstar/?fb_source=search&ref=ts
Then facebook said that:
App "iColoring Star" is unavailable
The app "iColoring Star" is temporarily unavailable due to an issue with its third-party developer. We are investigating the situation and apologize for any inconvenience.
We found that url part "ref=ts" cause above problem, but really do not know why?
Could you explain me why and how to resolve this problem?
Thank you very much.
It sounds like your code is failing when the ref parameter is supplied in the request path.
I was able to repro this with any arbitrary value in the ref parameter when accessing your app
Check your server logs and and see if you're returning a 500 error to facebook when the request comes in
See if you have any code that parses a ref parameter and check it's not throwing exceptions
Make sure your callback URL in the app settings doesn't also specify a ref parameter or your app may receive two values and/or fail entirely
It means 'Top Search'. User enter a query into the top of search.
There are some ref parameters.. ref=bookmarks for example. I dont know the full list.
Did you put your app on Facebook App Center?