Send Message
Create an Arbitrary Message transaction. POST only.
Request: Refer to Create Transaction Request for common parameters.
- requestType is sendMessage
- recipient is the account ID of the recipient (optional)
- recipientPublicKey is the public key of the receiving account (optional, enhances security of a new account)
- message is either UTF-8 text or a string of hex digits (perhaps previously encoded using an arbitrary algorithm) to be converted into a bytecode with a maximum length of one kilobyte, 42 kilobytes if prunable (optional)
- messageIsText is false if the message is a hex string, otherwise the message is text (optional)
- messageIsPrunable is true if the message is prunable (optional)
- messageToEncrypt is either UTF-8 text or a string of hex digits to be compressed (unless compressMessageToEncrypt is false) and converted into a bytecode with a maximum length of one kilobyte, 42 kilobytes if prunable, then encrypted using AES (optional)
- messageToEncryptIsText is false if the message to encrypt is a hex string, otherwise the message to encrypt is text (optional)
- encryptedMessageData is already encrypted data which overrides messageToEncrypt if provided (optional)
- encryptedMessageNonce is a unique 32-byte number which cannot be reused (optional unless encryptedMessageData is provided)
- encryptedMessageIsPrunable is true if the encrypted message is prunable (optional)
- compressMessageToEncrypt is false to prevent gzip compression before encryption (optional)
- messageToEncryptToSelf is either UTF-8 text or a string of hex digits to be compressed (unless compressMessageToEncryptToSelf is false) and converted into a one kilobyte maximum bytecode then encrypted with AES, then sent to the sending account (optional)
- messageToEncryptToSelfIsText is false if the message to self-encrypt is a hex string, otherwise the message to encrypt is text (optional)
- encryptToSelfMessageData is already encrypted data which overrides messageToEncryptToSelf if provided (optional)
- encryptToSelfMessageNonce is a unique 32-byte number which cannot be reused (optional unless encryptToSelfMessageData is provided)
- compressMessageToEncryptToSelf is false to prevent gzip compression before encryption (optional)
Note: Any combination (including none or all) of the three options plain message, messageToEncrypt, and messageToEncryptToSelf will be included in the transaction. However, one and only one prunable message may be included in a single transaction if there is not already a message of the same type (either plain or encrypted).
Note: The encryptedMessageData-encryptedMessageNonce pair or the encryptToSelfMessageData-encryptToSelfMessageNonce pair can be the output of Encrypt To
Response: Refer to Create Transaction Response.