Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get username field in Facebook Graph API 2.0

The "old" Facebook Graph API had a "username" field which could be used to create a human-readable profile URL. My username for example is "sebastian.trug" which results in a Facebook profile URL http://www.facebook.com/sebastian.trug.

With Graph API 2.0 Facebook has removed the "username" field from the user data as retrieved from "/me".

Is there any way to get this data via the 2.0 API or is the "username" now being treated as a deprecated field?

like image 522
trueg Avatar asked May 02 '14 12:05

trueg


People also ask

How do I get my Facebook Graph API User ID?

The simplest way to get a copy of the User Profile object is to access the /me endpoint: FB. api('/me', function(response) { }); This will this will return the users name and an ID by default.

How do I find Facebook user data?

You can get user data by using the Facebook Graph API if the user has given their permission to share their data and your app has the appropriate permissions to receive this data. This topic shows you how to make a single request for data and how to have a batch of requests in a single request.

How to get Facebook login user information using Graph API?

So here is the complete step by step tutorial for Android Get Facebook Login User Information Using Graph API Android Studio Example Tutorial. 1. Create a fresh project in Android Studio. 2. After done creating project open developers.facebook.com . 3. Login with your Facebook ID. 4. After successfully login Click on Create App button. 5.

Can My Apps get the API Token from the user?

Apps using older versions of the API can get this field until January 8, 2019. Apps installed by the User on or after May 1st, 2018, cannot get this field. A token that is the same across a business's apps.

How to create Facebook app ID?

Login with your Facebook ID. 4. After successfully login Click on Create App button. 5. Enter Application display name and your contact email address . Then click on Create App ID . 6. At front of Facebook Login click on Get Started. 7.

What fields are required when uploading a schema to Facebook?

App ids used by the users being uploaded. This field is required when schema is a Facebook UID and the IDs were collected by an App integration. e.g. [1234,5678] Page ids used by the users being uploaded. This field is required when schema is a Facebook UID and the IDs were collected by a Page webhook integration. e.g. [1234,5678]


Video Answer


2 Answers

Facebook got rid of the username because the username is one way of sending emails via Facebook.

For example, given the url http://www.facebook.com/sebastian.trug

the corresponding Facebook email would be [email protected]

which, if emailed, would be received to messages directly (if the message setting is set to public), otherwise to the other inbox.

like image 95
Nico Zarris Avatar answered Oct 07 '22 02:10

Nico Zarris


The username field of the User object has been removed, and does not exist in Graph API v2.0. In v2.0 of the API is there is no way to get the FB username of a user.

Source: https://developers.facebook.com/docs/apps/changelog#v2_0_graph_api

"/me/username is no longer available."

like image 26
Simon Cross Avatar answered Oct 07 '22 03:10

Simon Cross