ThreadApi
ThreadApi is a class representing Endpoint's API for Threads and their messages.
Static Methods
create
Returns
[ThreadApi](/reference/cpp/endpoint/thread/thread-api)
·
ThreadApi object
Methods
createThread
Creates a new Thread in given Context.
Params
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 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 policies
deleteThread
getThread
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
[PagingList](/reference/cpp/endpoint/core/types#paginglist)<[Thread](/reference/cpp/endpoint/thread/types#thread)>
·
struct containing a list of Threads
getMessage
Gets a message by given message ID.
Params
messageId
const std::string &
Returns
[Message](/reference/cpp/endpoint/thread/types#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
[PagingList](/reference/cpp/endpoint/core/types#paginglist)<[Message](/reference/cpp/endpoint/thread/types#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
unsubscribeFromMessageEvents
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.