Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
Ring
AWS
Documentation
Support
Contact Us
My Cases
Get Started
Design and Develop
Publish
Reference
Support
Native
Skip to main content

Interface IMessageBuilder

interface IMessageBuilder
Extends com.amazon.apmf.IStandard Message builder.

Methods

originator()

IMessageBuilder* originator(MessageContact* contact)
Set message originator contact.

Parameters

contact
MessageContact* — Required Originator MessageContact.

Returns

IMessageBuilder* Returns pointer to IMessageBuilder self.

addRecipient()

IMessageBuilder* addRecipient(MessageContact* contact)
Add message recipient contact. Application can call it multiple times to indicate additional recipients. The properties might be empty strings if not known. Based on the message type, the following properties are required:
  • email: email property must be provided.
  • SMS: telephone property must be provided.
  • MMS: one of email or telephone must be provided.

Parameters

contact
MessageContact* — Required Recipient MessageContact.

Returns

IMessageBuilder* Returns pointer to IMessageBuilder self.

messageType()

IMessageBuilder* messageType(MessageType* messageType)
Set message type. This is a required parameter. Message type IM is only allowed if message repository supports the MessageRepositoryFeature::MESSAGE_FORMAT_VERSION_1_1 feature.

Parameters

messageType
MessageType* — Required MessageType.

Returns

IMessageBuilder* Returns pointer to IMessageBuilder self.

charset()

IMessageBuilder* charset(MessageCharset* charset)
Set message character set. Indicates the character set used by the message contents. Only used if the message contains textual content.

Parameters

charset
MessageCharset* — Required MessageCharset.

Returns

IMessageBuilder* Returns pointer to IMessageBuilder self.

encoding()

IMessageBuilder* encoding(MessageEncoding* encoding)
Set message encoding. Indicates the encoding used by the message contents.

Parameters

encoding
MessageEncoding* — Required MessageEncoding.

Returns

IMessageBuilder* Returns pointer to IMessageBuilder self.

language()

IMessageBuilder* language(MessageLanguage* language)
Set message language. Indicates the language of the message. Only used if the message contains textual content.

Parameters

language
MessageLanguage* — Required MessageLanguage.

Returns

IMessageBuilder* Returns pointer to IMessageBuilder self.

content()

IMessageBuilder* content(u8[] content)
Set message content. This is a required parameter.

Parameters

content
u8[] — Required Message content as array of bytes.

Returns

IMessageBuilder* Returns pointer to IMessageBuilder self.

forward()

IMessageBuilder* forward(IMessage* message)
Set message to be forwarded. If forwarding a message, the message provided must be an existing message known by the message repository. Note that this copies all parameters of the provided message to the builder, which overwrites previously set parameters. The message textual contents is modified according to the MessageTextModify set in the MessageSendSettings. Only used if the message repository supports the MessageRepositoryFeature::MESSAGE_FORWARDING feature.

Parameters

message
IMessage* — Required Message to be forwarded.

Returns

IMessageBuilder* Returns pointer to IMessageBuilder self.

Throws


build()

IMessage* build()
Build the IMessage.

Returns

IMessage* Returns pointer to IMessage.

Throws


Last modified on October 29, 2026