facebook getting user id from graph api via taggable_friends

前端 未结 5 763
死守一世寂寞
死守一世寂寞 2021-02-07 02:12

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

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


        
5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-07 03:04

    You need to request for "user_friends" permission while creating access token for that user.

    After that you can make a call to graph API:

    https://graph.facebook.com/v2.0/me?fields=friends
    

    and it will return the results in following format:

    {
      "friends": {
        "data": [
          {
            "name": "Dummy1",
            "id": "454####455"
          },
          {
            "name": "Dummy2",
            "id": "82####374"
          },
          {
            "name": "Dummy3",
            "id": "10###7277"
          },
    
        ]
      },
      "id": "14###1568"
    } 
    

提交回复
热议问题