Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

ConfluenceClient

OfficeIMO.Confluence

Namespace
OfficeIMO.Confluence
Assembly
OfficeIMO.Confluence
Source revision
ba882f6b0d07 with working tree changes
Implements
IDisposable
Modifiers
sealed

Dependency-light Confluence Cloud page and attachment client.

Inheritance

  • object
  • ConfluenceClient

Usage

Explore 1 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Returned or exposed by 1

Constructors

public ConfluenceClient(ConfluenceSession session) #

Creates a client that sends requests using the supplied session.

Parameters

session OfficeIMO.Confluence.ConfluenceSession required

Methods

public Task<ConfluencePage> CreatePageAsync(ConfluencePageCreateRequest request, CancellationToken cancellationToken = default) #

Creates a page. Non-idempotent writes are never retried automatically.

Parameters

request OfficeIMO.Confluence.ConfluencePageCreateRequest required
cancellationToken System.Threading.CancellationToken = default optional

Returns

Task<ConfluencePage>
public async Task DeletePageAsync(string pageId, bool purge = false, bool draft = false, CancellationToken cancellationToken = default) #

Deletes a page. This non-idempotent operation is never retried automatically.

Parameters

pageId string required
purge bool = false optional
draft bool = false optional
cancellationToken System.Threading.CancellationToken = default optional

Returns

Task
public void Dispose() #

Releases the client's resources without disposing a caller-supplied HTTP client.

DownloadAttachmentAsync 2 overloads
public async Task<byte[]> DownloadAttachmentAsync(string pageId, string attachmentId, CancellationToken cancellationToken = default) #

Downloads an attachment through Confluence's authenticated redirect endpoint.

Parameters

pageId string required
attachmentId string required
cancellationToken System.Threading.CancellationToken = default optional

Returns

Task<byte[]>
public Task DownloadAttachmentAsync(string pageId, string attachmentId, Stream destination, CancellationToken cancellationToken = default) #

Streams an attachment through Confluence's authenticated redirect endpoint.

Parameters

pageId string required
attachmentId string required
destination System.IO.Stream required
cancellationToken System.Threading.CancellationToken = default optional

Returns

Task
public async Task<ConfluenceAttachmentBatch> GetAttachmentsAsync(string pageId, string? cursor = null, int limit = 50, CancellationToken cancellationToken = default) #

Lists one cursor-addressable batch of attachments for a page.

Parameters

pageId string required
cursor string? = null optional
limit int = 50 optional
cancellationToken System.Threading.CancellationToken = default optional
public Task<ConfluencePage> GetPageAsync(string pageId, ConfluenceBodyFormat bodyFormat = AtlasDocFormat, CancellationToken cancellationToken = default) #

Reads a page with the requested body representation.

Parameters

pageId string required
bodyFormat OfficeIMO.Confluence.ConfluenceBodyFormat = AtlasDocFormat optional
cancellationToken System.Threading.CancellationToken = default optional

Returns

Task<ConfluencePage>
public async Task<ConfluencePageBatch> GetPagesAsync(ConfluencePageQuery? query = null, CancellationToken cancellationToken = default) #

Lists one cursor-addressable batch of pages.

Parameters

query OfficeIMO.Confluence.ConfluencePageQuery? = null optional
cancellationToken System.Threading.CancellationToken = default optional

Returns

Task<ConfluencePageBatch>
public static ConfluencePageWritePlan PlanCreatePage(ConfluencePageCreateRequest request) #

Builds the exact create request without contacting Confluence.

Parameters

request OfficeIMO.Confluence.ConfluencePageCreateRequest required
public static ConfluencePageWritePlan PlanDeletePage(string pageId, bool purge = false, bool draft = false) #

Builds the exact delete request without contacting Confluence.

Parameters

pageId string required
purge bool = false optional
draft bool = false optional
public static ConfluencePageWritePlan PlanUpdatePage(ConfluencePageUpdateRequest request) #

Builds the exact update request without contacting Confluence.

Parameters

request OfficeIMO.Confluence.ConfluencePageUpdateRequest required
public Task<ConfluencePage> UpdatePageAsync(ConfluencePageUpdateRequest request, CancellationToken cancellationToken = default) #

Updates a page using the caller-supplied next version number. Writes are never retried automatically.

Parameters

request OfficeIMO.Confluence.ConfluencePageUpdateRequest required
cancellationToken System.Threading.CancellationToken = default optional

Returns

Task<ConfluencePage>
UploadAttachmentAsync 2 overloads
public async Task<IReadOnlyList<ConfluenceAttachment>> UploadAttachmentAsync(string pageId, ConfluenceAttachmentUpload upload, CancellationToken cancellationToken = default) #

Creates or versions an attachment through Confluence's multipart v1 endpoint.

Parameters

pageId string required
upload OfficeIMO.Confluence.ConfluenceAttachmentUpload required
cancellationToken System.Threading.CancellationToken = default optional

Returns

Task<IReadOnlyList<ConfluenceAttachment>>
public async Task<IReadOnlyList<ConfluenceAttachment>> UploadAttachmentAsync(string pageId, ConfluenceAttachmentStreamUpload upload, CancellationToken cancellationToken = default) #

Creates or versions an attachment from a caller-owned stream.

Parameters

pageId string required
upload OfficeIMO.Confluence.ConfluenceAttachmentStreamUpload required
cancellationToken System.Threading.CancellationToken = default optional

Returns

Task<IReadOnlyList<ConfluenceAttachment>>

Properties

public ConfluenceSession Session { get; } #

Gets the session supplied to this client.