How to get user's username in v2.0 or later of Facebook's Graph API

joaopribs picture joaopribs · May 4, 2014 · Viewed 22.7k times · Source

I used to get the user's username in the API 1.0 fairly easily, using /me and getting the username property of the response object.

Now I'm getting this error with API 2.0:

"(#12) username is deprecated for versions v2.0 and higher"

The only way I found to get this until now was to use FQL, but now it seems deprecated.

Is there a way around this?

Answer

giff picture giff · May 7, 2014

I don't mean to be unhelpful, but it appears access to username has been removed from the API, as far as I can tell. Places where an app may have been using username, such as in the old share dialogs, can no longer do that when used with the 2.0 API. I think its also a way of preventing apps from having access to usable unique identifiers outside of the app scope - any user IDs you retrieve under 2.0 API are specific to your app alone.