Package com.vonage.client.messages.sms
Class SmsTextRequest.Builder
java.lang.Object
com.vonage.client.messages.MessageRequest.Builder<SmsTextRequest,SmsTextRequest.Builder>
com.vonage.client.messages.sms.SmsTextRequest.Builder
- All Implemented Interfaces:
TextMessageRequest.Builder<SmsTextRequest.Builder>
- Enclosing class:
SmsTextRequest
public static final class SmsTextRequest.Builder
extends MessageRequest.Builder<SmsTextRequest,SmsTextRequest.Builder>
implements TextMessageRequest.Builder<SmsTextRequest.Builder>
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the MessageRequest.(OPTIONAL) A string parameter that satisfies regulatory requirements when sending an SMS to specific countries.encodingType(EncodingType encodingType) (OPTIONAL) The encoding type to use for the message.(OPTIONAL) A string parameter that satisfies regulatory requirements when sending an SMS to specific countries.(REQUIRED) Sets the text field.ttl(int ttl) (OPTIONAL) The duration in milliseconds the delivery of a message will be attempted.Methods inherited from class com.vonage.client.messages.MessageRequest.Builder
caption, clientRef, custom, from, name, to, url, webhookUrl, webhookVersion
-
Method Details
-
text
(REQUIRED) Sets the text field. Must be between 1 and 1000 characters. The Messages API automatically detects unicode characters when sending SMS and sends the message as a unicode SMS. Read more about concatenation and encoding.- Specified by:
textin interfaceTextMessageRequest.Builder<SmsTextRequest.Builder>- Overrides:
textin classMessageRequest.Builder<SmsTextRequest,SmsTextRequest.Builder> - Parameters:
text- The text string.- Returns:
- This builder.
-
encodingType
(OPTIONAL) The encoding type to use for the message. If set to either EncodingType.TEXT or EncodingType.UNICODE, the specified type will be used. If set to EncodingType.AUTO (the default), the Messages API will automatically set the type based on the content of text; i.e. if unicode characters are detected in text, then the message will be encoded as unicode, and otherwise as text.- Parameters:
encodingType- The message encoding type as an enum.- Returns:
- This builder.
- Since:
- 8.1.0
-
contentId
(OPTIONAL) A string parameter that satisfies regulatory requirements when sending an SMS to specific countries.- Parameters:
contentId- The content ID as a string.- Returns:
- This builder.
- Since:
- 8.1.0
-
entityId
(OPTIONAL) A string parameter that satisfies regulatory requirements when sending an SMS to specific countries.- Parameters:
entityId- The entity ID as a string.- Returns:
- This builder.
- Since:
- 8.1.0
-
ttl
Description copied from class:MessageRequest.Builder(OPTIONAL) The duration in milliseconds the delivery of a message will be attempted. By default, Vonage attempts delivery for 72 hours, however the maximum effective value depends on the operator and is typically 24 to 48 hours. We recommend this value should be kept at its default or at least 30 minutes.- Overrides:
ttlin classMessageRequest.Builder<SmsTextRequest,SmsTextRequest.Builder> - Parameters:
ttl- The time-to-live for this message before abandoning delivery attempts, in milliseconds.- Returns:
- This builder.
-
build
Description copied from class:MessageRequest.BuilderBuilds the MessageRequest.- Specified by:
buildin classMessageRequest.Builder<SmsTextRequest,SmsTextRequest.Builder> - Returns:
- A MessageRequest, populated with all fields from this builder.
-