25

I'm looking for a user.setImage call or something to that effect on the Facebook API but I can't see anything to achieve this: specifically to overwrite a user's profile image (not just post an image on their wall).

I can't see anything in the docs. Do you know if this is possible and if so any docs on implementing it?

Alexis Wilke
  • 19,179
  • 10
  • 84
  • 156
thruflo
  • 668
  • 1
  • 7
  • 9
  • 1
    This is a duplicate of [How to set a Facebook profile picture using the Graph API](http://stackoverflow.com/questions/4306786/how-to-set-a-facebook-profile-picture-using-the-graph-api/5431751#5431751), answered by [Fredrik](http://stackoverflow.com/users/87750/fredrik) – Owen Blacker Jul 13 '11 at 16:11
  • I know it's an old question, but it would be nice if you could mark as answered. Thanks! – Hannes Aug 26 '14 at 13:39
  • Possible duplicate of [how to set a facebook profile picture using the graph api](https://stackoverflow.com/questions/4306786/how-to-set-a-facebook-profile-picture-using-the-graph-api) – fredrik Jul 31 '17 at 12:56

6 Answers6

41

You can redirect the user to the following link where [PID] stands for the id of the desired picture:

http://www.facebook.com/photo.php?fbid=[PID]&makeprofile=1

On this page the user will see the picture and immediately be prompted with a dialog if he wants to set it as his profile picture.

Alexis Wilke
  • 19,179
  • 10
  • 84
  • 156
Hannes
  • 3,752
  • 2
  • 37
  • 47
  • 1
    great answer!!! i have 2 questions now: is there any posibility to avoid the cut-out-process (another parameter?) and do you have such a link for the title picture fanpages? – Joergi May 14 '12 at 16:15
  • 2
    as far as i know there is no way to skip the cut-out-process. you should be able to change the cover photo of a page, just take a look at the documentation http://developers.facebook.com/docs/reference/api/page/ (search for "Setting a Cover Photo") - i didn't try it though. – Hannes May 31 '12 at 10:43
  • 2
    but it wouldn't work if it is opened from mobile devices... the crop and set as profile pic button simply don't show up as if the makeprofile=1 param is ignored – Zennichimaro Jun 13 '13 at 02:04
  • this was working for me about a month ago, but it seems it no longer works. maybe they changed something. – DAB Apr 24 '16 at 01:48
13

No, you cannot.

From the photos.Upload documentation:

However, you cannot upload to a user's profile picture album.

Community
  • 1
  • 1
Portman
  • 31,785
  • 25
  • 82
  • 101
5

Checkout my answer in this thread: how to set a facebook profile picture using the graph api

You can't set the profile picture, but you can upload it to an album, and then send the user to the "make profile picture"-page for that picture.

Community
  • 1
  • 1
fredrik
  • 13,282
  • 4
  • 35
  • 52
3

There must be a hidden API because the iphone facebook app does it... Maybe you can discover how by setting a proxy between an iphone and Facebook and decipher it... or the API may be restricted to only Facebook's own apps...

Alexis Wilke
  • 19,179
  • 10
  • 84
  • 156
1

Well it seems there's a way now with a new framework extension: https://developers.facebook.com/docs/profile-expression-kit/ios#uploading

LolaRun
  • 5,526
  • 6
  • 33
  • 45
1

You can upload an image, but you CAN'T set it as one's profile picture. So, the user has to set it as their profile picture themselves. You have to redirect them to the permalink of the uploaded image.