PrivMX DOCS
API Reference/PrivMX Endpoint C#/Inboxes

InboxApi

Static Methods

Create

Creates an instance of the InboxApi.

Params

connection

Connection

Instance of Connection

threadApi

ThreadApi

Instance of ThreadApi

storeApi

StoreApi

Instance of StoreApi

static InboxApi Create(
Connection connection,
ThreadApi threadApi,
StoreApi storeApi
)

Returns

InboxApi · Created instance of the InboxApi.

Methods

CreateInbox

Creates a new Inbox.

Params

contextId

string

ID of the Context of the new Inbox.

users

List<UserWithPubKey>

Vector of UserWithPubKey structs which indicates who will have access to the created Inbox.

managers

List<UserWithPubKey>

Vector of UserWithPubKey structs which indicates who will have access (and management rights) to the created Inbox.

publicMeta

byte[]

Public metadata that will remain unencrypted on the Bridge.

privateMeta

byte[]

Private metadata that will be encrypted before being sent to the Bridge.

filesConfig

FilesConfig?

(optional) Configuration of files.

policies

ContainerPolicyWithoutItem?

(optional) Inbox policy.

string CreateInbox(
string contextId,
List<UserWithPubKey> users,
List<UserWithPubKey> managers,
byte[] publicMeta,
byte[] privateMeta,
FilesConfig? filesConfig,
ContainerPolicyWithoutItem? policies = null
)

Returns

string · ID of the created Inbox.

UpdateInbox

Updates an existing Inbox.

Params

inboxId

string

ID of the Inbox to update.

users

List<UserWithPubKey>

Vector of UserWithPubKey structs which indicates who will have access to the created Inbox.

managers

List<UserWithPubKey>

Vector of UserWithPubKey structs which indicates who will have access (and management rights) to the created Inbox.

publicMeta

byte[]

Public metadata that will remain unencrypted on the Bridge.

privateMeta

byte[]

Private metadata that will be encrypted before being sent to the Bridge.

filesConfig

FilesConfig?

(optional) Configuration of files.

version

long

Current version of the updated Inbox.

force

bool

Force update without checking version.

forceGenerateNewKey

bool

Force to regenerate a key for the Inbox.

policies

ContainerPolicyWithoutItem?

(optional) Inbox policy.

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

GetInbox

Gets a Inbox by given Inbox ID.

Params

inboxId

string

ID of the Inbox to get.

Models.Inbox GetInbox(
string inboxId
)

Returns

Models.Inbox · Information about about the Inbox.

ListInboxes

Gets s list of Inboxes in given Context.

Params

contextId

string

ID of the Context to get Inboxes from.

pagingQuery

PagingQuery

List query parameters.

PagingList<Models.Inbox> ListInboxes(
string contextId,
PagingQuery pagingQuery
)

Returns

PagingList<Models.Inbox> · List of Inboxes.

GetInboxPublicView

Gets public data of an Inbox. You do not have to be logged in to call this function.

Params

inboxId

string

ID of the Inbox to get.

InboxPublicView GetInboxPublicView(
string inboxId
)

Returns

InboxPublicView · Public accessible information about the Inbox.

DeleteInbox

Deletes an Inbox by given Inbox ID.

Params

inboxId

string

ID of the Inbox to delete.

void DeleteInbox(
string inboxId
)

PrepareEntry

Prepares a request to send data to an Inbox.

You do not have to be logged in to call this function.

Params

inboxId

string

ID of the Inbox to which the request applies.

data

byte[]

Entry data to send.

inboxFileHandles

List<long>

List of file handles that will be sent with the request.

userPrivKey

string?

(optional) Sender's private key which can be used later to encrypt data for that sender.

long PrepareEntry(
string inboxId,
byte[] data,
List<long> inboxFileHandles,
string? userPrivKey
)

Returns

long · Inbox handle.

SendEntry

Sends data to an Inbox.

You do not have to be logged in to call this function.

Params

inboxHandle

long

ID of the Inbox to which the request applies.

void SendEntry(
long inboxHandle
)

ReadEntry

Gets an entry from an Inbox.

Params

inboxEntryId

string

ID of an entry to read from the Inbox.

InboxEntry ReadEntry(
string inboxEntryId
)

Returns

InboxEntry · Data of the entry stored in the Inbox.

ListEntries

Gets list of entries in given Inbox.

Params

inboxId

string

ID of the Inbox.

pagingQuery

PagingQuery

List query parameters.

PagingList<InboxEntry> ListEntries(
string inboxId,
PagingQuery pagingQuery
)

Returns

PagingList<InboxEntry> · List of entries.

DeleteEntry

Delete an entry from an Inbox.

Params

inboxEntryId

string

ID of an entry to delete.

void DeleteEntry(
string inboxEntryId
)

CreateFileHandle

Creates a file handle to send a file to an Inbox.

Params

publicMeta

byte[]

Public file metadata.

privateMeta

byte[]

Private file metadata.

fileSize

long

Size of the file to send.

long CreateFileHandle(
byte[] publicMeta,
byte[] privateMeta,
long fileSize
)

Returns

long · File handle.

WriteToFile

Sends a file's data chunk to an Inbox.

To send the entire file - divide it into pieces of the desired size and call the function for each fragment.

You do not have to be logged in to call this function.

Params

inboxHandle

long

ID of the Inbox to which the request applies.

inboxFileHandle

long

Handle to the file which the uploaded chunk belongs.

dataChunk

byte[]

File chunk to send.

void WriteToFile(
long inboxHandle,
long inboxFileHandle,
byte[] dataChunk
)

OpenFile

Opens a file to read.

Params

fileId

string

ID of the file to read.

long OpenFile(
string fileId
)

Returns

long · Handle to read file data.

ReadFromFile

Reads file data.

Params

fileHandle

long

Handle to the open file.

length

long

Size of data chunk to read.

byte[] ReadFromFile(
long fileHandle,
long length
)

Returns

byte[] · File data chunk which size is equal to length, or smaller size when is end of file.

SeekInFile

Moves file's read cursor.

Params

fileHandle

long

Handle to the file.

position

long

New position of the cursor.

void SeekInFile(
long fileHandle,
long position
)

CloseFile

Closes a file by given handle.

Params

fileHandle

long

Handle to the file.

string CloseFile(
long fileHandle
)

Returns

string · ID of closed file.

SubscribeForInboxEvents

Subscribes for the Inbox module main events.

void SubscribeForInboxEvents()

UnsubscribeFromInboxEvents

Unsubscribes from the Inbox module main events.

void UnsubscribeFromInboxEvents()

SubscribeForEntryEvents

Subscribes for events in given Inbox.

Params

inboxId

string

ID of the Inbox.

void SubscribeForEntryEvents(
string inboxId
)

UnsubscribeFromEntryEvents

Unsubscribes from events in given Inbox.

Params

inboxId

string

ID of the Inbox.

void UnsubscribeFromEntryEvents(
string inboxId
)

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.