Class SmsRequest
Represents an SMS text message request to be sent via the Messages API.
public class SmsRequest : MessageRequestBase, IMessage
- Inheritance
-
SmsRequest
- Implements
- Inherited Members
Properties
Channel
The channel to send to.
public override MessagesChannel Channel { get; }
Property Value
MessageType
The type of message to send.
public override MessagesMessageType MessageType { get; }
Property Value
PoolId
Sets the Id of the number pool managing the number.
[JsonPropertyOrder(11)]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string PoolId { get; set; }
Property Value
Settings
An object of optional settings for the SMS message.
[JsonPropertyName("sms")]
[JsonPropertyOrder(9)]
public OptionalSettings Settings { get; set; }
Property Value
Text
The text of message to send; limited to 1000 characters. Unless unless text or unicode has been explicitly set as the value for sms.encoding_type, the Messages API automatically detects whether unicode characters are present in text and sends the message as appropriate as either a text or unicode SMS. For more information on concatenation and encoding please visit: developer.vonage.com/messaging/sms/guides/concatenation-and-encoding.
public string Text { get; set; }
Property Value
TimeToLive
The duration in seconds the delivery of an SMS will be attempted. By default Vonage attempts delivery for 72 hours, however the maximum effective value depends on the operator and is typically 24 - 48 hours. We recommend this value should be kept at its default or at least 30 minutes.
[JsonPropertyName("ttl")]
[JsonPropertyOrder(8)]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public int TimeToLive { get; set; }
Property Value
TrustedNumber
Allows to skip fraud checks on a per-message basis. The feature is feature-flagged and must be enabled for the api key.
[JsonIgnore]
[Obsolete("Favor 'TrustedRecipient' instead.")]
public bool TrustedNumber { get; set; }
Property Value
TrustedRecipient
Setting this parameter to true overrides, on a per-message basis, any protections set up via Fraud Defender (Traffic Rules, SMS Burst Protection, AIT Protection). This parameter only has any effect for accounts subscribed to Fraud Defender Premium.
[JsonPropertyOrder(10)]
[JsonPropertyName("trusted_recipient")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public bool TrustedRecipient { get; set; }
Property Value
Methods
GetErrors()
Returns any validation errors for this message. An empty collection means the message is valid.
public override IEnumerable<string> GetErrors()
Returns
- IEnumerable<string>
A collection of error messages.