PrivMX DOCS
API Reference/PrivMX Endpoint C# Extra/Inboxes

AsyncInboxApi

Inbox API wrapper that provides asynchronous methods and manages resources.

Methods

AsyncInboxApi

Wraps existing connection into async connection. It's user responsibility to provide valid (connected) connection.

Params

connection

Connection

Connection to wrap

AsyncInboxApi(
Connection connection
)

AsyncInboxApi

Wraps existing inbox api. It's recommended to use this constructor in tests or custom scenarios.

Params

inboxApi

IInboxApi

Wrapped inbox api

connectionId

long

Connection ID

eventDispatcher

IEventDispatcher

Event dispatcher used in event streams

AsyncInboxApi(
IInboxApi inboxApi,
long connectionId,
IEventDispatcher eventDispatcher
)

DisposeAsync

Disposes async inbox api with all related resources.

ValueTask DisposeAsync()

Returns

ValueTask ·

CreateInboxAsync

Creates a new Inbox.contextIdID of the Context of the new Inbox.usersVector of UserWithPubKey structs which indicates who will have access to the created Inbox.managersVector of UserWithPubKey structs which indicates who will have access (and management rights) to the created Inbox. publicMetaPublic (unencrypted) metadata.privateMetaPrivate (encrypted) metadata.filesConfigOptional configuration of files.policies(optional) Inbox policy.tokenCancellation token.ID of the created Inbox.

Params

contextId

string

users

List<UserWithPubKey>

managers

List<UserWithPubKey>

publicMeta

byte[]

privateMeta

byte[]

filesConfig

FilesConfig

policies

ContainerPolicyWithoutItem?

token

CancellationToken

ValueTask<string> CreateInboxAsync(
string contextId,
List<UserWithPubKey> users,
List<UserWithPubKey> managers,
byte[] publicMeta,
byte[] privateMeta,
FilesConfig filesConfig,
ContainerPolicyWithoutItem? policies = null,
CancellationToken token = default
)

Returns

ValueTask<string> ·

UpdateInboxAsync

Updates an existing Inbox.inboxIdID of the Inbox to update.usersVector of UserWithPubKey structs which indicates who will have access to the created Inbox.managersVector of UserWithPubKey structs which indicates who will have access (and management rights) to the created Inbox. publicMetaPublic (unencrypted) metadata.privateMetaPrivate (encrypted) metadata.filesConfigOptional configuration of files.versionCurrent version of the updated Inbox.forceForce update without checking version.forceGenerateNewKeyForce to regenerate a key for the Inbox.policies(optional) Inbox policy.tokenCancellation token.

Params

inboxId

string

users

List<UserWithPubKey>

managers

List<UserWithPubKey>

publicMeta

byte[]

privateMeta

byte[]

filesConfig

FilesConfig

version

long

force

bool

forceGenerateNewKey

bool

policies

ContainerPolicyWithoutItem?

token

CancellationToken

ValueTask UpdateInboxAsync(
string inboxId,
List<UserWithPubKey> users,
List<UserWithPubKey> managers,
byte[] publicMeta,
byte[] privateMeta,
FilesConfig filesConfig,
long version,
bool force,
bool forceGenerateNewKey,
ContainerPolicyWithoutItem? policies = null,
CancellationToken token = default
)

Returns

ValueTask ·

GetInboxAsync

Gets a Inbox by given Inbox ID.inboxIdID of the Inbox to get.tokenCancellation token.Information about about the Inbox.

Params

inboxId

string

token

CancellationToken

ValueTask<PrivMX.Endpoint.Inbox.Models.Inbox> GetInboxAsync(
string inboxId,
CancellationToken token = default
)

Returns

ValueTask<PrivMX.Endpoint.Inbox.Models.Inbox> ·

ListInboxesAsync

Gets s list of Inboxes in given Context.contextIdID of the Context to get Inboxes from.pagingQueryList query parameters.tokenCancellation token.List of Inboxes.

Params

contextId

string

pagingQuery

PagingQuery

token

CancellationToken

ValueTask<PagingList<PrivMX.Endpoint.Inbox.Models.Inbox>> ListInboxesAsync(
string contextId,
PagingQuery pagingQuery,
CancellationToken token = default
)

Returns

ValueTask<PagingList<PrivMX.Endpoint.Inbox.Models.Inbox>> ·

GetInboxPublicViewAsync

Gets public data of an Inbox. You do not have to be logged in to call this function.inboxIdID of the Inbox to get.tokenCancellation token.Public accessible information about the Inbox.

Params

inboxId

string

token

CancellationToken

ValueTask<InboxPublicView> GetInboxPublicViewAsync(
string inboxId,
CancellationToken token = default
)

Returns

ValueTask<InboxPublicView> ·

DeleteInboxAsync

Deletes an Inbox by given Inbox ID.inboxIdID of the Inbox to delete.tokenCancellation token

Params

inboxId

string

token

CancellationToken

ValueTask DeleteInboxAsync(
string inboxId,
CancellationToken token = default
)

Returns

ValueTask ·

GetEntryBuilder

Returns entry builder that can be used to create new entries in the inbox.inboxIdID of inbox where entry will be created.Inbox entry builder.

Params

inboxId

string

InboxEntryWriterBuilder GetEntryBuilder(
string inboxId
)

Returns

InboxEntryWriterBuilder ·

ReadEntryAsync

Gets an entry from an Inbox.inboxEntryIdID of an entry to read from the Inbox.tokenCancellation token.Data of the entry stored in the Inbox.

Params

inboxEntryId

string

token

CancellationToken

ValueTask<InboxEntry> ReadEntryAsync(
string inboxEntryId,
CancellationToken token = default
)

Returns

ValueTask<InboxEntry> ·

ListEntriesAsync

Gets list of entries in given Inbox.inboxIdID of the Inbox.pagingQueryList query parameters.tokenCancellation token.List of entries.

Params

inboxId

string

pagingQuery

PagingQuery

token

CancellationToken

ValueTask<PagingList<InboxEntry>> ListEntriesAsync(
string inboxId,
PagingQuery pagingQuery,
CancellationToken token = default
)

Returns

ValueTask<PagingList<InboxEntry>> ·

DeleteEntryAsync

Delete an entry from an Inbox.inboxEntryIdID of an entry to delete.tokenCancellation token.

Params

inboxEntryId

string

token

CancellationToken

ValueTask DeleteEntryAsync(
string inboxEntryId,
CancellationToken token = default
)

Returns

ValueTask ·

OpenFileForRead

Opens file for user to read.entryEntry from which file will be opended.fileIdID of file to open.tokenCancellation token.Fixed size seekable and readable stream.

Params

entry

InboxEntry

fileId

string

token

CancellationToken

async ValueTask<PrivmxFileStream> OpenFileForRead(
InboxEntry entry,
string fileId,
CancellationToken token = default
)

Returns

async ValueTask<PrivmxFileStream> ·

GetInboxEvents

Get inbox events.Stream of inbox events.

IObservable<InboxEvent> GetInboxEvents()

Returns

IObservable<InboxEvent> ·

GetEntryEvents

Get events related to specific inbox entries.inboxIdID of the inbox.Stream of entries events.

Params

inboxId

string

IObservable<InboxEntryEvent> GetEntryEvents(
string inboxId
)

Returns

IObservable<InboxEntryEvent> ·

Dispose

void Dispose()

We use cookies on our website. We use them to ensure the proper functioning of the site and, if you agree, for purposes we set, such as analytics or marketing.