Interface SendMessageRequest<T extends AppMessageBody>
public interface SendMessageRequest<T extends AppMessageBody>
This is the request body for sending a message.
app_id
, recipient
, and
message
are all required fields.-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
SendMessageRequest.Builder<T extends AppMessageBody>
Dedicated Builder -
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends AppMessageBody>
SendMessageRequest.Builder<T> builder()
Getting buildergetAppId()
The ID of the app sending the message.Overwrites the default callback url for delivery receipts for this message The REST URL should be of the form:http://host[:port]/path
Explicitly define the channels and order in which they are tried when sending the message.Channel-specific properties.Metadata that should be associated with the conversation.Get conversationMetadataUpdateStrategyAn arbitrary identifier that will be propagated to callbacks related to this message, including MO replies.Get messageMetadata that should be associated with the message.Get processingStrategygetQueue()
Get queueGet recipientgetTtl()
The timeout allotted for sending the message, expressed in seconds.
-
Method Details
-
getAppId
String getAppId()The ID of the app sending the message.- Returns:
- appId
-
getCallbackUrl
String getCallbackUrl()Overwrites the default callback url for delivery receipts for this message The REST URL should be of the form:http://host[:port]/path
- Returns:
- callbackUrl
-
getChannelPriorityOrder
List<ConversationChannel> getChannelPriorityOrder()Explicitly define the channels and order in which they are tried when sending the message. All channels provided in this field must be configured in the corresponding Conversation API app, or the request will be rejected. Which channels the API will try and their priority is defined by: 1.channel_priority_order
if available. 2.recipient.identified_by.channel_identities
if available. 3. When recipient is acontact_id
: - if a conversation with the contact exists: the active channel of the conversation is tried first. - the existing channels for the contact are ordered by contact channel preferences if given. - lastly the existing channels for the contact are ordered by the app priority.- Returns:
- channelPriorityOrder
-
getChannelProperties
Channel-specific properties. The key in the map must point to a valid channel property key as defined by the enum ChannelPropertyKeys. The maximum allowed property value length is 1024 characters.- Returns:
- channelProperties
-
getMessage
AppMessage<T> getMessage()Get message- Returns:
- message
-
getMessageMetadata
String getMessageMetadata()Metadata that should be associated with the message. Returned in themetadata
field of a Message Delivery Receipt. Up to 1024 characters long.- Returns:
- messageMetadata
-
getConversationMetadata
Object getConversationMetadata()Metadata that should be associated with the conversation. This metadata will be propagated on MO callbacks associated with this conversation. Up to 1024 characters long. Note that the MO callback will always use the last metadata available in the conversation. Important notes: - If you send a message with theconversation_metadata
field populated, and then send another message without populating theconversation_metadata
field, the original metadata will continue be propagated on the related MO callbacks. - If you send a message with theconversation_metadata
field populated, and then send another message with a different value forconversation_metadata
in the same conversation, the latest metadata value overwrites the existing one. So, future MO callbacks will include the new metadata. - Theconversation_metadata
only accepts json objects. Currently only returned in themessage_metadata
field of an Inbound Message callback.- Returns:
- conversationMetadata
-
getQueue
MessageQueue getQueue()Get queue- Returns:
- queue
-
getRecipient
Recipient getRecipient()Get recipient- Returns:
- recipient
-
getTtl
Integer getTtl()The timeout allotted for sending the message, expressed in seconds. Passed to channels which support it and emulated by the Conversation API for channels without ttl support but with message retract/unsend functionality. Channel failover will not be performed for messages with an expired TTL. The format is an integer with the suffixs
(for seconds). Valid integer range is 3 to 315,576,000,000 (inclusive). Example values include10s
(10 seconds) and86400s
(24 hours).- Returns:
- ttl
-
getProcessingStrategy
ProcessingStrategy getProcessingStrategy()Get processingStrategy- Returns:
- processingStrategy
-
getCorrelationId
String getCorrelationId()An arbitrary identifier that will be propagated to callbacks related to this message, including MO replies. Only applicable to messages sent with theCONVERSATION
processing mode. Up to 128 characters long.- Returns:
- correlationId
-
getConversationMetadataUpdateStrategy
MetadataUpdateStrategy getConversationMetadataUpdateStrategy()Get conversationMetadataUpdateStrategy- Returns:
- conversationMetadataUpdateStrategy
-
builder
Getting builder- Returns:
- New Builder instance
-