2

Since Facebook is removing the ability to post to friends' wall via Graph API from February 6, 2013 onward, I want to know if there are some alternates to post to the friend's Wall.

Till now, I was using Feed API for this- using to parameter but it throws the exception:

(#200) Feed story publishing to other users is disabled for this application

The possible solution that I found was: OG: Mention Tagging. But is there a way to accomplish this other than by using OpenGraph? Please help.

Sahil Mittal
  • 20,351
  • 12
  • 59
  • 88

4 Answers4

9

But is there a way to accomplish this other than by using open graph?

Accomplish what exactly?

Tagging users/friends in any kind of posts? Only possible for Open Graph stories, or photos. (But be aware, apps are not supposed to tag users in photos if the user is not actually in it, or if it’s not a real photo, but just a composite image.)

Or posting to friend’s wall? This will only be possible using the Feed dialog from Feb. 2013 on.

CBroe
  • 82,033
  • 9
  • 81
  • 132
  • Thanks for your answer CBroe. I want to post on users wall- how is this possible using Feed Dialog? I guess this will not work after Feb. – Sahil Mittal Jan 07 '13 at 09:31
  • 1
    To post to the user’s own wall, you just have to invoke the Feed dialog. To post to a friend’s wall, you can give that friend’s id in the `to` parameter. – CBroe Jan 07 '13 at 09:33
  • My bad. Yes, I have to post to friends wall not users'. If I give the friends id in the "to" parameter, it gives me the same error: (#200) Feed story publishing to other users is disabled for this application – Sahil Mittal Jan 07 '13 at 09:35
  • Please check this link "https://developers.facebook.com/roadmap/completed-changes/" -> "February 6, 2013" -> "Removing ability to post to friends walls via Graph API" "If you want to allow people to post to their friends' timelines, invoke the feed dialog. Stories that include friends via user mentions tagging or action tagging will show up on the friend’s timeline (assuming the friend approves the tag)." this mean that the only way by tagging your friend's to show your post on his/her timeline. – Hazem Feb 10 '13 at 08:18
2

The possibilty to post to friend’s walls via API will be removed in February 2013 – https://developers.facebook.com/roadmap/#february-2013:

If it fails for your app already, maybe you have the corresponding migration enabled in your settings? Anyway, not much point in developing such a thing now, since it won’t work any more in a week.

“We will remove the ability to post to a user's friends' walls via the Graph API. Specifically, posts against [user_id]/feed where [user_id] is different from the session user, or stream.publish calls where the target_id user is different from the session user, will fail.”

If you want to allow people to post to their friends' timelines, invoke the feed dialog. Stories that include friends via user mentions tagging or action tagging will show up on the friend’s timeline (assuming the friend approves the tag). For more info, see this blog post.

Edit:

@Sahil: See also this answer if it works now. I am not sure it will work now or not. But you should try once. I had made some workflow previously by selecting friend and inviting him and also posting on his wall also. I havn't tested this now, please confirm me.

Community
  • 1
  • 1
Somnath Muluk
  • 46,917
  • 28
  • 204
  • 217
  • Thanks for response, I've read all of this before and that is what my question is, that how to do now! – Sahil Mittal Jan 29 '13 at 08:13
  • 1
    @Sahil: This feature is totally removed. And not at possible now. Please read last paragraph, you can post on user's profiles and tag them in post or photo. This will be shown on their wall only they approves tag. I think this feature is removed because people are advertising and taking advantage of this feature. Now friend approved posts only shown on their wall(timeline). – Somnath Muluk Jan 29 '13 at 09:12
  • @Sahil: See also [this answer](http://stackoverflow.com/a/9411923/1045444)if it works now. I am not sure it will work now or not. But you should try once. I had made some workflow previously by selecting friend and inviting him and also posting on his wall also. – Somnath Muluk Feb 01 '13 at 05:03
  • that's the same code i was using to post on the friend's wall, but this will not work after Feb 6 now . :( – Sahil Mittal Feb 01 '13 at 05:25
  • And have you tried `posting on own wall with friends tagged`, that post will be shown on friends wall, if they approves tag. And I believe this is the only way remained now. – Somnath Muluk Feb 01 '13 at 05:28
  • That's `Mention tagging` right? But why some guys (CBroe, Fjell) saying that using `to` parameter will work? Is it that `FB.ui` will work but not `FB.api` for posting on the friends' wall? I' highly confused. – Sahil Mittal Feb 01 '13 at 05:31
  • @Sahil: Yes by mentioning tagging. And I need to confirm it. I will check and let you know if I gets some news. – Somnath Muluk Feb 01 '13 at 05:36
2

If you use the to parameter with the Feed Dialog, you'll also need to specify a valid access token.

We actually had this same problem, which we solved by displaying the Feed Dialog as an iframe and dynamically adjusting the to param. You can find an in-depth answer + code sample here: https://stackoverflow.com/a/14532867/1406819

Community
  • 1
  • 1
Christian Yang
  • 452
  • 3
  • 11
  • Is it possible to use `feed dialog` with more than 1 friend id in the `to` parameter? I mean can `feed dialog` be used to publish on the wall of many friends in one go? – Sahil Mittal Feb 03 '13 at 14:06
  • Specifying more than 1 friend id at once didn't work for us. What we did do was bind to the `load` event of the iframe so we could detect that the user had submitted. Then we reset the UI so the user could submit again. – Christian Yang Feb 03 '13 at 15:52
1

Check the FB.ui documentation for the feed method here: https://developers.facebook.com/docs/reference/dialogs/feed/

Setting the "to" parameter to a friend's ID will enable posting to a timeline. to - The ID or username of the profile that this story will be published to. If this is unspecified, it defaults to the the value of from.

See the Properties detail lower on that page for more info. Note that using this will trigger a confirmation dialog.

If you're using the JS SDK, here's something to get you started:

var MY_ID = "1000000000000";
    function post(link, callback){
        var post = {};
        post.method = 'feed';
        if(!link.target)
        {
            link.target = MY_ID;
        }
        if(!link.from)
        {
            link.from = MY_ID;
        }

        post.to             = link.target;
        post.from           = link.from;
        post.link           = link.link;
        post.name           = link.name;
        post.picture        = link.picture;
        post.caption        = link.caption;
        post.description    = link.description;

        FB.ui(post, function(response){
            if(typeof callback=='function'){callback(response);}
        });
    }