moondaisy
moondaisy

Reputation: 4491

Request Facebook profile picture with other information

I'm using the js SDK and after the user has login in with FB I want to request the email, first name, last name and picture (a link to the picture).

This works:

FB.api('/me?fields=email,first_name,last_name',
  (graph_response) ->
    ...
)

This also works, but the picture I get is super small (the same one that if I request type=square at /me/picture):

FB.api('/me?fields=email,first_name,last_name,picture',
  (graph_response) ->
    ...
)

I know I can get a larger profile picture (big enough) doing this call:

FB.api('/me/picture?type=large&redirect=false',
  (graph_response) ->
    ...
)

Is there a way I can combine both in just one request? I have tried /me?fields=email,first_name,last_name,picture&type=large with no luck.

Upvotes: 0

Views: 80

Answers (1)

andyrandy
andyrandy

Reputation: 74014

This works:

/me?fields=email,first_name,last_name,picture.type(large)

Alternatively, you can specifiy the sizes:

/me?fields=email,first_name,last_name,picture.width(100).height(100)

More information: https://stackoverflow.com/a/27006154/757508

Upvotes: 1

Related Questions