how to connect to Confluence via C#.net code

Swati Jha January 11, 2018

Can any one help me in connecting to confluence via C#.net 

 

I have tired a bit via adding Dapplo reference ..but im getting unauthorized error.Not sure about the reason , I dont directly login to confluence it is via Okta  I login .......I m providing the username and password I use to login to OKTA.

Can some one suggest me _I m very very new to C#.net coding probably first time ever trying my hand on  .net coding

 

"internal static async Task<string> GetConncetionToConfluence()
{
var confluenceClient = ConfluenceClient.Create(new Uri("https://confluence"));
confluenceClient.SetBasicAuthentication("****@****.com", "********");
var query = Where.And(Where.Type.IsPage, Where.Text.Contains("Test Home"));
var searchResult = await confluenceClient.Content.SearchAsync(query, limit: 1);
foreach (var content in searchResult.Results)
{
Console.WriteLine(content.Body);
}


return "Connected!";
}"

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Thomas Deiler
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 15, 2019

Please have a look at https://community.developer.atlassian.com/​ for this kind of questions.

TAGS
AUG Leaders

Atlassian Community Events