InboxApi
InboxApi is a class representing Endpoint's API for Inboxes and their entries.
Static Methods
create
Creates an instance of InboxApi
Params
connection
core::Connection &
instance of 'Connection'
threadApi
thread::ThreadApi &
instance of 'ThreadApi'
storeApi
store::StoreApi &
instance of 'StoreApi'
Returns
[InboxApi](/reference/cpp/endpoint/inbox/inbox-api)
·
InboxApi object
Methods
createInbox
Creates a new Inbox
Params
users
const std::vector<core::UserWithPubKey> &
vector of UserWithPubKey structs which indicates who will have access to the created Inbox
managers
const std::vector<core::UserWithPubKey> &
vector of UserWithPubKey structs which indicates who will have access (and management rights) to the created Inbox
publicMeta
const core::Buffer &
public (unencrypted) metadata
privateMeta
const core::Buffer &
private (encrypted) metadata
filesConfig
const std::optional<inbox::FilesConfig> &
struct to override default file configuration
policies
const std::optional<core::ContainerPolicyWithoutItem> &
Inbox policies
Returns
std::string
·
ID of the created Inbox
updateInbox
Updates an existing Inbox
Params
inboxId
const std::string &
ID of the Inbox to update
users
const std::vector<core::UserWithPubKey> &
vector of UserWithPubKey structs which indicates who will have access to the created Inbox
managers
const std::vector<core::UserWithPubKey> &
vector of UserWithPubKey structs which indicates who will have access (and management rights) to the created Inbox
publicMeta
const core::Buffer &
public (unencrypted) metadata
privateMeta
const core::Buffer &
private (encrypted) metadata
filesConfig
const std::optional<inbox::FilesConfig> &
struct to override default files configuration
version
const int64_t
current version of the updated Inbox
force
const bool
force update (without checking version)
forceGenerateNewKey
const bool
force to regenerate a key for the Inbox
policies
const std::optional<core::ContainerPolicyWithoutItem> &
Inbox policies
getInbox
Returns
[Inbox](/reference/cpp/endpoint/inbox/types#inbox)
·
struct containing information about the Inbox
listInboxes
Gets s list of Inboxes in given Context.
Params
contextId
const std::string &
ID of the Context to get Inboxes from
pagingQuery
const core::PagingQuery &
struct with list query parameters
Returns
[PagingList](/reference/cpp/endpoint/core/types#paginglist)<[InboxApi](/reference/cpp/endpoint/inbox/inbox-api)>
·
struct containing list of Inboxes
getInboxPublicView
Gets public data of given Inbox You do not have to be logged in to call this function.
Params
inboxId
const std::string &
ID of the Inbox to get
Returns
[InboxPublicView](/reference/cpp/endpoint/inbox/types#inboxpublicview)
·
struct containing public accessible information about the Inbox
deleteInbox
prepareEntry
Prepares a request to send data to an Inbox You do not have to be logged in to call this function.
Params
inboxId
const std::string &
ID of the Inbox to which the request applies
data
const core::Buffer &
entry data to send
inboxFileHandles
const std::vector<int64_t> &
optional list of file handles that will be sent with the request
userPrivKey
const std::optional<std::string> &
optional sender's private key which can be used later to encrypt data for that sender
Returns
int64_t
·
handle
sendEntry
Sends data to an Inbox You do not have to be logged in to call this function.
Params
inboxHandle
const int64_t
ID of the Inbox to which the request applies
readEntry
Gets an entry from an Inbox
Params
inboxEntryId
const std::string &
ID of an entry to read from the Inbox
Returns
[InboxEntry](/reference/cpp/endpoint/inbox/types#inboxentry)
·
struct containing data of the selected entry stored in the Inbox
listEntries
Gets list of entries in given Inbox
Params
inboxId
const std::string &
ID of the Inbox
pagingQuery
const core::PagingQuery &
struct with list query parameters
Returns
[PagingList](/reference/cpp/endpoint/core/types#paginglist)<[InboxEntry](/reference/cpp/endpoint/inbox/types#inboxentry)>
·
struct containing list of entries
deleteEntry
createFileHandle
Creates a file handle to send a file to an Inbox You do not have to be logged in to call this function.
Params
publicMeta
const core::Buffer &
file's public metadata
privateMeta
const core::Buffer &
file's private metadata
fileSize
const int64_t &
size of the file to send
Returns
int64_t
·
file handle
writeToFile
Sends file's data chunk to an Inbox (note: 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
const int64_t
ID of the Inbox to which the request applies
inboxFileHandle
const int64_t
handle to the file where the uploaded chunk belongs
dataChunk
const core::Buffer &
openFile
Opens a file to read.
Params
fileId
const std::string &
ID of the file to read
Returns
int64_t
·
handle to read file data
readFromFile
Reads file data. Single read call moves the files's cursor position by declared length or set it at the end of the file.
Params
fileHandle
const int64_t
handle to the file
length
const int64_t
size of data to read
Returns
[Buffer](/reference/cpp/endpoint/core/buffer)
·
buffer with file data chunk
seekInFile
Moves file's read cursor.
Params
fileHandle
const int64_t
handle to the file
position
const int64_t
sets new cursor position
closeFile
Closes a file by given handle.
Params
fileHandle
const int64_t
handle to the file
Returns
std::string
·
ID of closed file
subscribeForInboxEvents
Subscribes for the Inbox module main events.
unsubscribeFromInboxEvents
Unsubscribes from the Inbox module main events.