How to publish feed story in facebook profile with image

Apr 29, 2009 at 6:38 AM
Edited Apr 30, 2009 at 5:22 AM
My code is here plz help me how to publish image with story.

It always publish online story only

            path.Add("src", "");
            path.Add("href", "");

            string images = JSONHelper.ConvertToJSONArray(jsonPaths);
            var templateData = new Dictionary<string, string>();

            templateData.Add("images", images);
            _fbService.feed.publishUserAction(bundleID, templateData, friends, "Test story from appllication.",facebook.feed.PublishedStorySize.Short);


Apr 30, 2009 at 9:28 PM
read this...
May 4, 2009 at 1:10 PM
Hi Kirbywnz,

thanks for sharing this link but in my application edit settings its have only one option like "Publish recent activity (one line stories) to my wall" its not have short or full story option.
I uncheck that option the facebook apis gives this error "Permissions error". Please help me if you know solution for this problem.

Thank you.
May 4, 2009 at 5:18 PM
Same problem here... If you figure out let us know!
May 5, 2009 at 12:51 AM
so what is your problem exactly? It now sounds like your problem is that you are unable to publish stories that are longer than one-line (ie short)? Am I correct?

Well, I think (I think) it has to do with the user's settings that you are publishing on behalf. I use to have this problem and I solved it by doing this (I dont know if this is the actual solution for the problem but it worked for me):

  1. You will need to check that option in the application edit settings that allows your app to publish stories.
  2. After you publish the story, go to the user's profile page
  3. On the one-line story, there is an option to show one-line or longer stories. Top right corner or the story I believe? (this is assuming you are the user, and that your one-line story is successfully )
I think thats how I did it. Tell me how it goes.
May 5, 2009 at 9:11 AM
Edited May 6, 2009 at 7:52 AM

Hi kirbywnz,

 thank for your reply my problem is I would like to publish the story in profile with image and action links. But facebook APIs publish that story is always online story. How can I publish short story in profile.

here is my code 



var path = new Dictionary<string, string>();


var jsonPaths = new List<string>(); path.Add(



"src", ConfigurationManager.AppSettings.Get("pubappurl") + "images/campImage.jpg");







images =




var templateData = new Dictionary<string, string>(); templateData.Add(



"images", images); 



List<string> oneLineStory = new List<string>();



"{*actor*} would like to share <a href='" + Master.suffix + "/FB_SupportMySchool/FB_Notifiction.aspx'> Support My School</a>");


List<feedTemplate> shortStory = new List<feedTemplate>();


feedTemplate ft = new feedTemplate(); ft.TemplateTitle =



"{*actor*} likes short story templates as well.";

ft.TemplateBody =


"{*actor*} has been discussing short story templates with File: ";//+ lblFileName.Text + ".";




feedTemplate fullStory = new feedTemplate(); fullStory.TemplateTitle =




"{*actor*} is particularly fond of full story templates!";

fullStory.TemplateBody =


"{*actor*} has worked with abstract: ";// +lblAbstract.Text;


List<facebook.Schema.template_bundle> templateBund = _fbService.feed.getRegisteredTemplateBundles();

long bundleID = _fbService.feed.registerTemplateBundle(oneLineStory, shortStory, fullStory, ActionLinkTDList); _fbService.feed.publishUserAction(bundleID, templateData, friends,



"Test story from appllication.", facebook.feed.PublishedStorySize.Short);

 But its publish one line story only.
how can we publish this story with image? can you understud my problem.If you get solution plz help me.





May 5, 2009 at 9:19 AM
Edited May 6, 2009 at 7:49 AM

Hi Kirbywnz,

In profile page top right corner of the story only "remove" button is there.
May 6, 2009 at 10:13 PM
It appears they have made changes to the API. My bad for not checking it earlier. Yes, I have the same problems now. Just keep an eye on the development of the Stream API for FDT
May 8, 2009 at 7:26 AM


I have one more problem is I have to pass some Id like 128333 to facebook application but  sessions, cookies is not working in fbml pages. I pass query string it is lost while facebook user login time. How can I pass some id to facebook application? Any Idea. If any body knows please share me how to do.I am using ASP.NET with C#, Facebook Developmnt Toolkit 2.0.






May 8, 2009 at 2:39 PM

Hi Prasana,

It seems like they updated the Facebook API in March, but the toolkit has not been updated.

I was able to publish a feed, by creating a WCF service, by following the instructions on this link:

The downside is that you have to use client side code, an input button, to publish the feed.

But it can publish to your friends page, or your own page, or a single users page, it works.

About your problem with querystring parameters get lost during login, I have the same problem as you too!
Don't have a solution for that yet....

Simone Maynard



May 11, 2009 at 5:21 AM
Edited May 11, 2009 at 6:12 AM

Hi Simone Maynard, Kirbywnz and All,

Thank you for your replys.

But I wasnt aware of WCF service. Is enough just we are configure that service in web.config.? Its automatically works or how to call in aspx page? plz tell me.

We can pass query string while login but it takes only one parameter, But i need to pass 2 parameters in url. like this "?widgetid=36&FundCode=FX0036"

Here is my code if any one have any idea plz help me.

I am passing url like this

'<%= ConfigurationManager.AppSettings["APIKey"] %>&next=<%= ConfigurationManager.AppSettings["Suffix"] %>/Default.aspx?widgetid=36&FundCode=FX0036'

but it will redirect as shown bellow


Here i need to pass two parameters like this ""

and I have two more problems

  1.How can we put button or hyper link in fbml page just for redirect to another page ?

 2, How can we maintailn  state management in fbml page?means like sessions, cookies.

Any one knows plz  help me.




May 14, 2009 at 1:11 PM


>> How can we maintailn  state management in fbml page?means like sessions, cookies.

Normal ASP.NET state management (ie Session["some_variable"] in the code behind) works fine.

May 24, 2009 at 4:01 AM

Any idea when this bug in Dev Toolkit 2.0 relating to only allowing one-line stories to be published will be fixed?

Since Facebook only shows one-line stories on the user's own page and not the public Homepage news feed, this is a major problem basically rendering the Dev Toolkit useless.

I am hoping to figure a fix for this or else will need to start with a whole new approach not using the toolkit.


May 24, 2009 at 5:48 AM

OK I figured out why it wouldn't post short stories... you have to have the user grant your app extended permissions first as described at this link:


May 27, 2009 at 6:27 AM

Hi javaman

Are you sure sessions is working in facebook application, but in my appliaction every thing sessions, query strings and cookies lose while facebook login. But query strings is works in fbml pages. When  sessions and cookies is pass it returns null values.

I am using facebooktoolkit 2.0, FBML applicaion.

Please if u use any where please share me that code.



Jun 19, 2009 at 10:01 AM


Yes sessions is working fine.

I have one more problem.

The feed story limit of 10 stories/user/day. If facebook user published more than that it gives error like "Feed action request limit reached".

Is there any solution for this?.




Feb 4, 2010 at 1:36 PM

Im to trying to do this and post smething in the wall but nothing happens even if the Api.Profile.SetFBML(...) returns true!!!

Anyone has any idea???

Do ihave to do Api.Auth.RevokeExtendedPermission(Enums.ExtendedPermissions.publish_stream, ....);  ?????????????