Take the 2-minute tour ×

Facebook recently changed its publish API to prevent post on another user's wall and we should use their share dialogue.

Facebook documentation about publish

I need to share a photo to my friend's wall and I could achieve this using /USER_ID/feed post by specifying a post parameter named object_attachment. Now they have removed /USER_ID/feed post on another user's wall.

So my chances are to follow their share dialogue. But share dialogue will not accept object_attachment parameter of any kind and I can not share photo to my friend's wall or timeline.

Can any one help me?

share|improve this question

1 Answer 1

As you rightly mentioned, Facebook have removed the ability to post via the graph API to another user's feed.

You can, however, use their FB.ui({ method: 'feed' }) feed dialog Javascript dialog combined with target_id: to prompt the user to post to one of their friends' walls.

The accepted parameters are listed on the documentation page and no, you can't attach anything.

One alternative is to create a unique resource for each photo you would have uploaded which contains open graph meta tags, with which you can describe a thumbnail (og:image and og:image:secure_url).

Another alternative is to upload the photo to the current user's album, then to tag the user's friend in that photo:

//Tag friend_to_tag_id at position (x_coordinate, y_coordinate)
$post_url = "https://graph.facebook.com/"
    .$photo_id . "/tags/" . $friend_to_tag_id 
    . "?access_token=". $access_token
    . "&x=" . $x_coordinate . "&y=" . $y_coordinate . "&method=POST";
$response = file_get_contents($post_url);
share|improve this answer
Tagging is not an good option for me. I want to share a greeting to my friend through FB. So post should be in friend's wall not mine. In order to create thumbnail I might need to upload image to server and pass this url to fb. It won't be good option for me as I have a large user space. Any other alternatives? –  Midhere Jul 22 '13 at 4:31
This is the extent of the Facebook API available for the functionality you need, as far as I know, I'm afraid. –  rcambrj Aug 1 '13 at 14:16

Your Answer


