Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

facebook getting user id from graph api via taggable_friends

Tags:

In v1.0 API I was able to get friends with their facebook ID like this:

{
      "name": "Somename SomeSurname", 
      "id": "100007797060798"
 }

In the v2.0 I can use only taggable_friends to get this information, however `i must have missed something in the documentation, because the id I'm getting is like this (id is always different):

{
      "id": "AaKJ-QN8OlY3m-2DHeVnc5oQZFnx_V0ptUF8XFEstr3EcS1LltvAx0_xptve3DWc_vI1zP0s4RhVMOTk1EqDvzCHMkEqFRMIkuXtyXe5d9O1-Q", 
      "name": "Somename someSurname"
}

can someone point me where I can retrieve a real ID out of this?

like image 812
webduvet Avatar asked May 21 '14 13:05

webduvet


People also ask

What data can you get from Facebook Graph API?

With the Facebook Graph API, you can access a wide range of user data, including user information such as name, email address, birthday, and friends list in JSON. You can also access information about pages that a user has liked or engaged with on Facebook, as well as events and photos that they have posted or shared.

How do I find Facebook user information?

You can review your information on Facebook (such as recent activity) from the Your Facebook Information section of your Facebook Settings. Tap in the top right of Facebook. Scroll down and tap Settings. Scroll down to Your Facebook Information and tap the information you want to review.


2 Answers

There is no way to get to id via taggable_friends endpoint.

https://developers.facebook.com/docs/apps/upgrading

like image 134
Jonas Liljestrand Avatar answered Oct 01 '22 11:10

Jonas Liljestrand


/me/taggable_friends shows all friends in the list except for some. In one case, there are 326 friends in a profile but this only shows 317 and in another profile there are 194 friends in total but it only shows 182.

$flist = $fb->api('/me/taggable_friends?fields=name,id&limit=1000');

shows almost all friends in the list (despite the limit being too high) but leaves some of them in both cases. This might not work on the api explorer if your app is not approved and published but it will work for admins, testers and developers of your application.

You cannot decode this id because that would defeat the purpose of encoding it in the first place.

What I am also wondering is that whether it is possible to invite friends of a user to use the application?

like image 36
Robot Boy Avatar answered Oct 01 '22 09:10

Robot Boy