开发者

Facebook API/PHP - Is it possible to change a user's profile image via FB Graph API?

Is it possible to set/change a user's facebook profile image through the graph API?

I can't find a specific API method, but it is possible to upload an image to a user's a开发者_C百科lbum (http://developers.facebook.com/docs/reference/api/photo). Can I set the user's profile image to an image uploaded to their album?

Edit:

Same question asked in reference to REST API

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


No, And here's a comment from a guy at facebook:

Facebook API/PHP - Is it possible to change a user's profile image via FB Graph API?

The Original Link - you have to press show comments


We can do a trick by uploading user’s photo to Facebook via the API then redirect the user to uploaded photo URL with makeprofile=1 added to the list of query strings:

facebook.com/photo.php?pid=xyz&id=abc&makeprofile=1

Check Auto Change Facebook Profile Picture to get PHP example and demo.


Currently this is possible by redirecting the user to the mobile profile pic change url, https://m.facebook.com/photo.php?fbid=[fb photo id]&prof&ls=your_photo_permalink

The previous work around, using the facebook.com/photo.php?pid=[fb photo id]&makeprofile=1 url no longer works.


To the best of my knowledge and experience: No.


See the "Publishing" section here: http://developers.facebook.com/docs/reference/api/photo

Requires the publish_stream permission.

To publish a photo, issue a POST request with the photo file attachment as multipart/form-data.

You can publish an individual photo to a user profile with a POST to http://graph.facebook.com/PROFILE_ID/photos We automatically create an album for your application if it does not already exist. All photos from your application will be published to the same automatically created album.

You can publish a photo to a specific, existing photo album with a POST to http://graph.facebook.com/ALBUM_ID/photos.

The last sentence states you can publish to an existing album, so if you're trying to update the user's profile picture (not sure from the way you stated your question), try getting the album ID for the user, then publishing to that.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜