Anybody knows why i get no results back when i add the untill parameter in facebook?
Requested url: https://graph.facebook.com/FBID/home?limit=25&until=1388688636
How do i replicate this:
Go to: https://developers.facebook.com/tools/explorer
Execute the above url (FBID/home?limit=25&until=1388688636)
In the returned results go to the bottom and click the link that got the json key: "next" (looks like: "next": "https://graph.facebook.com/FBID/home?limit=25&until=1388688639")
The returned result is:
{
"data": [
]
}
i searched for ages about this problem and could not find it, the only thing i can come up with is that Facebook only returns posts since the permission accept for the Access Token, another cause could be that Facebook is broken.
This is standard (albeit undocumented) behavior. The empty data array shows up when you try to access an object that has its privacy settings configured to not let third party apps read it, and it's also what's being displayed after you've reached the end of all public records of the current user.
You just have to deal with it. Keep looping over the next result while data != empty is true.
Update: This could also be related to an open issue Facebook is aware about, namely broken pagination. The problem seems to be "dead ends". You can read more about it here and try fiddling around with the timestamp and limit parameters of the request.
Related
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.
im currently working on facebook integration into my mobile AS3 game. I'am downloading friends pictures, which works just fine and is not currently an issue. Problem is, i am trying to detect, if user has silhouette (default) picture or his own (is_silhouette property);
Here goes code:
(response[i].id) is valid user id which i have got from previous api comunication
...
HasDefault(response[i].id);
...
private function HasDefault(uid:int):void{
FacebookMobile.api("/"+uid+"/picture", callbackX);
}
private function callbackX(response:Object,fail:Object):void{
if (response != null){
trace(response.url);
trace(response.is_silhouette);
}else{
trace("here goes nothing...");
}
first things first...this code above has 2 issues. First problem is, unless i use absolute URL, facebook does not respond, so API method has actually look like this:
FacebookMobile.api("https://graph.facebook.com/"+uid+"/picture", callbackX);
i dont know why i have to use absolute url here, because anywhere else id/function is good enough...but that is not still main problem.
If i use absolute URL i do get valid response from facebook but according to this https://developers.facebook.com/docs/reference/api/using-pictures/ i should get response.url and response.is_silhouette in my response object. i however recieve only empty response object...I'am starting to be realy desperate.
In addition, i have tried to paste THE SAME request into the https://developers.facebook.com/tools/explorer explorer and surprise surprise...it returns
{
"data": {
"url": "https://fbcdn-profile-a.akamaihd.net/hprofile-ak-frc1/somenumbers.jpg",
"is_silhouette": false
}
}
...which is exactly what i need...but within the application i get only empty response object...
I do not know what you line "FacebookMobile.api("https://graph.facebook.com/"+uid+"/picture", callbackX);" does.
But whatever library that is, stop using it, because its not letting you specify the call you want to make. You can just call the graph api calls yourself using a URLLoader.
So here is the magical thing that is going wrong: You need to be able to append an extra variable when you request the picture: "?redirect=false"
This tells facebook to give you a json response. If you do not have that variable, you will get a redirect to the actual image, which is usually what a person wants anyway.
To see how that works, test out the two links below, one with redirect=false - which you want. and One with it set to true - which you do not.
https://graph.facebook.com/shaverm/picture?redirect=false
https://graph.facebook.com/shaverm/picture?redirect=true
I am pretty sure what is happening is that you are getting the image back instead of the json response describing the image.
Forgive me I'm new to the Facebook graph concept. I've read through the documentation and am a little lost on something that I want to try and do. I have been able to query posts based on a keyword such as "sailing" like so:
http://graph.facebook.com/search?q=sailing&type=post
I see that it returns a result set containing 25 of the most recent posts with the keyword provided. My issue comes when I try to take a post id and query it directly. What I want to do is to be able to take a post id and query it after a 24hr time frame to see if it has received any comments and to see how many likes it has gained since being posted.
I can take the userID_postID and query like:
http://www.facebook.com/userID/posts/postID
I can see the post with the likes but when I try this in the graph:
http://graph.facebook.com/userID/posts/postID
I get the following error message:
{
"error":
{
"message": "Unknown path components: / postID",
"type": "OAuthException",
"code": 2500
}
}
I've seen where people have commented that if you want to access a post you will need to get an access_token. I'm not sure why you need an access_token to access a post that you originally obtained without one. It doesn't seem to make sense. One thing that I have noticed when trying to do this with different posts is that this seems to be related to accessing posts of an individual rather than a fan page. Whereas a public page such as a fan page seems to return the results.
I also tried querying like:
http://graph.facebook.com/userID_postID/likes
this returns the likes for a public page such as a fan page but doesn't return anything for an individual page. Can anyone help point me in the right direction or maybe give me some explanation on what the proper way to handle this would be? Requesting an access_token from the user is something I do not want to do, this is mainly for a service that we're trying to create that allows us to survey based on a keyword. Any help would be much appreciated, thanks.
I've created a page on Facebook without creating an account. This means that a default account is created with the page_id the same as the account_id.
When I try and perform a graph call to the tabs on the page:
/<page_id>/tabs?auth_token=<auth token>
I get an empty "data" representation:
{
"data": [
]
}
Even though there are application tabs installed.
Add the tab_id makes no difference, I get the same response.
I'm guessing the page is getting confused as the account but I cannot find any way to distinguish the difference between the account and the page.
Does anyone know if it is possible to retrieve the page information another way?
Double-check that the access token you're using is the Page Access Token - this is the most likely reason this will fail to return an answer
When I use
https://graph.facebook.com/(userid goes here)/apprequests?access_token=(user access_token goes here)
it returns an empty JSON array like so:
{
"data": [
]
}
Even though there ARE app requests.
These people were having the same problem, but didn't get their question answered either:
http://forum.developers.facebook.net/viewtopic.php?id=106693
http://forum.developers.facebook.net/viewtopic.php?id=88253
What am I doing wrong?
I tried POSTing and GETing requests with the Graph API Explorer, and THEY don't return an empty JSON array (however they only return the app requests POSTed by Graph API Explorer, not the requests for my app....I imagine this is to be expected however). Could this have something to do with my app being in sandbox mode? Does /apprequests work for anyone else's sandboxed app?
A few weeks back (around mid-september 2011), it was possible to get the requests with https://graph.facebook.com/me/apprequests?access_token={user_access_token}.
It does not seem possible today anymore. This call returns an empty data structure now.
Instead, calling https://graph.facebook.com/{user_id}/apprequests?access_token={app_access_token} does seem to work.
apprequests connection expect an app access token.