ThreadApi
'ThreadApi' is a class representing Endpoint's API for Threads and their messages.
Static Methods
create
Creates an instance of 'ThreadApi'.
Params
connetion
core::Connection &
Returns
ThreadApi
·
ThreadApi object
Methods
createThread
Creates a new Thread in given Context.
Params
contextId
const std::string &
ID of the Context to create the Thread in
users
const std::vector<core::UserWithPubKey> &
vector of UserWithPubKey structs which indicates who will have access to the created Thread
managers
const std::vector<core::UserWithPubKey> &
vector of UserWithPubKey structs which indicates who will have access (and management rights) to the created Thread
publicMeta
const core::Buffer &
public (unencrypted) metadata
privateMeta
const core::Buffer &
private (encrypted) metadata
policies
const std::optional<core::ContainerPolicy> &
Thread's policies
Returns
std::string
·
ID of the created Thread
updateThread
Updates an existing Thread.
Params
threadId
const std::string &
ID of the Thread to update
users
const std::vector<core::UserWithPubKey> &
vector of UserWithPubKey structs which indicates who will have access to the created Thread
managers
const std::vector<core::UserWithPubKey> &
vector of UserWithPubKey structs which indicates who will have access (and management rights) to the created Thread
publicMeta
const core::Buffer &
public (unencrypted) metadata
privateMeta
const core::Buffer &
private (encrypted) metadata
version
const int64_t
current version of the updated Thread
force
const bool
force update (without checking version)
forceGenerateNewKey
const bool
force to regenerate a key for the Thread
policies
const std::optional<core::ContainerPolicy> &
Thread's policies
deleteThread
Deletes a Thread by given Thread ID.
Params
threadId
const std::string &
ID of the Thread to delete
getThread
Gets a Thread by given Thread ID.
Params
threadId
const std::string &
ID of Thread to get
Returns
Thread
·
Thread struct containing info about the Thread
listThreads
Gets a list of Threads in given Context.
Params
contextId
const std::string &
ID of the Context to get the Threads from
pagingQuery
const core::PagingQuery &
struct with list query parameters
Returns
core::PagingList<Thread>
·
struct containing a list of Threads
getMessage
Gets a message by given message ID.
Params
messageId
const std::string &
Returns
Message
·
struct containing the message
listMessages
Gets a list of messages from a Thread.
Params
threadId
const std::string &
ID of the Thread to list messages from
pagingQuery
const core::PagingQuery &
struct with list query parameters
Returns
core::PagingList<Message>
·
struct containing a list of messages
sendMessage
Sends a message in a Thread.
Params
threadId
const std::string &
ID of the Thread to send message to
publicMeta
const core::Buffer &
public message metadata
privateMeta
const core::Buffer &
private message metadata
data
const core::Buffer &
content of the message
Returns
std::string
·
ID of the new message
deleteMessage
Deletes a message by given message ID.
Params
messageId
const std::string &
ID of the message to delete
updateMessage
Update message in a Thread.
Params
messageId
const std::string &
ID of the message to update
publicMeta
const core::Buffer &
public message metadata
privateMeta
const core::Buffer &
private message metadata
data
const core::Buffer &
content of the message
subscribeForThreadEvents
Subscribes for the Thread module main events.
unsubscribeFromThreadEvents
Unsubscribes from the Thread module main events.
subscribeForMessageEvents
Subscribes for events in given Thread.
Params
threadId
const std::string &
unsubscribeFromMessageEvents
Unsubscribes from events in given Thread.
Params
threadId
const std::string &
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.