PrivMX DOCS
API Reference/PrivMX Endpoint C#/Threads

ThreadApi

Static Methods

Create

Creates an instance of the ThreadApi.

Params

connection

Connection

Instance of Connection

static ThreadApi Create(
Connection connection
)

Returns

ThreadApi · Created instance of the ThreadApi.

Methods

CreateThread

Creates new Thread in given Context.

Params

contextId

string

ID of the Context to create the Thread in.

users

List<UserWithPubKey>

Array of UserWithPubKey which indicates who will have access to the created Thread.

managers

List<UserWithPubKey>

Array of UserWithPubKey which indicates who will have access (and management rights) to the created Thread.

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.

policies

ContainerPolicy?

(optional) Thread policy.

string CreateThread(
string contextId,
List<UserWithPubKey> users,
List<UserWithPubKey> managers,
byte[] publicMeta,
byte[] privateMeta,
ContainerPolicy? policies = null
)

Returns

string · ID of the created Thread.

UpdateThread

Updates an existing Thread.

Params

threadId

string

ID of the Thread to update.

users

List<UserWithPubKey>

Array of UserWithPubKey structs which indicates who will have access to the created Thread.

managers

List<UserWithPubKey>

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

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.

version

long

Current version of the updated Thread.

force

bool

Force update (without checking version).

forceGenerateNewKey

bool

Force to regenerate a key for the Thread.

policies

ContainerPolicy?

(optional) Thread policy.

void UpdateThread(
string threadId,
List<UserWithPubKey> users,
List<UserWithPubKey> managers,
byte[] publicMeta,
byte[] privateMeta,
long version,
bool force,
bool forceGenerateNewKey,
ContainerPolicy? policies = null
)

DeleteThread

Deletes a Thread by given Thread ID.

Params

threadId

string

ID of the Thread to delete.

void DeleteThread(
string threadId
)

GetThread

Gets a Thread by given Thread ID.

Params

threadId

string

ID of Thread to get.

Models.Thread GetThread(
string threadId
)

Returns

Models.Thread · Information about about the Thread.

ListThreads

Gets a list of Threads in given Context.

Params

contextId

string

ID of the Context to get the Threads from.

pagingQuery

PagingQuery

List query parameters.

PagingList<Models.Thread> ListThreads(
string contextId,
PagingQuery pagingQuery
)

Returns

PagingList<Models.Thread> · List of Threads.

GetMessage

Gets a message by given message ID.

Params

messageId

string

ID of the message to get.

Message GetMessage(
string messageId
)

Returns

Message · Message.

ListMessages

Gets a list of messages from a Thread.

Params

threadId

string

ID of the Thread to list messages from.

pagingQuery

PagingQuery

List query parameters.

PagingList<Message> ListMessages(
string threadId,
PagingQuery pagingQuery
)

Returns

PagingList<Message> · List of messages.

SendMessage

Sends a message in a Thread.

Params

threadId

string

ID of the Thread to send message to.

publicMeta

byte[]

Public message metadata.

privateMeta

byte[]

Private message metadata.

data

byte[]

Content of the message.

string SendMessage(
string threadId,
byte[] publicMeta,
byte[] privateMeta,
byte[] data
)

Returns

string · ID of the new message.

UpdateMessage

Updates a message in a Thread.

Params

messageId

string

ID of the message to update.

publicMeta

byte[]

Public message metadata.

privateMeta

byte[]

Private message metadata.

data

byte[]

Content of the message.

void UpdateMessage(
string messageId,
byte[] publicMeta,
byte[] privateMeta,
byte[] data
)

DeleteMessage

Deletes a message by given message ID.

Params

messageId

string

ID of the message to delete.

void DeleteMessage(
string messageId
)

SubscribeForThreadEvents

Subscribes for the Thread module main events.

void SubscribeForThreadEvents()

UnsubscribeFromThreadEvents

Unsubscribes from the Thread module main events.

void UnsubscribeFromThreadEvents()

SubscribeForMessageEvents

Subscribes for the events in given Thread.

Params

threadId

string

ID of the Thread to subscribe for.

void SubscribeForMessageEvents(
string threadId
)

UnsubscribeFromMessageEvents

Unsubscribes from events in given Thread.

Params

threadId

string

ID of the Thread to unsubscribe from.

void UnsubscribeFromMessageEvents(
string threadId
)

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.