3

About 2% of the time, a user authorizes my Facebook App and with a valid access token, I call Facebook's Graph API only to get back the value "false" instead of a JSON representation of user information. For example:

https://graph.facebook.com/{user_id}?access_token={user_access_token}

--> returns "false"

I can't seem to reproduce the problem myself. My problem may be related to this answer: http://facebook.stackoverflow.com/questions/5085957/facebook-graph-api-returns-false-for-page-accounts/6595465#6595465

but I can't access my App when I'm logged in as a Page as the answer above suggests, so I have no way to verify whether my problem is the same or not.

Any suggestions?

UPDATE (2011-09-29)

It turns out that this problem happens whenever a user does not have a completed profile. You can reproduce this problem by first logging out of Facebook then creating a Facebook Page here:

http://www.facebook.com/pages/create.php

During the Page creation process, Facebook will ask you to log in with an existing account or create a new one. If you create a new one, Facebook will create a user account for you, but the user account will not have a completed Profile. So instead of Facebook's API providing the information they do have about the user (i.e. the info that it collected during the sign-up process), it returns false. Once the user "Creates a Profile", then Facebook's API will return the proper user graph.

What Facebook looks like when the user doesn't have a Profile.

Johnny Oshika
  • 54,741
  • 40
  • 181
  • 275
  • I've seen this problem when calling `https://graph.facebook.com/me?access_token=foo`, but only occasionally. I was unable to reproduce it with the automatically created user approach that you described. Since I don't have the facebook user id when it happens, it's not necessarily easy to figure out how to contact the user to see if their facebook account is in some odd state. I hope someone can shed some light on this. – ʇsәɹoɈ Apr 24 '12 at 21:22
  • Did you create the user account with absolutely minimal amount of information that Facebook requires? – Johnny Oshika Apr 24 '12 at 23:29
  • IIRC, the only thing I entered was an email address. – ʇsәɹoɈ Apr 25 '12 at 20:15

2 Answers2

1

Facebook returns JSON representation of data for a {user_id} (as per your usage) when that user id is either a Profile ID, App Id or Page ID

false is returned when it is neither of the three.. There is something wrong with the {user_id} that you are using. You should log the ids for which you get this error and try making a graph call to then like http://graph.facebook.com/{user_id}.. if this again returns false you will be sure of the fact that it is a wrong id ,,

mjs
  • 657
  • 7
  • 14
1

The 'false' return almost always means you're trying to access a piece of content that the current user (or page, app, etc depending on your access_token) has no permission to view.

If you're definitely calling /{user_id}, with a user access token, it's most likely that either the user has Platform disabled, or the user has the session user blocked.

Igy
  • 43,710
  • 8
  • 89
  • 115
  • Thanks @Igy. I've got a call with a user who's experiencing this problem using my app. Can you please advise how I can check if that user has platform disabled or session user blocked? I'm hoping that the user will share her screen with me as we try to diagnose this problem. – Johnny Oshika Sep 21 '11 at 23:37
  • If they can use like buttons on third party sites, they don't have platform disabled, not sure how to diagnose if they've blocked the app but i think there's a dialog if they try to enter your app and have it blocked prompting them to unblock it – Igy Sep 22 '11 at 11:21