Take the 2-minute tour ×

I am trying to post on my friend's wall using PHP SDK of FB. The code publishes the post on my wall only and also not visible to others.

Here is the code

$ret_obj = $facebook->api('/me/feed', 'POST',array(
            'link' => 'www.google.com',
            'message' => 'message','description' => "I am bond",
            'to' => array('id' => 'friend_id','name' => 'friend_name'),
            'actions' => array('name' => 'Re-share',
            'link' =>'http://apps.facebook.com/my_app/'),
            'privacy' => array('value' => 'EVERYONE')));

This code publishes on my wall rather than the friend's wall. Also the post is only visible to me and not to any one else.

Any kind of help would be highly appreciable.

Thanks in advance

share|improve this question

3 Answers 3

up vote 4 down vote accepted


That's you.


That's your friend.


Specifically the first sentence under "Publishing" where it shows you exactly how to do what you're asking.

share|improve this answer
Thanks for the reply, but I am not able to post the links. Moreover its not visible to the friend and only i can see the post –  devsri Sep 18 '11 at 9:38

To post on a friends wall do an HTTP POST to /freindID/feed instead of /me/feed (which will post to your wall). Also, remove the 'to' parameter.

share|improve this answer
    $friends = $facebook->api('me/friends');

    print_r("Number of friends: ". count($friends['data']));

    foreach ($friends['data'] as $key=>$friendList) {
        echo "<br/>".$key." ".$friendList['name']."<img src='https://graph.facebook.com/".$friendList['id']."/picture' width='50' height='50' title='".$friendList['name']."' />";     
share|improve this answer

Your Answer


