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?

3

6 Answers 6

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.

4
  • 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, 2012 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 developers.facebook.com/docs/reference/api/page (search for "Setting a Cover Photo") - i didn't try it though.
    – Hannes
    May 31, 2012 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 Jun 13, 2013 at 2:04
  • this was working for me about a month ago, but it seems it no longer works. maybe they changed something.
    – DAB
    Apr 24, 2016 at 1:48
13

No, you cannot.

From the photos.Upload documentation:

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

0
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.

2
  • If the question is a duplicate, you should add a link to the original in the comments section of the question. Jun 11, 2011 at 0:15
  • Makes sense! Will do that next time!
    – fredrik
    Jun 11, 2011 at 12:34
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...

2
  • 6
    The iPhone app authenticates with the users email & password, not via the Graph API. Apr 26, 2011 at 9:50
  • I would hope that the API used to log you in is encrypted so your proxy won't help much, I think. Aug 6, 2016 at 18:57
1

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

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.

1

Not the answer you're looking for? Browse other questions tagged or ask your own question.