How do I add an action to post to my Facebook wall?


pass through

I use the Facebook SDK for .NET and I can post it to the user wall using an app token.

Code example where I create the post:

        dynamic messagePost = new ExpandoObject();
        messagePost.picture = "http://cs608830..........jpg";
        messagePost.name = "A.......";
        messagePost.message = "I........ ";
        messagePost.link = "http://a.......";
        messagePost.req_perms = "publish_stream";
        messagePost.scope = "publish_stream";
        messagePost.actions =
            "[{\"name\": \"View on .....\",\"link\": \"https://play.google.com/store/apps/details?id=com.........\"}]";
        messagePost.privacy = new
        {
            value = "SELF"
        };

Its a good post, but I want to add a second action:

   messagePost.actions =
            "[{\"name\": \"View on Play Market\",\"link\": \"https://play.google.com/store/apps/details?id=com.....\"},
              {\"name\": \"View on iTunes \",\"link\": \"https://itunes.apple.com/us/app/sla......\"}  ]";

However, when I add the secon action, I get the next error:

 (OAuthException - #100) (#100) actions should be a JSON-encoded dictionary with "name" and "link" keys

I can definitely add a second action, because in the documentation https://developers.facebook.com/docs/reference/api/post/ I see the next one: Actions - List of actions available in the post (including comments , likes, and optional app-specific actions) So what am I doing wrong?

Crowe

I'm sure I can add a second action

Then you are wrong.

Actions - List of actions available in the post (including comment, like, and apply-specified optional actions)

The first is the FB default action - and an optional action specified by the app - singular.

Related


How do I post on a user's wall on my behalf?

SanJeet Singh Suppose I am user A and have a user B. Is it possible to use the Facebook API or any other way in some way and programmatically post a post on User B's wall so that the post appears to be me? I can get any permission I want because we are good fr

Do I need permission to post programmatically on my wall?

copper I want to programmatically publish a new story on a page I own. Do I need to request permission from Facebook to do this? When I call, Facebook -> postI get an error: (#200) The user hasn't authorized the application to perform this action. I want to as

How do I add a Facebook share button to my website?

Sahibjot Singh: I have this code that should work, but it doesn't work. If this helps you anyway, great. <script src='http://connect.facebook.net/en_US/all.js'></script> <p><a onclick='postToFeed(); return false;'><img src="images/fb.png" /></a></p> <p

How do I add a Facebook share button to my website?

Sahibjot Singh: I have this code that should work, but it doesn't work. If this helps you anyway, great. <script src='http://connect.facebook.net/en_US/all.js'></script> <p><a onclick='postToFeed(); return false;'><img src="images/fb.png" /></a></p> <p

How do I add a redirect when my Facebook page is liked?

Bunya I have a website with some Facebook-like buttons on it like this <div class="like-box"> <div class="fb-like" data-href="https://www.facebook.com/samebirthday.officialpage" data-width="500" data-layout="box_count" data-action="like" data-show-faces="tru

How do I add a Facebook share button to my website?

Sahibjot Singh: I have this code that should work, but it doesn't work. If this helps you anyway, great. <script src='http://connect.facebook.net/en_US/all.js'></script> <p><a onclick='postToFeed(); return false;'><img src="images/fb.png" /></a></p> <p

How do I add a redirect when my Facebook page is liked?

Bunya I have a website with some Facebook-like buttons on it like this <div class="like-box"> <div class="fb-like" data-href="https://www.facebook.com/samebirthday.officialpage" data-width="500" data-layout="box_count" data-action="like" data-show-faces="tru

How does Facebook 3.0 post a wall?

Warpzit So the new facebook 3.0 has a great guide on how to post on the wall . But what do you do when it's not flying? I got the following response from Facebook: {Response: responseCode: 400, graphObject: null, error: {HttpStatus: 400, errorCode: 100, error

How to post message on facebook wall using python

Python team I am trying to post a message on the facebook wall using python. I got access token from developer app. I try to use the following code graph = facebook.GraphAPI(Access token) profile = graph.get_object('me') graph.put_object("me", "feed", messa

How does Facebook 3.0 post a wall?

Warpzit So the new facebook 3.0 has a great guide on how to post on the wall . But what do you do when it's not flying? I got the following response from Facebook: {Response: responseCode: 400, graphObject: null, error: {HttpStatus: 400, errorCode: 100, error

How to post message on facebook wall using python

Python team I am trying to post a message on the facebook wall using python. I got access token from developer app. I try to use the following code graph = facebook.GraphAPI(Access token) profile = graph.get_object('me') graph.put_object("me", "feed", messa

Post on Facebook Wall with Android

Raghav Satiedev How to share posts on wall from Facebook SDK 4.10.0 in Android? List<String> permissionNeeds = Arrays.asList("publish_actions"); manager = LoginManager.getInstance(); manager.logInWithPublishPermissions(this, permissionNeeds); manager.regis

Post on Facebook Wall with Android

Raghav Satiedev How to share posts on wall from Facebook SDK 4.10.0 in Android? List<String> permissionNeeds = Arrays.asList("publish_actions"); manager = LoginManager.getInstance(); manager.logInWithPublishPermissions(this, permissionNeeds); manager.regis

How do you post to a friend's wall using the C# Facebook SDK?

Bumi So I tried posting on a friend wall with the following code: var fb = new FacebookClient(_accessToken); dynamic parameters = new ExpandoObject(); parameters.message = "Google is your friend"; parameters.link = "http://gidf.de/"; parameters.Name = "Test";

How do you post to a friend's wall using the C# Facebook SDK?

Bumi So I tried posting on a friend wall with the following code: var fb = new FacebookClient(_accessToken); dynamic parameters = new ExpandoObject(); parameters.message = "Google is your friend"; parameters.link = "http://gidf.de/"; parameters.Name = "Test";

Facebook iOS SDK: Post on my wall with mentioned friends

Iraqi I want to make a post with pictures, messages, and mention some friends. I am using Graph API to post photos [FBRequestConnection startWithGraphPath:@"me/photos" parameters:dictionary HTTPMethod:@"POST" completionHandler: and used the friend list [FBReq

Facebook iOS SDK: Post on my wall with mentioned friends

Iraqi I want to make a post with pictures, messages, and mention some friends. I am using Graph API to post photos [FBRequestConnection startWithGraphPath:@"me/photos" parameters:dictionary HTTPMethod:@"POST" completionHandler: and used the friend list [FBReq

Facebook iOS SDK: Post on my wall with mentioned friends

Iraqi I want to make a post with pictures, messages, and mention some friends. I am using Graph API to post photos [FBRequestConnection startWithGraphPath:@"me/photos" parameters:dictionary HTTPMethod:@"POST" completionHandler: and used the friend list [FBReq

Facebook iOS SDK: Post on my wall with mentioned friends

Iraqi I want to make a post with pictures, messages, and mention some friends. I am using Graph API to post photos [FBRequestConnection startWithGraphPath:@"me/photos" parameters:dictionary HTTPMethod:@"POST" completionHandler: and used the friend list [FBReq

How do i get the facebook post id?

a7madx7 How to extract post id after posting post using Facebook method Post() or PostTaskAsync() ? I use JSON.Netsomething like this var postObject = await fb.PostTaskAsync("/me/feed", postArgs); dynamic result = JsonConvert.DeserializeObject((

How do i get the facebook post id?

a7madx7 How to extract post id after posting post using Facebook method Post() or PostTaskAsync() ? I use JSON.Netsomething like this var postObject = await fb.PostTaskAsync("/me/feed", postArgs); dynamic result = JsonConvert.DeserializeObject((