Facebook Graph API - get friends info

前端 未结 6 546
盖世英雄少女心
盖世英雄少女心 2020-12-31 23:40

I\'m trying to figure out how to get users friends information using either Graph API or FQL

Just for testing I would like to get my friends education_histroy<

6条回答
  •  生来不讨喜
    2021-01-01 00:14

    I've been wrestling with this all day myself and I believe I have figured it out, nowhere in facebook documentation (that I have found) is this clear. And I don't believe the other answers actually answered your question, it looks like you requested permissions correctly. Anyway, to request the information you are looking for, ping the api like this:

    https://graph.facebook.com/userid/friends?fields=work&access_token=ACCESSTOKENHERE
    

    This will return you all the friends' info in one long JSON response.

    It is a little confusing because the permissions you are asking for are not the same thing you need to query the API.

    The query above will return the friends' ids with work history. You can add commas to the fields parameter to include additional info like name, but then the API calls/responses end up taking a long time.

提交回复
热议问题