Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

how to connect to Confluence via C#.net code

swatipriyadarsani
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
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 Champion
July 15, 2019

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

TAGS
AUG Leaders

Atlassian Community Events