Facebook Posting a link

Posting a link

Posting something to a feed requires the publish_actions scope. In Skybrud.Social this scope can be accessed through FacebookScope.PublishStream.

If you just need to post the link to your own feed, the code below will do just that. A POST request will be made to the URL https://graph.facebook.com/me/feed.

// Initialize a new instance of FacebookService based on the specified user access token
FacebookService service = FacebookService.CreateFromAccessToken(accessToken);

// Post the link to the API
FacebookPostLinkResponse response = service.Links.PostLink(new FacebookPostLinkOptions {
    Link = "http://skybrud.dk/",
    Message = "Måske bare lige en lidt længere tekst eller noget",
    Description = "Bare lige en hurtig tekst",
    Name = "Skybrud.dk",
    Caption = "omg bacon"
});

// Get the ID of the created link
string postId = response.Body.Id;