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
·
InboxApi object
Methods
createInbox
Creates a new Inbox.
Params
contextId
const std::string &
ID of the Context of the new Inbox
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
Gets a single Inbox by given Inbox ID.
Params
inboxId
const std::string &
ID of the Inbox to get
Returns
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
core::PagingList<inbox::Inbox>
·
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
inbox::InboxPublicView
·
struct containing public accessible information about the Inbox
deleteInbox
Deletes an Inbox by given Inbox ID.
Params
inboxId
const std::string &
ID of the Inbox to delete
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> &
sender can optionally provide a private key, which will be used: 1) to sign the sent data, 2) to derivation of the public key, which will then be transferred along with the sent data and can be used in the future for further secure communication with the 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
inbox::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
core::PagingList<inbox::InboxEntry>
·
struct containing list of entries
deleteEntry
Delete an entry from an Inbox.
Params
inboxEntryId
const std::string &
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
Handle to the prepared Inbox entry
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
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.
subscribeForEntryEvents
Subscribes for events in given Inbox.
Params
inboxId
const std::string &
unsubscribeFromEntryEvents
Unsubscribes from events in given Inbox.
Params
inboxId
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.