Forums

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

How to get a page using Dapplo.Confluence?

13meles June 16, 2023

I am trying to get the contents of a page with Dapplo.Confluence nuget, but it does not output anything. 

static void Main(string[] args)
{
Confluence();
}
public static async void Confluence()
{
var confluenceClient = ConfluenceClient.Create(new Uri("https://testtest6601.atlassian.net/wiki"));
confluenceClient.SetBasicAuthentication(@"{email}", @"{token}");
var query = 458753;
var pages = await confluenceClient.Content.GetAsync(query);
Console.WriteLine(pages);
var content = await confluenceClient.Content.GetAsync(pages, ConfluenceClientConfig.ExpandGetContent);
Console.WriteLine(content);
//foreach (var contentDigest in pages.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
// Console.WriteLine(content.Body);
// break;

}

 
Does anyone have an idea or an example of this working?

1 answer

0 votes
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 16, 2023

Welcome to the Atlassian Community!

My guess is that you need to adjust your code to use tokens to authenticate - basic authentication is not available on Cloud.  If it's not that, then you'll need to talk to Dapplo about getting the actual errors back.

13meles June 16, 2023

I already use token for authentication as stated in the code, do you mean Oauth 2.0 for authentication?

Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 16, 2023

Yes, that's what I said

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events