devheroo / Dapplo.Confluence

An Atlassian confluence client for .NET

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dapplo.Confluence

This is a simple REST based Confluence client, written for Greenshot, by using Dapplo.HttpExtension

  • Current build status: Build Status
  • Coverage Status: Coverage Status
  • NuGet package: NuGet package

The Confluence client supports most REST methods, and has a fluent API for building a CQL (Confluence Query Language) string to search with.

An example on how to use this Confluence client:

var confluenceClient = ConfluenceClient.Create(new Uri("https://confluence"));
confluenceClient.SetBasicAuthentication(username, password);
var query = Where.And(Where.Type.IsPage, Where.Text.Contains("Test Home"));
var searchResult = await confluenceClient.Content.SearchAsync(query, limit:1);
foreach (var contentDigest in searchResult.Results)
{
	// As the content from the Search is a digest, get the details (it's also possible to get the details during the search)
	var content = await confluenceClient.Content.GetAsync(contentDigest, ConfluenceClientConfig.ExpandGetContentWithStorage);
	// Output the information
	Debug.WriteLine(content.Body);
}

If you want to extend the API for a specific use-case where it doesn't make sense to provide it to the rest of the world via a pull-request, for example to add logic for a plugin, you can write an extension method to extend the IConfluenceClientPlugins. Your "plugin" extension will now be available, if the developer has a using statement of your namespace, on the .Plugins property of the IConfluenceClient

About

An Atlassian confluence client for .NET

License:MIT License


Languages

Language:C# 100.0%