Web Niraj
  • Facebook
  • Flickr
  • Github
  • Linkedin
  • Twitter
  • YouTube
Online portfolio, code examples and developer blog
  • About
  • Contact
  • Portfolio
  • WordPress
Search the site...
  • Home
  • Blog
  • Facebook API: Getting Friends Using Graph API 2.0 and PHP SDK 4.0.x

Facebook API: Getting Friends Using Graph API 2.0 and PHP SDK 4.0.x

104

With the introduction of the Facebook Graph API 2.0, access a user’s friends list was removed and limited to just friends who use the same application. However, Facebook added two new APIs to allow retrieval of Friend names (and indirectly a friend count). The two new APIs are taggable_friends and invitable_friends.

In order to make use of the new end-points (or even just to access the user’s friends list), your application must request the user_friends permission. This new permission was introduced as part of Graph API 2.0.

The New Endpoints

Taggable Friends

The taggable_friends API retrieves a list of friends that can be tagged by the user in stories. Not all friends will be displayed, but of the ones that appear, the API will return the a encrypted ID that can be used for tagging, their name and profile photo. The use of this end-point requires login review from Facebook.

Taggable Friends

Invitable Friends

The invitable_friends API is restricted to games and provides similar functionality to taggable_friends.

Retrieving Taggable Friends

You can retrieve taggable friends using the following code:

You can retrieve inevitable friends in a similar way if you have a Game application. Just replace the /taggable_friends in the API call with /invitable_friends.

Using Encrypted ID to Tag Friends

You can use the encrypted IDs from API call to then tag friends in stories (status updates or actions). You must include the place attribute as Facebook only allows friends to be tagged at location. However, if you use a page_id with no address, Facebook hide the location and create a normal status update.

The code above creates the following status update on Facebook:

Taggable Status Update

Facebook, Facebook Graph API, Facebook Graph API 2.0, Facebook PHP SDK 4.0, PHP

104 comments on “Facebook API: Getting Friends Using Graph API 2.0 and PHP SDK 4.0.x”

  1. nassuttiebastian says:
    June 18, 2014 at 7:53 PM

    How can I get my friend email? I’m using me/friends and I get only the name and the ID but not the email, and email permission was accepted by my friend.

    Reply
    • Niraj Shah says:
      June 18, 2014 at 8:58 PM

      It is not possible to retrieve the email addresses of friends from the API. Please read the documentation carefully for supported functionality. You can only retrieve the ID, Name and Picture for a friend – and you must use the ID to tag or invite friends as shown.

      Reply
  2. b0b0123 says:
    July 29, 2014 at 2:36 PM

    Hello, how come not all friends will be displayed? How does it know which friends to display/not display? Thanks 🙂

    Reply
    • Niraj Shah says:
      July 29, 2014 at 4:17 PM

      Not all friends are returned because of privacy settings – some friends may have disallowed tagging in status updates, so Facebook filters this out and gives you a list of friend that have allowed tagging.

      Reply
      • b0b0123 says:
        July 29, 2014 at 4:34 PM

        Ah, that makes sense. 🙂 thank you.

  3. b0b0123 says:
    July 29, 2014 at 4:11 PM

    Another question… where do you get the “friend id” to tag them on your status? I can’t see where $tag is in your first block of code…. So I am confused to how you managed to tag the friend: Hina Shah. On the facebook doc, the syntax used is: ‘tags’=>'[{\’tag_text\’: \’Testing\’}]’,

    Thank you 🙂

    Reply
    • Niraj Shah says:
      July 29, 2014 at 4:20 PM

      If you make the API call to taggable_friends, it will return the IDs, Names and Profile Pictures of friends that can be tagged. You can then create a comma separate list of IDs and add them to $tags. See the examples here.

      Reply
      • b0b0123 says:
        July 29, 2014 at 4:40 PM

        Hi, sorry the doc is a bit confusing for me… I am using /me/friends instead because I only want the list of friends who are also using the app. It returns their name and id… I want to get the id as a variable so that I can sub it into the tag parameter…. am I overcomplicating things?

      • Niraj Shah says:
        July 30, 2014 at 10:44 AM

        You won’t be able to tag friends if you’re using the /me/friends API call. The new /me/taggable_friends API call needs to be used for this.

      • b0b0123 says:
        July 30, 2014 at 10:26 AM

        Just got told off by someone on stackoverflow…. sorry if I am asking you too many questions, like I am expecting you to do all my work for me. I don’t mean to come across like that at all…..

      • Niraj Shah says:
        July 30, 2014 at 10:44 AM

        Not a problem. What was the question on StackOverflow?

      • b0b0123 says:
        July 30, 2014 at 11:18 AM

        I don’t know how to get the id from the print_r results… I get the error that I am converting an array to a string. PHP is really hard. I’m so confused now to what I am trying to do. But here’s the question. http://stackoverflow.com/questions/25018552/get-friend-id-using-facebook-api-to-tag-uploaded-photo

        The person who told me off because I was asking about their code that they gave – hoping to understand it more – has deleted their answer.

        I just want to let the user upload a photo and then they can see the list of friends to choose to tag in the pic. And then my app would match that friend to their id and then submit that id into the tag parameter to achieve the tag. Does that work?

        Sorry, I keep coming back to you. Your tutorials are good and you’re patient and nice 🙁

      • Niraj Shah says:
        July 30, 2014 at 12:36 PM

        Have a look at StackOverflow. I’ve provided you with a working answer, including tagging code.

  4. b0b0123 says:
    July 30, 2014 at 11:58 AM

    I understand stdClass a lot more now. But confused, the examples online only has 1 array in which they get the key from…. but with my output I have two arrays before I get to the stdClass…

    So something like this: echo $array[data] then something $array[0]->id; ??

    Reply
  5. b0b0123 says:
    July 30, 2014 at 12:21 PM

    Sorry for the spam! I got it: echo $taggable[‘data’][0]->id; I was using “array” before instead of taggable which was silly.

    Reply
  6. Kim says:
    August 4, 2014 at 3:56 AM

    Dude! this just saved my project!
    Thanks for posting!

    Reply
    • lalo says:
      January 16, 2015 at 7:58 PM

      can you help me ?

      Reply
      • Niraj Shah says:
        January 23, 2015 at 9:16 AM

        What do you need help with?

  7. Raza Abid Abbasi says:
    September 23, 2014 at 3:19 PM

    Poor question but hope you will help, i got class ‘FacebookRequest’ not found while copying and pasting your code above, i am logging in at another page and redirecting here where exception arises to get data using graph api

    Reply
    • Niraj Shah says:
      September 25, 2014 at 9:57 AM

      Make sure you are using Facebook PHP SDK v4.0.9 or v4.0.10, and follow this tutorial to setup the files you need to include.

      Reply
  8. Piyush Arora says:
    October 8, 2014 at 7:19 AM

    Thanks Niraj for the post. Is there a way to get bigger picture of taggable friends? By default, it gives image of size 50px.

    Reply
    • Niraj Shah says:
      October 8, 2014 at 11:23 AM

      Hi Piyush,

      Yes, getting a larger profile image can be achieved using the fields parameter. The below example will get a larger profile image:

      /me/taggable_friends?fields=id,name,picture.type(large)

      Reply
  9. kcode says:
    October 9, 2014 at 7:06 AM

    i do not understand the place value, how you get the place code 195383960551614

    Reply
    • Niraj Shah says:
      October 9, 2014 at 9:42 AM

      The 195383960551614 is the ID for a Facebook Page with an address. You can replace with with the ID of your own page.

      Reply
  10. raja sekhar says:
    October 14, 2014 at 12:05 PM

    do you any sample code to achieve this using javascript SDK

    Reply
    • Niraj Shah says:
      October 20, 2014 at 8:21 PM

      No sorry, but the API calls for the JavaScript SDK are the same.

      Reply
  11. Peter says:
    October 23, 2014 at 1:20 PM

    Hello Niraj,
    I am a non-tech person aso excuse for my simple question.
    So basically what this means is that if you develop an app that is not classified as a social game, users can not invite their facebook friends unless they already downloaded and signed up for that app?
    Thanks for your time!

    Reply
    • Niraj Shah says:
      October 24, 2014 at 11:37 AM

      Yes, if you don’t classify your app as a game, you cannot invite users. You will need to rely on another mechanism, like Sharing to Facebook, email invites etc.

      Reply
  12. princeton says:
    October 24, 2014 at 5:52 AM

    to use the taggled friends, do I need to request a permission? If so, what should I do? Thanks.

    Reply
    • Niraj Shah says:
      October 24, 2014 at 11:39 AM

      If you visit the App Review Submission page, there is a checkbox to request Review of the taggable_friends endpoint. The screenshot of this screen is included in my article – you can clearly see the option required review.

      Reply
  13. joehamir balabadan says:
    October 31, 2014 at 5:13 AM

    Hi niraj,

    Thanks again for the code, I have question..

    How to display name using foreach..
    here is my code..

    $taggable = (new FacebookRequest( $session, ‘GET’, ‘/me/taggable_friends’ ))->execute()->getGraphObject()->asArray();
    foreach ($taggable as $friends) {
    shuffle($friends);
    foreach ($friends as $friend) {
    $id = $friend[‘id’];
    $name = $friend[‘name’];
    echo $name;
    echo “”;
    }
    }

    This is the error:

    Fatal error: Cannot use object of type stdClass as array in this line foreach ($friends as $friend) {

    Thanks,
    Joe

    Reply
    • Niraj Shah says:
      October 31, 2014 at 10:35 AM

      The error is in your foreach statement. Change it to: foreach ( $taggable['data'] as $friends )

      Reply
  14. joehamir balabadan says:
    October 31, 2014 at 10:29 AM

    I fix my first problem..

    But i now encounter new problem..

    This is the error:

    Fatal error: Uncaught exception ‘FacebookFacebookPermissionException’ with message ‘(#200) The user hasn’t authorized the application to perform this action’

    Thanks..

    Reply
    • Niraj Shah says:
      October 31, 2014 at 10:36 AM

      It looks like you’re trying to access something without asking the user to login. Get the user to login first and then try again.

      Reply
  15. joehamir balabadan says:
    October 31, 2014 at 11:11 AM

    the user is already login.. i also have another problem.. my app is not displaying in facebook.. this link that i want to display in my app.. http://joehamirbalabadan.com/mosbeaubff/

    Reply
    • Niraj Shah says:
      November 3, 2014 at 10:29 AM

      Check your Facebook settings and make sure your Canvas URL is correct. Also, make sure you end the URL with a /. Also, make sure you have set a Namespace too.

      Reply
  16. suraj gupta says:
    November 17, 2014 at 4:34 AM

    Please consider these Scenario. Graph api 1.0

    We are able to get friends ids e.g. “124578992” while using me/friends in Api 1.0 we were able to perform reward system to our app user on each invitation lke below

    1-UserA sent facebook invitation to UserB to install app . 2-We perform a query and store UserA id as sender id and user B id as recipient id, in our DB . 3-When User B click on Facebook notification it opens a canvas page with 2 buttons Accept or Reject 4-While accept we Detect user B id and update our Db and reward UserA with some coins

    Graph api 2.0 is giving Encrypted ids which is dynamic and getting change on Every request

    Please advise 1-how to perform same with Facebook api 2.0 2-Is there any other way to uniquely identify our friends which always remain static.

    Thanks.

    Reply
    • Niraj Shah says:
      November 19, 2014 at 9:05 AM

      When you send a invite, facebook generated a request_id. This will contain information on who the invite was sent to. What you should do is ask User B to login to your application in the Invite and then check to see if the ID matches the Request they came from (save it in a cookie). The “From ID” won’t change as the sender would have been part of your application, so you can link it back easily (even if the TO ID changes).

      Reply
    • suraj gupta says:
      November 24, 2014 at 11:11 AM

      Yes,we are able to get request id but it will not work if inviting more that one friends.
      now only issue is that getting same request id while inviting multiple friends

      Reply
      • suraj gupta says:
        November 24, 2014 at 11:19 AM

        Using same request id how we will differentiate user

      • Niraj Shah says:
        November 24, 2014 at 11:24 AM

        You need to get the person accepting the request to Login first, so you can obtain their User ID. Then you can link it back to the Inviting user via the Request ID and award them coins. The Request ID will be different between different users so it will work.

      • Niraj Shah says:
        November 24, 2014 at 11:23 AM

        Yes, you will get the same request ID when inviting multiple friends. But remember, you are only interested in who sent the request. Once the user is authenticated, you can link it back to the Inviting user to award them coins.

  17. joehamir balabadan says:
    November 17, 2014 at 5:24 AM

    Hi Niraj,

    I have some rush question..
    What if the user is already logged in in facebook and visit my page and app..
    How to get session and the user info?

    Thanks,
    Joe

    Reply
    • Niraj Shah says:
      November 17, 2014 at 9:21 AM

      You can use the JavaScript SDK to detect if the user is already logged in and authorised to use your application, or you would need to ask them to login in again using the PHP SDK.

      Reply
  18. joehamir balabadan says:
    November 17, 2014 at 8:19 AM

    Hi Niraj,

    How to limit display of taggable_friends?
    Example i only want to display 100 only..

    Thanks,
    Joe

    Reply
    • Niraj Shah says:
      November 17, 2014 at 9:19 AM

      Add ?limit=100 to the end of your API call.

      Reply
      • joehamir balabadan says:
        November 17, 2014 at 10:43 AM

        thanks.. i already fix this.. i use break..

      • Niraj Shah says:
        November 19, 2014 at 9:07 AM

        Using limit is better, as the API will return data quicker (due to smaller response).

  19. thanhpd says:
    November 22, 2014 at 5:21 PM

    I’ve looked around and this is the closest answer I can get, thank you very much!
    Also, can I tagged friends in a comment in posts of a group?
    Yes, I did search and it said only be able to tag page-id. However, I wonder about it since there are quite plenty of spam auto tag friends in group apps. If not, can you please suggest me what to do with this thing: I want to do a small tool to auto tag each group member everyday in a comment in a specific post to tell his/her job. Thanks!

    Reply
    • Niraj Shah says:
      November 25, 2014 at 10:00 AM

      Yes, tagging people in groups is possible, but they need to be a friend in order to get the taggable ID. You can make a API call to: https://graph.facebook.com/{group_id}/feed?message=Your+message&place={some-page_id-with-no-place}&tags={comma-separated-list-of-tags}

      Reply
      • thanhpd says:
        November 25, 2014 at 1:28 PM

        That API calls is for tagging friends in a new post in group, right? Then how about tagging friends in a comment in a specific post in a group? One post per day in the group might be spammy, I think comments will be better. Can you help?

      • Niraj Shah says:
        December 1, 2014 at 4:55 PM

        According to the Facebook Documentation, it’s not possible to tag people in comments.

  20. MonMon says:
    December 12, 2014 at 12:14 PM

    Very helpful, thanks for posting!

    Reply
  21. MonMon says:
    December 30, 2014 at 8:26 AM

    Hi Niraj Shah,

    This tutorial help me alot. But i can’t understand, some account get successful list friend on first time, but second time it’s can’t get this list.
    And now, except me, another account facebook can’t get list friend of ‘/me/taggable_friends’. (All of them are administrator of my app).
    Please help me,

    Tks & Rg,

    Reply
    • Niraj Shah says:
      December 30, 2014 at 1:09 PM

      Are you authenticated each time you make the API call, and are the other administrators authenticated too? Also, you need to ask for the user_friends permission for the API call to work.

      Reply
      • MonMon says:
        January 5, 2015 at 8:08 AM

        Hi Niraj,

        My scope without ‘user_friends’ :(.
        I fixed it. Thanks alot.

  22. PK Tan says:
    January 2, 2015 at 6:16 AM

    Hello Niraj,

    I use your code on test app and working fine. I want to put into cron job and post one listing at a time to my fan page.

    Because I want to post to my own fan page, there is no facebook login, redirection, call back url etc.

    How to get this app approved by facebook team? They are not able to test the script.

    Reply
    • Niraj Shah says:
      January 2, 2015 at 4:14 PM

      If you are using it for yourself then you don’t need to get the app approved / reviewed. The review process is only if you want the additional permissions available to end-users.

      Reply
  23. greencastle says:
    January 27, 2015 at 3:32 AM

    I have been reading the same answers to these facebook friends list questions saying it is not possible. But when looking at some web applications, such as https://www.cloudsponge.com/test-drive, it seems that there’s a way to retrieve the user’s friends data (ids or url) without having to go through the apps-game-must-have or taggable_friends only solution. Can someone tell me how they achieve this ? Do the app needs to have some special approval ?
    If you take a close look to the mentioned-above link the scope for which the app requires permissions includes only email.

    Reply
    • Niraj Shah says:
      January 27, 2015 at 9:12 AM

      Yes, this application *appears* to be accessing friends without the needed permissions, but there is a simple reason for this. The application is still using the old Graph API (v1.0), which doesn’t have this restriction on friends (note that all friends were retrievable in Graph API v1.0, and usernames were accessible too). The app won’t work after April 30th 2015, unless it uses the new methods described in this article.

      Either way, you must use the new methods described in this article if you want your application to work after April 2015.

      Reply
      • greencastle says:
        January 27, 2015 at 12:33 PM

        Humm, that would explain. But I did try as well calling graph.facebook.com/v1.0/… but didn’t work neither. May be I was not including the right scope for that. Any idea on which scope-endpoints is required to make it work. I understand its going to work momentarily but would like to run some tests anyway. Thank you!

      • Niraj Shah says:
        January 27, 2015 at 2:17 PM

        If your app was created after April 2014, you won’t have access to Graph API v1.0, so it won’t work. You’ll need to have access to a older app for v1.0 of the API to work. You won’t even need the user_friends permission for these older Apps – you should be able to get friend information directly…

  24. Federico Ribis says:
    February 17, 2015 at 5:09 PM

    Hey, Thank you for the post…. I have a big problem to get a list of the friends who use the same app… what request I should ask in facebook API? thank you very much

    Reply
    • Niraj Shah says:
      February 19, 2015 at 5:14 PM

      You need to make a API call to /me/friends.

      Reply
  25. Sagar says:
    February 24, 2015 at 6:17 PM

    sir, can you provide a servlet code to access friends using me/taggable_friends….i dont have any idea about php…….

    Reply
    • Niraj Shah says:
      February 27, 2015 at 9:42 AM

      Sorry, I don’t do Java so you’ll have to translate the PHP code yourself.

      Reply
  26. ashish6586Ashish says:
    February 25, 2015 at 10:25 AM

    Hi Niraj,
    I wanted to ask if the id of the friends returned by the API call to /me/friends remains the same across different users or does it change. Like ‘A’, ‘B’ and ‘C’ are mutual friends. Will the id differ from when ‘A’ calls the API and when ‘B’ calls the API for the friend ‘C’.

    Reply
    • Niraj Shah says:
      February 27, 2015 at 9:49 AM

      I have tested this myself, and Friend IDs will match back to the scoped User ID of the same user. If all three users have a mutual friend, their User ID will be the same across all three.

      Reply
  27. shithin says:
    March 16, 2015 at 6:20 AM

    Hai Niraj,
    I tried to fetch facebook friendlist with access token with php and javascript as well, in both way returns empty data array, it just list the count of my friends. how to slove this issue?Would U plz help..

    Reply
    • Niraj Shah says:
      March 16, 2015 at 10:12 AM

      Are you asking for the user_friends permissions as the article says?

      Reply
  28. Khim says:
    March 21, 2015 at 1:13 AM

    How to filter the taggable_friends? For example i only want to see close friends or female friends. Please help.

    Reply
    • Niraj Shah says:
      March 26, 2015 at 9:49 AM

      You cannot filter this list – the API endpoint doesn’t provide information on gender or who a “close friend” is.

      Reply
  29. André Gonçalves says:
    March 30, 2015 at 6:50 PM

    Hi Niraj,
    Can you tell me if there’s another way to retrieve user friend’s location, rather than read_stream? It seems that this particular permission will not be allowed after April 2015…

    Reply
    • Niraj Shah says:
      April 7, 2015 at 8:52 AM

      There used to be a permission called friend_location, but that has now been removed. The only way to retrieve friend location now is to look for tagged locations in the stream.

      Reply
      • André Gonçalves says:
        April 7, 2015 at 4:44 PM

        Thank you Niraj. I believe the read_stream permission will be to most apps (except Facebook branded ones), so it seems that such features will end in a few weeks…

  30. Bayu Indra says:
    April 24, 2015 at 4:04 AM

    Hi Niraj, can you tell me how to get the amount of friends tagged on a shared post? For example I shared an article and tagged 10 friends. How do the website get that 10 amount friends tagged?

    Sry for poor english

    Reply
    • Niraj Shah says:
      April 27, 2015 at 7:42 PM

      If you call the API with the ID of the Shared Post, you can see who was tagged in the “tags” object – e.g. /{post_id}. You can also just request the tags by doing /{post_id}/tags.

      Reply
  31. missionenglish1 says:
    July 2, 2015 at 7:25 AM

    Hi. How can I use this to count the number of friends a user have?

    Reply
    • Niraj Shah says:
      July 10, 2015 at 5:01 PM

      If you make a API call to /me/friends, the response will contain the total number of friends under summary->total_count:

      {
        "data": [
        ],
        "summary": {
          "total_count": 999
        }
      }

      Reply
  32. onlinepch says:
    July 10, 2015 at 3:18 PM

    Hi, Niraj
    Thanks for the post.

    This is how I get my friends name
    for ($i=0; $iname;
    }

    I try go get ‘/me/taggable_friends?fields=id,name,picture.type(large)’, can’t get only picture url, can you help me.

    Reply
    • Niraj Shah says:
      July 10, 2015 at 4:59 PM

      The API call you are making is correct. But the picture is an object, so to get the URL, you need to do: picture->data->url.

      Reply
      • onlinepch says:
        July 13, 2015 at 8:37 AM

        Offf, sorry, I get it, I’m just missed one ‘->’
        So the row finaly is ‘$taggable[‘data’][$i]->picture->data->url’
        Thank, you for the post and help, cheers !

  33. Stefu Catalin says:
    August 2, 2015 at 6:19 PM

    With this, i can select one friend random, eventually by gendre? I have problem with this item for aproval,fb dosen’t accept for first, i will try again, with new template. Thank’s !

    Reply
    • Niraj Shah says:
      August 14, 2015 at 7:58 PM

      You can’t randomly select a friend using an API call. But if you get all the user’s friends, then you can always use PHP to pick a random friend. The API call doesn’t return Genders, so you can’t do this either.

      Reply
  34. Ankit Saini says:
    August 21, 2015 at 12:51 AM

    Hello Niraj

    Thank you so much for writing this code.

    I want to ask something. When I’m using this me/invitable_friends?fields=id,name,picture.type(large) .
    I am getting this error
    Array
    (
    [error] => Array
    (
    [message] => An active access token must be used to query information about the current user.
    [type] => OAuthException
    [code] => 2500
    )

    )

    Full code I’m using is.
    $fb -> access_token = “access_token=” . $token;
    $friends = $fb -> get(“me/invitable_friends?fields=id,name,picture.type(large)”, true);
    echo ” . print_r( $friends, 1 ) . ”;

    Thank You so much.

    Reply
  35. Ankit Saini says:
    August 21, 2015 at 1:40 PM

    Hello Niraj,

    I solved my problem myself.
    Thank you again for this wonderful code .

    Thank You

    Reply
  36. Manav Mehta says:
    September 4, 2015 at 1:10 PM

    Hi Niraj,

    How do I get a list of only male or female friends of the user?
    Can I use the taggable friends call to get the friend list and then get each persons gender using the id?

    Reply
    • Niraj Shah says:
      September 4, 2015 at 7:13 PM

      You cannot filter by gender or get the friend’s gender using the taggable_friends API.

      Reply
  37. sasa says:
    January 6, 2016 at 6:50 AM

    You cannot filter by gender

    Reply
  38. Johannes says:
    January 27, 2016 at 3:23 PM

    Hi Niraj,

    thank you for this great post.

    We want to build a quiz like this http://en.blobla.com/bla/who-is-in-your-love-triangle with profileimages from friends. How can we get this data? Facebook rejected our query for “taggable friends” with this comment: “In API v2.0+ you can only retrieve information on friends who also use your app. Only use Taggable Friends to tag people in relevant content. Using Taggable Friends for any other purpose won’t be approved.”.

    We don’t know what to do. We would very thankful for help.

    Thank you

    Regards
    Johannes

    Reply
    • Niraj Shah says:
      February 1, 2016 at 11:16 AM

      You will need to build in tagging functionality into your app so you can get this permission approved by Facebook. It’s the only way Facebook will approve the use of this API – annoying, I know!

      Reply
      • Yeltsin Reyes ElPerrys says:
        May 6, 2016 at 1:17 PM

        To make this: http://en.blobla.com/bla/who-is-in-your-love-triangle must be working on canvas?

        taggable_friends or invitable_friends information can not be used of for other purposes how to create dynamic images?

        Some pages that you use this:
        http://vonvon.me
        http://pandacat.me/

        and other!!

        Greetings, I hope your answer

      • Niraj Shah says:
        May 6, 2016 at 2:19 PM

        The taggable_friends API returns the profile image for friends, so you can use this API to create a dynamic image of friends. However, to get the permissions approved by Facebook, you should use the permission to also tag friends (it’s intended purpose).

  39. Geetha says:
    April 21, 2016 at 6:33 AM

    hi,me/friends does not return friends details.Pease help me

    Reply
    • Niraj Shah says:
      May 6, 2016 at 2:11 PM

      The /me/friends API call will only return friends that have the app installed. If you are not seeing any data, none of your friends have installed the app.

      Reply
      • Yeltsin Reyes says:
        May 7, 2016 at 1:15 AM

        My goal is to create a page like this: http://en.vonvon.me/quiz/1623 and get the photo and name of the user’s friends who would use the app in web page.

        which permission recommended me taggable_friends or invitable_friends ??

      • Niraj Shah says:
        May 11, 2016 at 12:27 PM

        Like I said above, you can use the taggable_friends permission to achieve this.

  40. Ankit says:
    June 12, 2016 at 10:13 AM

    i had added taggable_friends permission and i retrieve login users friend list but when i login with email id then facebook gives me list of friend but when i login with mobile no then it’s gives me blank array. so can you help me why this happend.

    Reply
    • Niraj Shah says:
      June 17, 2016 at 12:31 PM

      Sounds like a bug with Facebook. Are you trying to login with the same account each time (i.e. one using email and one using mobile number for same account)? If that’s the case, its most likely a bug. You should report it to Facebook.

      Reply
  41. Marcel Kraan says:
    February 13, 2017 at 12:12 PM

    Is it possible to get the id(homepage) of a friend (taggable_friend) i like to ahref his image to a link.. Do you understand?

    Reply
    • Niraj Shah says:
      February 13, 2017 at 3:36 PM

      You can’t get the friend’s ID using taggable_friends. It was previously allowed, but was removed due to developers abusing this.

      Reply
      • Marcel Kraan says:
        February 13, 2017 at 3:40 PM

        Thanks … it’s not a nice action from facebook 🙁

  42. Faysal Imtiaz says:
    September 11, 2017 at 2:37 PM

    When I send a request from JavaScript api to get list of taggable friends. I got the response but the friends IDs are long string . What are they? How to get the original user id ?

    Reply
    • Niraj Shah says:
      September 13, 2017 at 7:07 PM

      This is the correct behaviour. Facebook no longer allows you to get the real User IDs via the API. You can use the long strings in place of the User IDs to tag friends.

      Reply

Leave a ReplyCancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

StackExchange / StackOverflow

profile for Niraj Shah on Stack Exchange, a network of free, community-driven Q&A sites

Support Me

Buy Me a Coffee

PSN Profile

Tags

ACL Amazon Web Services Android Android 4.4 KitKat Android 5.0 Lollipop Apache Backup Bash Bug Command Line Cordova cPanel / WHM Facebook Facebook Graph API Facebook PHP SDK 4.0 Facebook Social Plugins Fan Page Flash Geolocation Google Nexus 5 Hacking HTML5 Input Sanitization iOS JavaScript jQuery Laravel 5 Laravel 5.2 Linux Mac OS NodeJS Parse PDF PHP Plugin Portfolio Review Security Server SSH SSL Sysadmin Tutorial WordPress WordPress Plugins
© 2011-2025 Niraj Shah
  • Blog
  • Portfolio
  • WordPress
  • About Me
  • Contact Me
  • Privacy Policy
Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Privacy Policy