Get user profile picture by Id

后端 未结 15 2539
闹比i
闹比i 2020-11-27 10:08

I\'m now working on a web application which is mostly based of facebook graph api. I hold some data about users - actually , the possible public data available - such as nam

15条回答
  •  甜味超标
    2020-11-27 10:50

    As per the current latest Facebook API version 3.2, For users you can use this generic method for getting profile picture is https://graph.facebook.com/v3.2/{user-id}/picture?type=square you can visit documentation for user picture here. The possible values for type parameter in URL can be small, normal, album, large, square

    For Groups and Pages, the profile picture is not available directly. You have to get them using access token. For Groups you have to use User Access Token and for Pages you can use both User Access Token and Page Access Token.

    You can get Group's or Page's Profile Picture using the generic URL: https://graph.facebook.com/v3.2/{user-id}/picture?access_token={access-token}&type=square

    I hope this is helpful for people who are looking for Page or Group Profile picture.

提交回复
热议问题