Post as link type using the Facebook Graph API

I am using the Facebook API to post to the user's wall. I give it the following parameters:

message name description picture link caption 

It fits into the wall, but it does not view it as a link. I know this because it does not open a new tab when a link is clicked, there is no link to the action with stocks, and Twitter does not select it, because I filter it only by links on my wall.

I see that in the Facebook docs there are two separate documentation pages for publishing the "Post" and "Link" objects .. but the links go to the same graph path, so I'm not sure how it is supported for work:

http://developers.facebook.com/docs/reference/api/post

http://developers.facebook.com/docs/reference/api/link

Has anyone got this job?

+7
facebook
source share
2 answers

Use the facebook API available at codeplex.com and try this,

 Facebook.Rest.attachment_media_image image1 = new attachment_media_image(); image1.href = ""; image1.src = ""; Facebook.Rest.attachment a = new Facebook.Rest.attachment(); a.media = new List<Facebook.Rest.attachment_media> { image1 }; a.href = ""; a.name = ""; a.caption = "{*actor*}"; a.properties = null; if(fbapi.Users.HasAppPermission(Enums.ExtendedPermissions.publish_stream)) fbapi.Stream.Publish(" Your message", a, new List<action_link>() { new action_link() { text = "", href = "" } }, null, 0); 
+2
source share

What I do when using an open chart:

 var uri = new Uri( "https://graph.facebook.com/me/links?access_token=" + AccessToken); var data = message != null ? string.Format( "link={0}&message={1}", Uri.EscapeDataString(link), Uri.EscapeDataString(message)) : string.Format("link={0}", Uri.EscapeDataString(link)); // (parameters other than link and message are grabbed from a website anyway) WebClient client = new WebClient(); client.Headers["Content-type"] = "application/x-www-form-urlencoded"; client.Encoding = Encoding.UTF8; client.UploadStringAsync(uri, "POST", data); 
0
source share

All Articles