This is a simple REST based Confluence client, written for Greenshot, by using Dapplo.HttpExtension
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 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