thruflo
thruflo

Reputation: 668

Can I set a users profile image using the Facebook API?

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?

Upvotes: 25

Views: 28195

Answers (6)

Chamuth Chamandana
Chamuth Chamandana

Reputation: 120

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.

Upvotes: 1

LolaRun
LolaRun

Reputation: 5666

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

Upvotes: 1

Hannes
Hannes

Reputation: 3772

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.

Upvotes: 41

Christophe Hartwig
Christophe Hartwig

Reputation: 31

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

Upvotes: 3

Portman
Portman

Reputation: 31975

No, you cannot.

From the photos.Upload documentation:

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

Upvotes: 13

fredrik
fredrik

Reputation: 13550

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.

Upvotes: 5

Related Questions