Class: Twilio::REST::PreviewMessaging::V1::MessageList::CreateMessagesRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/twilio-ruby/rest/preview_messaging/v1/message.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(payload) ⇒ CreateMessagesRequest

Returns a new instance of CreateMessagesRequest.



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/twilio-ruby/rest/preview_messaging/v1/message.rb', line 41

def initialize(payload)
        @messages = payload["messages"]
        @from = payload["from"]
        @messaging_service_sid = payload["messaging_service_sid"]
        @body = payload["body"]
        @content_sid = payload["content_sid"]
        @media_url = payload["media_url"]
        @status_callback = payload["status_callback"]
        @validity_period = payload["validity_period"]
        @send_at = payload["send_at"]
        @schedule_type = payload["schedule_type"]
        @shorten_urls = payload["shorten_urls"]
        @send_as_mms = payload["send_as_mms"]
        @max_price = payload["max_price"]
        @attempt = payload["attempt"]
        @smart_encoded = payload["smart_encoded"]
        @force_delivery = payload["force_delivery"]
        @application_sid = payload["application_sid"]
end

Instance Attribute Details

#application_sidObject

Parameters:

  • : (messages)
    Array<MessageList.MessagingV1Message>
  • : (from)
    String

    A Twilio phone number in [E.164](www.twilio.com/docs/glossary/what-e164) format, an [alphanumeric sender ID](www.twilio.com/docs/sms/send-messages#use-an-alphanumeric-sender-id), or a [Channel Endpoint address](www.twilio.com/docs/sms/channels#channel-addresses) that is enabled for the type of message you want to send. Phone numbers or [short codes](www.twilio.com/docs/sms/api/short-code) purchased from Twilio also work here. You cannot, for example, spoof messages from a private cell phone number. If you are using ‘messaging_service_sid`, this parameter must be empty.

  • : (messaging_service_sid)
    String

    The SID of the [Messaging Service](www.twilio.com/docs/sms/services#send-a-message-with-copilot) you want to associate with the Message. Set this parameter to use the [Messaging Service Settings and Copilot Features](www.twilio.com/console/sms/services) you have configured and leave the ‘from` parameter empty. When only this parameter is set, Twilio will use your enabled Copilot Features to select the `from` phone number for delivery.

  • : (body)
    String

    The text of the message you want to send. Can be up to 1,600 characters in length.

  • : (content_sid)
    String

    The SID of the preconfigured [Content Template](www.twilio.com/docs/content-api/create-and-send-your-first-content-api-template#create-a-template) you want to associate with the Message. Must be used in conjuction with a preconfigured [Messaging Service Settings and Copilot Features](www.twilio.com/console/sms/services) When this parameter is set, Twilio will use your configured content template and the provided ‘ContentVariables`. This Twilio product is currently in Private Beta.

  • : (media_url)
    Array<String>

    The URL of the media to send with the message. The media can be of type ‘gif`, `png`, and `jpeg` and will be formatted correctly on the recipient’s device. The media size limit is 5MB for supported file types (JPEG, PNG, GIF) and 500KB for [other types](www.twilio.com/docs/sms/accepted-mime-types) of accepted media. To send more than one image in the message body, provide multiple ‘media_url` parameters in the POST request. You can include up to 10 `media_url` parameters per message. You can send images in an SMS message in only the US and Canada.

  • : (status_callback)
    String

    The URL we should call using the "status_callback_method" to send status information to your application. If specified, we POST these message status changes to the URL - queued, failed, sent, delivered, or undelivered. Twilio will POST its [standard request parameters](www.twilio.com/docs/messaging/twiml#request-parameters) as well as some additional parameters including "MessageSid", "MessageStatus", and "ErrorCode". If you include this parameter with the "messaging_service_sid", we use this URL instead of the Status Callback URL of the [Messaging Service](www.twilio.com/docs/messaging/services/api). URLs must contain a valid hostname and underscores are not allowed.

  • : (validity_period)
    String

    How long in seconds the message can remain in our outgoing message queue. After this period elapses, the message fails and we call your status callback. Can be between 1 and the default value of 14,400 seconds. After a message has been accepted by a carrier, however, we cannot guarantee that the message will not be queued after this period. We recommend that this value be at least 5 seconds.

  • : (send_at)
    String

    The time at which Twilio will send the message. This parameter can be used to schedule a message to be sent at a particular time. Must be in ISO 8601 format.

  • : (schedule_type)
    String

    This parameter indicates your intent to schedule a message. Pass the value ‘fixed` to schedule a message at a fixed time. This parameter works in conjuction with the `SendAt` parameter.

  • : (shorten_urls)
    Boolean

    Determines the usage of Click Tracking. Setting it to ‘true` will instruct Twilio to replace all links in the Message with a shortened version based on the associated Domain Sid and track clicks on them. If this parameter is not set on an API call, we will use the value set on the Messaging Service. If this parameter is not set and the value is not configured on the Messaging Service used this will default to `false`.

  • : (send_as_mms)
    Boolean

    If set to True, Twilio will deliver the message as a single MMS message, regardless of the presence of media.

  • : (max_price)
    Float

    The maximum total price in US dollars that you will pay for the message to be delivered. Can be a decimal value that has up to 4 decimal places. All messages are queued for delivery and the message cost is checked before the message is sent. If the cost exceeds max_price, the message will fail and a status of Failed is sent to the status callback. If MaxPrice is not set, the message cost is not checked.

  • : (attempt)
    String

    Total number of attempts made ( including this ) to send out the message regardless of the provider used

  • : (smart_encoded)
    Boolean

    This parameter indicates whether to detect Unicode characters that have a similar GSM-7 character and replace them. Can be true or false.

  • : (force_delivery)
    Boolean

    This parameter allows Twilio to send SMS traffic to carriers without checking/caring whether the destination number is a mobile or a landline.

  • : (application_sid)
    String

    The SID of the application that should receive message status. We POST a message_sid parameter and a message_status parameter with a value of sent or failed to the application’s message_status_callback. If a status_callback parameter is also passed, it will be ignored and the application’s message_status_callback parameter will be used.



40
41
42
# File 'lib/twilio-ruby/rest/preview_messaging/v1/message.rb', line 40

def application_sid
  @application_sid
end

#attemptObject

Parameters:

  • : (messages)
    Array<MessageList.MessagingV1Message>
  • : (from)
    String

    A Twilio phone number in [E.164](www.twilio.com/docs/glossary/what-e164) format, an [alphanumeric sender ID](www.twilio.com/docs/sms/send-messages#use-an-alphanumeric-sender-id), or a [Channel Endpoint address](www.twilio.com/docs/sms/channels#channel-addresses) that is enabled for the type of message you want to send. Phone numbers or [short codes](www.twilio.com/docs/sms/api/short-code) purchased from Twilio also work here. You cannot, for example, spoof messages from a private cell phone number. If you are using ‘messaging_service_sid`, this parameter must be empty.

  • : (messaging_service_sid)
    String

    The SID of the [Messaging Service](www.twilio.com/docs/sms/services#send-a-message-with-copilot) you want to associate with the Message. Set this parameter to use the [Messaging Service Settings and Copilot Features](www.twilio.com/console/sms/services) you have configured and leave the ‘from` parameter empty. When only this parameter is set, Twilio will use your enabled Copilot Features to select the `from` phone number for delivery.

  • : (body)
    String

    The text of the message you want to send. Can be up to 1,600 characters in length.

  • : (content_sid)
    String

    The SID of the preconfigured [Content Template](www.twilio.com/docs/content-api/create-and-send-your-first-content-api-template#create-a-template) you want to associate with the Message. Must be used in conjuction with a preconfigured [Messaging Service Settings and Copilot Features](www.twilio.com/console/sms/services) When this parameter is set, Twilio will use your configured content template and the provided ‘ContentVariables`. This Twilio product is currently in Private Beta.

  • : (media_url)
    Array<String>

    The URL of the media to send with the message. The media can be of type ‘gif`, `png`, and `jpeg` and will be formatted correctly on the recipient’s device. The media size limit is 5MB for supported file types (JPEG, PNG, GIF) and 500KB for [other types](www.twilio.com/docs/sms/accepted-mime-types) of accepted media. To send more than one image in the message body, provide multiple ‘media_url` parameters in the POST request. You can include up to 10 `media_url` parameters per message. You can send images in an SMS message in only the US and Canada.

  • : (status_callback)
    String

    The URL we should call using the "status_callback_method" to send status information to your application. If specified, we POST these message status changes to the URL - queued, failed, sent, delivered, or undelivered. Twilio will POST its [standard request parameters](www.twilio.com/docs/messaging/twiml#request-parameters) as well as some additional parameters including "MessageSid", "MessageStatus", and "ErrorCode". If you include this parameter with the "messaging_service_sid", we use this URL instead of the Status Callback URL of the [Messaging Service](www.twilio.com/docs/messaging/services/api). URLs must contain a valid hostname and underscores are not allowed.

  • : (validity_period)
    String

    How long in seconds the message can remain in our outgoing message queue. After this period elapses, the message fails and we call your status callback. Can be between 1 and the default value of 14,400 seconds. After a message has been accepted by a carrier, however, we cannot guarantee that the message will not be queued after this period. We recommend that this value be at least 5 seconds.

  • : (send_at)
    String

    The time at which Twilio will send the message. This parameter can be used to schedule a message to be sent at a particular time. Must be in ISO 8601 format.

  • : (schedule_type)
    String

    This parameter indicates your intent to schedule a message. Pass the value ‘fixed` to schedule a message at a fixed time. This parameter works in conjuction with the `SendAt` parameter.

  • : (shorten_urls)
    Boolean

    Determines the usage of Click Tracking. Setting it to ‘true` will instruct Twilio to replace all links in the Message with a shortened version based on the associated Domain Sid and track clicks on them. If this parameter is not set on an API call, we will use the value set on the Messaging Service. If this parameter is not set and the value is not configured on the Messaging Service used this will default to `false`.

  • : (send_as_mms)
    Boolean

    If set to True, Twilio will deliver the message as a single MMS message, regardless of the presence of media.

  • : (max_price)
    Float

    The maximum total price in US dollars that you will pay for the message to be delivered. Can be a decimal value that has up to 4 decimal places. All messages are queued for delivery and the message cost is checked before the message is sent. If the cost exceeds max_price, the message will fail and a status of Failed is sent to the status callback. If MaxPrice is not set, the message cost is not checked.

  • : (attempt)
    String

    Total number of attempts made ( including this ) to send out the message regardless of the provider used

  • : (smart_encoded)
    Boolean

    This parameter indicates whether to detect Unicode characters that have a similar GSM-7 character and replace them. Can be true or false.

  • : (force_delivery)
    Boolean

    This parameter allows Twilio to send SMS traffic to carriers without checking/caring whether the destination number is a mobile or a landline.

  • : (application_sid)
    String

    The SID of the application that should receive message status. We POST a message_sid parameter and a message_status parameter with a value of sent or failed to the application’s message_status_callback. If a status_callback parameter is also passed, it will be ignored and the application’s message_status_callback parameter will be used.



40
41
42
# File 'lib/twilio-ruby/rest/preview_messaging/v1/message.rb', line 40

def attempt
  @attempt
end

#bodyObject

Parameters:

  • : (messages)
    Array<MessageList.MessagingV1Message>
  • : (from)
    String

    A Twilio phone number in [E.164](www.twilio.com/docs/glossary/what-e164) format, an [alphanumeric sender ID](www.twilio.com/docs/sms/send-messages#use-an-alphanumeric-sender-id), or a [Channel Endpoint address](www.twilio.com/docs/sms/channels#channel-addresses) that is enabled for the type of message you want to send. Phone numbers or [short codes](www.twilio.com/docs/sms/api/short-code) purchased from Twilio also work here. You cannot, for example, spoof messages from a private cell phone number. If you are using ‘messaging_service_sid`, this parameter must be empty.

  • : (messaging_service_sid)
    String

    The SID of the [Messaging Service](www.twilio.com/docs/sms/services#send-a-message-with-copilot) you want to associate with the Message. Set this parameter to use the [Messaging Service Settings and Copilot Features](www.twilio.com/console/sms/services) you have configured and leave the ‘from` parameter empty. When only this parameter is set, Twilio will use your enabled Copilot Features to select the `from` phone number for delivery.

  • : (body)
    String

    The text of the message you want to send. Can be up to 1,600 characters in length.

  • : (content_sid)
    String

    The SID of the preconfigured [Content Template](www.twilio.com/docs/content-api/create-and-send-your-first-content-api-template#create-a-template) you want to associate with the Message. Must be used in conjuction with a preconfigured [Messaging Service Settings and Copilot Features](www.twilio.com/console/sms/services) When this parameter is set, Twilio will use your configured content template and the provided ‘ContentVariables`. This Twilio product is currently in Private Beta.

  • : (media_url)
    Array<String>

    The URL of the media to send with the message. The media can be of type ‘gif`, `png`, and `jpeg` and will be formatted correctly on the recipient’s device. The media size limit is 5MB for supported file types (JPEG, PNG, GIF) and 500KB for [other types](www.twilio.com/docs/sms/accepted-mime-types) of accepted media. To send more than one image in the message body, provide multiple ‘media_url` parameters in the POST request. You can include up to 10 `media_url` parameters per message. You can send images in an SMS message in only the US and Canada.

  • : (status_callback)
    String

    The URL we should call using the "status_callback_method" to send status information to your application. If specified, we POST these message status changes to the URL - queued, failed, sent, delivered, or undelivered. Twilio will POST its [standard request parameters](www.twilio.com/docs/messaging/twiml#request-parameters) as well as some additional parameters including "MessageSid", "MessageStatus", and "ErrorCode". If you include this parameter with the "messaging_service_sid", we use this URL instead of the Status Callback URL of the [Messaging Service](www.twilio.com/docs/messaging/services/api). URLs must contain a valid hostname and underscores are not allowed.

  • : (validity_period)
    String

    How long in seconds the message can remain in our outgoing message queue. After this period elapses, the message fails and we call your status callback. Can be between 1 and the default value of 14,400 seconds. After a message has been accepted by a carrier, however, we cannot guarantee that the message will not be queued after this period. We recommend that this value be at least 5 seconds.

  • : (send_at)
    String

    The time at which Twilio will send the message. This parameter can be used to schedule a message to be sent at a particular time. Must be in ISO 8601 format.

  • : (schedule_type)
    String

    This parameter indicates your intent to schedule a message. Pass the value ‘fixed` to schedule a message at a fixed time. This parameter works in conjuction with the `SendAt` parameter.

  • : (shorten_urls)
    Boolean

    Determines the usage of Click Tracking. Setting it to ‘true` will instruct Twilio to replace all links in the Message with a shortened version based on the associated Domain Sid and track clicks on them. If this parameter is not set on an API call, we will use the value set on the Messaging Service. If this parameter is not set and the value is not configured on the Messaging Service used this will default to `false`.

  • : (send_as_mms)
    Boolean

    If set to True, Twilio will deliver the message as a single MMS message, regardless of the presence of media.

  • : (max_price)
    Float

    The maximum total price in US dollars that you will pay for the message to be delivered. Can be a decimal value that has up to 4 decimal places. All messages are queued for delivery and the message cost is checked before the message is sent. If the cost exceeds max_price, the message will fail and a status of Failed is sent to the status callback. If MaxPrice is not set, the message cost is not checked.

  • : (attempt)
    String

    Total number of attempts made ( including this ) to send out the message regardless of the provider used

  • : (smart_encoded)
    Boolean

    This parameter indicates whether to detect Unicode characters that have a similar GSM-7 character and replace them. Can be true or false.

  • : (force_delivery)
    Boolean

    This parameter allows Twilio to send SMS traffic to carriers without checking/caring whether the destination number is a mobile or a landline.

  • : (application_sid)
    String

    The SID of the application that should receive message status. We POST a message_sid parameter and a message_status parameter with a value of sent or failed to the application’s message_status_callback. If a status_callback parameter is also passed, it will be ignored and the application’s message_status_callback parameter will be used.



40
41
42
# File 'lib/twilio-ruby/rest/preview_messaging/v1/message.rb', line 40

def body
  @body
end

#content_sidObject

Parameters:

  • : (messages)
    Array<MessageList.MessagingV1Message>
  • : (from)
    String

    A Twilio phone number in [E.164](www.twilio.com/docs/glossary/what-e164) format, an [alphanumeric sender ID](www.twilio.com/docs/sms/send-messages#use-an-alphanumeric-sender-id), or a [Channel Endpoint address](www.twilio.com/docs/sms/channels#channel-addresses) that is enabled for the type of message you want to send. Phone numbers or [short codes](www.twilio.com/docs/sms/api/short-code) purchased from Twilio also work here. You cannot, for example, spoof messages from a private cell phone number. If you are using ‘messaging_service_sid`, this parameter must be empty.

  • : (messaging_service_sid)
    String

    The SID of the [Messaging Service](www.twilio.com/docs/sms/services#send-a-message-with-copilot) you want to associate with the Message. Set this parameter to use the [Messaging Service Settings and Copilot Features](www.twilio.com/console/sms/services) you have configured and leave the ‘from` parameter empty. When only this parameter is set, Twilio will use your enabled Copilot Features to select the `from` phone number for delivery.

  • : (body)
    String

    The text of the message you want to send. Can be up to 1,600 characters in length.

  • : (content_sid)
    String

    The SID of the preconfigured [Content Template](www.twilio.com/docs/content-api/create-and-send-your-first-content-api-template#create-a-template) you want to associate with the Message. Must be used in conjuction with a preconfigured [Messaging Service Settings and Copilot Features](www.twilio.com/console/sms/services) When this parameter is set, Twilio will use your configured content template and the provided ‘ContentVariables`. This Twilio product is currently in Private Beta.

  • : (media_url)
    Array<String>

    The URL of the media to send with the message. The media can be of type ‘gif`, `png`, and `jpeg` and will be formatted correctly on the recipient’s device. The media size limit is 5MB for supported file types (JPEG, PNG, GIF) and 500KB for [other types](www.twilio.com/docs/sms/accepted-mime-types) of accepted media. To send more than one image in the message body, provide multiple ‘media_url` parameters in the POST request. You can include up to 10 `media_url` parameters per message. You can send images in an SMS message in only the US and Canada.

  • : (status_callback)
    String

    The URL we should call using the "status_callback_method" to send status information to your application. If specified, we POST these message status changes to the URL - queued, failed, sent, delivered, or undelivered. Twilio will POST its [standard request parameters](www.twilio.com/docs/messaging/twiml#request-parameters) as well as some additional parameters including "MessageSid", "MessageStatus", and "ErrorCode". If you include this parameter with the "messaging_service_sid", we use this URL instead of the Status Callback URL of the [Messaging Service](www.twilio.com/docs/messaging/services/api). URLs must contain a valid hostname and underscores are not allowed.

  • : (validity_period)
    String

    How long in seconds the message can remain in our outgoing message queue. After this period elapses, the message fails and we call your status callback. Can be between 1 and the default value of 14,400 seconds. After a message has been accepted by a carrier, however, we cannot guarantee that the message will not be queued after this period. We recommend that this value be at least 5 seconds.

  • : (send_at)
    String

    The time at which Twilio will send the message. This parameter can be used to schedule a message to be sent at a particular time. Must be in ISO 8601 format.

  • : (schedule_type)
    String

    This parameter indicates your intent to schedule a message. Pass the value ‘fixed` to schedule a message at a fixed time. This parameter works in conjuction with the `SendAt` parameter.

  • : (shorten_urls)
    Boolean

    Determines the usage of Click Tracking. Setting it to ‘true` will instruct Twilio to replace all links in the Message with a shortened version based on the associated Domain Sid and track clicks on them. If this parameter is not set on an API call, we will use the value set on the Messaging Service. If this parameter is not set and the value is not configured on the Messaging Service used this will default to `false`.

  • : (send_as_mms)
    Boolean

    If set to True, Twilio will deliver the message as a single MMS message, regardless of the presence of media.

  • : (max_price)
    Float

    The maximum total price in US dollars that you will pay for the message to be delivered. Can be a decimal value that has up to 4 decimal places. All messages are queued for delivery and the message cost is checked before the message is sent. If the cost exceeds max_price, the message will fail and a status of Failed is sent to the status callback. If MaxPrice is not set, the message cost is not checked.

  • : (attempt)
    String

    Total number of attempts made ( including this ) to send out the message regardless of the provider used

  • : (smart_encoded)
    Boolean

    This parameter indicates whether to detect Unicode characters that have a similar GSM-7 character and replace them. Can be true or false.

  • : (force_delivery)
    Boolean

    This parameter allows Twilio to send SMS traffic to carriers without checking/caring whether the destination number is a mobile or a landline.

  • : (application_sid)
    String

    The SID of the application that should receive message status. We POST a message_sid parameter and a message_status parameter with a value of sent or failed to the application’s message_status_callback. If a status_callback parameter is also passed, it will be ignored and the application’s message_status_callback parameter will be used.



40
41
42
# File 'lib/twilio-ruby/rest/preview_messaging/v1/message.rb', line 40

def content_sid
  @content_sid
end

#force_deliveryObject

Parameters:

  • : (messages)
    Array<MessageList.MessagingV1Message>
  • : (from)
    String

    A Twilio phone number in [E.164](www.twilio.com/docs/glossary/what-e164) format, an [alphanumeric sender ID](www.twilio.com/docs/sms/send-messages#use-an-alphanumeric-sender-id), or a [Channel Endpoint address](www.twilio.com/docs/sms/channels#channel-addresses) that is enabled for the type of message you want to send. Phone numbers or [short codes](www.twilio.com/docs/sms/api/short-code) purchased from Twilio also work here. You cannot, for example, spoof messages from a private cell phone number. If you are using ‘messaging_service_sid`, this parameter must be empty.

  • : (messaging_service_sid)
    String

    The SID of the [Messaging Service](www.twilio.com/docs/sms/services#send-a-message-with-copilot) you want to associate with the Message. Set this parameter to use the [Messaging Service Settings and Copilot Features](www.twilio.com/console/sms/services) you have configured and leave the ‘from` parameter empty. When only this parameter is set, Twilio will use your enabled Copilot Features to select the `from` phone number for delivery.

  • : (body)
    String

    The text of the message you want to send. Can be up to 1,600 characters in length.

  • : (content_sid)
    String

    The SID of the preconfigured [Content Template](www.twilio.com/docs/content-api/create-and-send-your-first-content-api-template#create-a-template) you want to associate with the Message. Must be used in conjuction with a preconfigured [Messaging Service Settings and Copilot Features](www.twilio.com/console/sms/services) When this parameter is set, Twilio will use your configured content template and the provided ‘ContentVariables`. This Twilio product is currently in Private Beta.

  • : (media_url)
    Array<String>

    The URL of the media to send with the message. The media can be of type ‘gif`, `png`, and `jpeg` and will be formatted correctly on the recipient’s device. The media size limit is 5MB for supported file types (JPEG, PNG, GIF) and 500KB for [other types](www.twilio.com/docs/sms/accepted-mime-types) of accepted media. To send more than one image in the message body, provide multiple ‘media_url` parameters in the POST request. You can include up to 10 `media_url` parameters per message. You can send images in an SMS message in only the US and Canada.

  • : (status_callback)
    String

    The URL we should call using the "status_callback_method" to send status information to your application. If specified, we POST these message status changes to the URL - queued, failed, sent, delivered, or undelivered. Twilio will POST its [standard request parameters](www.twilio.com/docs/messaging/twiml#request-parameters) as well as some additional parameters including "MessageSid", "MessageStatus", and "ErrorCode". If you include this parameter with the "messaging_service_sid", we use this URL instead of the Status Callback URL of the [Messaging Service](www.twilio.com/docs/messaging/services/api). URLs must contain a valid hostname and underscores are not allowed.

  • : (validity_period)
    String

    How long in seconds the message can remain in our outgoing message queue. After this period elapses, the message fails and we call your status callback. Can be between 1 and the default value of 14,400 seconds. After a message has been accepted by a carrier, however, we cannot guarantee that the message will not be queued after this period. We recommend that this value be at least 5 seconds.

  • : (send_at)
    String

    The time at which Twilio will send the message. This parameter can be used to schedule a message to be sent at a particular time. Must be in ISO 8601 format.

  • : (schedule_type)
    String

    This parameter indicates your intent to schedule a message. Pass the value ‘fixed` to schedule a message at a fixed time. This parameter works in conjuction with the `SendAt` parameter.

  • : (shorten_urls)
    Boolean

    Determines the usage of Click Tracking. Setting it to ‘true` will instruct Twilio to replace all links in the Message with a shortened version based on the associated Domain Sid and track clicks on them. If this parameter is not set on an API call, we will use the value set on the Messaging Service. If this parameter is not set and the value is not configured on the Messaging Service used this will default to `false`.

  • : (send_as_mms)
    Boolean

    If set to True, Twilio will deliver the message as a single MMS message, regardless of the presence of media.

  • : (max_price)
    Float

    The maximum total price in US dollars that you will pay for the message to be delivered. Can be a decimal value that has up to 4 decimal places. All messages are queued for delivery and the message cost is checked before the message is sent. If the cost exceeds max_price, the message will fail and a status of Failed is sent to the status callback. If MaxPrice is not set, the message cost is not checked.

  • : (attempt)
    String

    Total number of attempts made ( including this ) to send out the message regardless of the provider used

  • : (smart_encoded)
    Boolean

    This parameter indicates whether to detect Unicode characters that have a similar GSM-7 character and replace them. Can be true or false.

  • : (force_delivery)
    Boolean

    This parameter allows Twilio to send SMS traffic to carriers without checking/caring whether the destination number is a mobile or a landline.

  • : (application_sid)
    String

    The SID of the application that should receive message status. We POST a message_sid parameter and a message_status parameter with a value of sent or failed to the application’s message_status_callback. If a status_callback parameter is also passed, it will be ignored and the application’s message_status_callback parameter will be used.



40
41
42
# File 'lib/twilio-ruby/rest/preview_messaging/v1/message.rb', line 40

def force_delivery
  @force_delivery
end

#fromObject

Parameters:

  • : (messages)
    Array<MessageList.MessagingV1Message>
  • : (from)
    String

    A Twilio phone number in [E.164](www.twilio.com/docs/glossary/what-e164) format, an [alphanumeric sender ID](www.twilio.com/docs/sms/send-messages#use-an-alphanumeric-sender-id), or a [Channel Endpoint address](www.twilio.com/docs/sms/channels#channel-addresses) that is enabled for the type of message you want to send. Phone numbers or [short codes](www.twilio.com/docs/sms/api/short-code) purchased from Twilio also work here. You cannot, for example, spoof messages from a private cell phone number. If you are using ‘messaging_service_sid`, this parameter must be empty.

  • : (messaging_service_sid)
    String

    The SID of the [Messaging Service](www.twilio.com/docs/sms/services#send-a-message-with-copilot) you want to associate with the Message. Set this parameter to use the [Messaging Service Settings and Copilot Features](www.twilio.com/console/sms/services) you have configured and leave the ‘from` parameter empty. When only this parameter is set, Twilio will use your enabled Copilot Features to select the `from` phone number for delivery.

  • : (body)
    String

    The text of the message you want to send. Can be up to 1,600 characters in length.

  • : (content_sid)
    String

    The SID of the preconfigured [Content Template](www.twilio.com/docs/content-api/create-and-send-your-first-content-api-template#create-a-template) you want to associate with the Message. Must be used in conjuction with a preconfigured [Messaging Service Settings and Copilot Features](www.twilio.com/console/sms/services) When this parameter is set, Twilio will use your configured content template and the provided ‘ContentVariables`. This Twilio product is currently in Private Beta.

  • : (media_url)
    Array<String>

    The URL of the media to send with the message. The media can be of type ‘gif`, `png`, and `jpeg` and will be formatted correctly on the recipient’s device. The media size limit is 5MB for supported file types (JPEG, PNG, GIF) and 500KB for [other types](www.twilio.com/docs/sms/accepted-mime-types) of accepted media. To send more than one image in the message body, provide multiple ‘media_url` parameters in the POST request. You can include up to 10 `media_url` parameters per message. You can send images in an SMS message in only the US and Canada.

  • : (status_callback)
    String

    The URL we should call using the "status_callback_method" to send status information to your application. If specified, we POST these message status changes to the URL - queued, failed, sent, delivered, or undelivered. Twilio will POST its [standard request parameters](www.twilio.com/docs/messaging/twiml#request-parameters) as well as some additional parameters including "MessageSid", "MessageStatus", and "ErrorCode". If you include this parameter with the "messaging_service_sid", we use this URL instead of the Status Callback URL of the [Messaging Service](www.twilio.com/docs/messaging/services/api). URLs must contain a valid hostname and underscores are not allowed.

  • : (validity_period)
    String

    How long in seconds the message can remain in our outgoing message queue. After this period elapses, the message fails and we call your status callback. Can be between 1 and the default value of 14,400 seconds. After a message has been accepted by a carrier, however, we cannot guarantee that the message will not be queued after this period. We recommend that this value be at least 5 seconds.

  • : (send_at)
    String

    The time at which Twilio will send the message. This parameter can be used to schedule a message to be sent at a particular time. Must be in ISO 8601 format.

  • : (schedule_type)
    String

    This parameter indicates your intent to schedule a message. Pass the value ‘fixed` to schedule a message at a fixed time. This parameter works in conjuction with the `SendAt` parameter.

  • : (shorten_urls)
    Boolean

    Determines the usage of Click Tracking. Setting it to ‘true` will instruct Twilio to replace all links in the Message with a shortened version based on the associated Domain Sid and track clicks on them. If this parameter is not set on an API call, we will use the value set on the Messaging Service. If this parameter is not set and the value is not configured on the Messaging Service used this will default to `false`.

  • : (send_as_mms)
    Boolean

    If set to True, Twilio will deliver the message as a single MMS message, regardless of the presence of media.

  • : (max_price)
    Float

    The maximum total price in US dollars that you will pay for the message to be delivered. Can be a decimal value that has up to 4 decimal places. All messages are queued for delivery and the message cost is checked before the message is sent. If the cost exceeds max_price, the message will fail and a status of Failed is sent to the status callback. If MaxPrice is not set, the message cost is not checked.

  • : (attempt)
    String

    Total number of attempts made ( including this ) to send out the message regardless of the provider used

  • : (smart_encoded)
    Boolean

    This parameter indicates whether to detect Unicode characters that have a similar GSM-7 character and replace them. Can be true or false.

  • : (force_delivery)
    Boolean

    This parameter allows Twilio to send SMS traffic to carriers without checking/caring whether the destination number is a mobile or a landline.

  • : (application_sid)
    String

    The SID of the application that should receive message status. We POST a message_sid parameter and a message_status parameter with a value of sent or failed to the application’s message_status_callback. If a status_callback parameter is also passed, it will be ignored and the application’s message_status_callback parameter will be used.



40
41
42
# File 'lib/twilio-ruby/rest/preview_messaging/v1/message.rb', line 40

def from
  @from
end

#max_priceObject

Parameters:

  • : (messages)
    Array<MessageList.MessagingV1Message>
  • : (from)
    String

    A Twilio phone number in [E.164](www.twilio.com/docs/glossary/what-e164) format, an [alphanumeric sender ID](www.twilio.com/docs/sms/send-messages#use-an-alphanumeric-sender-id), or a [Channel Endpoint address](www.twilio.com/docs/sms/channels#channel-addresses) that is enabled for the type of message you want to send. Phone numbers or [short codes](www.twilio.com/docs/sms/api/short-code) purchased from Twilio also work here. You cannot, for example, spoof messages from a private cell phone number. If you are using ‘messaging_service_sid`, this parameter must be empty.

  • : (messaging_service_sid)
    String

    The SID of the [Messaging Service](www.twilio.com/docs/sms/services#send-a-message-with-copilot) you want to associate with the Message. Set this parameter to use the [Messaging Service Settings and Copilot Features](www.twilio.com/console/sms/services) you have configured and leave the ‘from` parameter empty. When only this parameter is set, Twilio will use your enabled Copilot Features to select the `from` phone number for delivery.

  • : (body)
    String

    The text of the message you want to send. Can be up to 1,600 characters in length.

  • : (content_sid)
    String

    The SID of the preconfigured [Content Template](www.twilio.com/docs/content-api/create-and-send-your-first-content-api-template#create-a-template) you want to associate with the Message. Must be used in conjuction with a preconfigured [Messaging Service Settings and Copilot Features](www.twilio.com/console/sms/services) When this parameter is set, Twilio will use your configured content template and the provided ‘ContentVariables`. This Twilio product is currently in Private Beta.

  • : (media_url)
    Array<String>

    The URL of the media to send with the message. The media can be of type ‘gif`, `png`, and `jpeg` and will be formatted correctly on the recipient’s device. The media size limit is 5MB for supported file types (JPEG, PNG, GIF) and 500KB for [other types](www.twilio.com/docs/sms/accepted-mime-types) of accepted media. To send more than one image in the message body, provide multiple ‘media_url` parameters in the POST request. You can include up to 10 `media_url` parameters per message. You can send images in an SMS message in only the US and Canada.

  • : (status_callback)
    String

    The URL we should call using the "status_callback_method" to send status information to your application. If specified, we POST these message status changes to the URL - queued, failed, sent, delivered, or undelivered. Twilio will POST its [standard request parameters](www.twilio.com/docs/messaging/twiml#request-parameters) as well as some additional parameters including "MessageSid", "MessageStatus", and "ErrorCode". If you include this parameter with the "messaging_service_sid", we use this URL instead of the Status Callback URL of the [Messaging Service](www.twilio.com/docs/messaging/services/api). URLs must contain a valid hostname and underscores are not allowed.

  • : (validity_period)
    String

    How long in seconds the message can remain in our outgoing message queue. After this period elapses, the message fails and we call your status callback. Can be between 1 and the default value of 14,400 seconds. After a message has been accepted by a carrier, however, we cannot guarantee that the message will not be queued after this period. We recommend that this value be at least 5 seconds.

  • : (send_at)
    String

    The time at which Twilio will send the message. This parameter can be used to schedule a message to be sent at a particular time. Must be in ISO 8601 format.

  • : (schedule_type)
    String

    This parameter indicates your intent to schedule a message. Pass the value ‘fixed` to schedule a message at a fixed time. This parameter works in conjuction with the `SendAt` parameter.

  • : (shorten_urls)
    Boolean

    Determines the usage of Click Tracking. Setting it to ‘true` will instruct Twilio to replace all links in the Message with a shortened version based on the associated Domain Sid and track clicks on them. If this parameter is not set on an API call, we will use the value set on the Messaging Service. If this parameter is not set and the value is not configured on the Messaging Service used this will default to `false`.

  • : (send_as_mms)
    Boolean

    If set to True, Twilio will deliver the message as a single MMS message, regardless of the presence of media.

  • : (max_price)
    Float

    The maximum total price in US dollars that you will pay for the message to be delivered. Can be a decimal value that has up to 4 decimal places. All messages are queued for delivery and the message cost is checked before the message is sent. If the cost exceeds max_price, the message will fail and a status of Failed is sent to the status callback. If MaxPrice is not set, the message cost is not checked.

  • : (attempt)
    String

    Total number of attempts made ( including this ) to send out the message regardless of the provider used

  • : (smart_encoded)
    Boolean

    This parameter indicates whether to detect Unicode characters that have a similar GSM-7 character and replace them. Can be true or false.

  • : (force_delivery)
    Boolean

    This parameter allows Twilio to send SMS traffic to carriers without checking/caring whether the destination number is a mobile or a landline.

  • : (application_sid)
    String

    The SID of the application that should receive message status. We POST a message_sid parameter and a message_status parameter with a value of sent or failed to the application’s message_status_callback. If a status_callback parameter is also passed, it will be ignored and the application’s message_status_callback parameter will be used.



40
41
42
# File 'lib/twilio-ruby/rest/preview_messaging/v1/message.rb', line 40

def max_price
  @max_price
end

#media_urlObject

Parameters:

  • : (messages)
    Array<MessageList.MessagingV1Message>
  • : (from)
    String

    A Twilio phone number in [E.164](www.twilio.com/docs/glossary/what-e164) format, an [alphanumeric sender ID](www.twilio.com/docs/sms/send-messages#use-an-alphanumeric-sender-id), or a [Channel Endpoint address](www.twilio.com/docs/sms/channels#channel-addresses) that is enabled for the type of message you want to send. Phone numbers or [short codes](www.twilio.com/docs/sms/api/short-code) purchased from Twilio also work here. You cannot, for example, spoof messages from a private cell phone number. If you are using ‘messaging_service_sid`, this parameter must be empty.

  • : (messaging_service_sid)
    String

    The SID of the [Messaging Service](www.twilio.com/docs/sms/services#send-a-message-with-copilot) you want to associate with the Message. Set this parameter to use the [Messaging Service Settings and Copilot Features](www.twilio.com/console/sms/services) you have configured and leave the ‘from` parameter empty. When only this parameter is set, Twilio will use your enabled Copilot Features to select the `from` phone number for delivery.

  • : (body)
    String

    The text of the message you want to send. Can be up to 1,600 characters in length.

  • : (content_sid)
    String

    The SID of the preconfigured [Content Template](www.twilio.com/docs/content-api/create-and-send-your-first-content-api-template#create-a-template) you want to associate with the Message. Must be used in conjuction with a preconfigured [Messaging Service Settings and Copilot Features](www.twilio.com/console/sms/services) When this parameter is set, Twilio will use your configured content template and the provided ‘ContentVariables`. This Twilio product is currently in Private Beta.

  • : (media_url)
    Array<String>

    The URL of the media to send with the message. The media can be of type ‘gif`, `png`, and `jpeg` and will be formatted correctly on the recipient’s device. The media size limit is 5MB for supported file types (JPEG, PNG, GIF) and 500KB for [other types](www.twilio.com/docs/sms/accepted-mime-types) of accepted media. To send more than one image in the message body, provide multiple ‘media_url` parameters in the POST request. You can include up to 10 `media_url` parameters per message. You can send images in an SMS message in only the US and Canada.

  • : (status_callback)
    String

    The URL we should call using the "status_callback_method" to send status information to your application. If specified, we POST these message status changes to the URL - queued, failed, sent, delivered, or undelivered. Twilio will POST its [standard request parameters](www.twilio.com/docs/messaging/twiml#request-parameters) as well as some additional parameters including "MessageSid", "MessageStatus", and "ErrorCode". If you include this parameter with the "messaging_service_sid", we use this URL instead of the Status Callback URL of the [Messaging Service](www.twilio.com/docs/messaging/services/api). URLs must contain a valid hostname and underscores are not allowed.

  • : (validity_period)
    String

    How long in seconds the message can remain in our outgoing message queue. After this period elapses, the message fails and we call your status callback. Can be between 1 and the default value of 14,400 seconds. After a message has been accepted by a carrier, however, we cannot guarantee that the message will not be queued after this period. We recommend that this value be at least 5 seconds.

  • : (send_at)
    String

    The time at which Twilio will send the message. This parameter can be used to schedule a message to be sent at a particular time. Must be in ISO 8601 format.

  • : (schedule_type)
    String

    This parameter indicates your intent to schedule a message. Pass the value ‘fixed` to schedule a message at a fixed time. This parameter works in conjuction with the `SendAt` parameter.

  • : (shorten_urls)
    Boolean

    Determines the usage of Click Tracking. Setting it to ‘true` will instruct Twilio to replace all links in the Message with a shortened version based on the associated Domain Sid and track clicks on them. If this parameter is not set on an API call, we will use the value set on the Messaging Service. If this parameter is not set and the value is not configured on the Messaging Service used this will default to `false`.

  • : (send_as_mms)
    Boolean

    If set to True, Twilio will deliver the message as a single MMS message, regardless of the presence of media.

  • : (max_price)
    Float

    The maximum total price in US dollars that you will pay for the message to be delivered. Can be a decimal value that has up to 4 decimal places. All messages are queued for delivery and the message cost is checked before the message is sent. If the cost exceeds max_price, the message will fail and a status of Failed is sent to the status callback. If MaxPrice is not set, the message cost is not checked.

  • : (attempt)
    String

    Total number of attempts made ( including this ) to send out the message regardless of the provider used

  • : (smart_encoded)
    Boolean

    This parameter indicates whether to detect Unicode characters that have a similar GSM-7 character and replace them. Can be true or false.

  • : (force_delivery)
    Boolean

    This parameter allows Twilio to send SMS traffic to carriers without checking/caring whether the destination number is a mobile or a landline.

  • : (application_sid)
    String

    The SID of the application that should receive message status. We POST a message_sid parameter and a message_status parameter with a value of sent or failed to the application’s message_status_callback. If a status_callback parameter is also passed, it will be ignored and the application’s message_status_callback parameter will be used.



40
41
42
# File 'lib/twilio-ruby/rest/preview_messaging/v1/message.rb', line 40

def media_url
  @media_url
end

#messagesObject

Parameters:

  • : (messages)
    Array<MessageList.MessagingV1Message>
  • : (from)
    String

    A Twilio phone number in [E.164](www.twilio.com/docs/glossary/what-e164) format, an [alphanumeric sender ID](www.twilio.com/docs/sms/send-messages#use-an-alphanumeric-sender-id), or a [Channel Endpoint address](www.twilio.com/docs/sms/channels#channel-addresses) that is enabled for the type of message you want to send. Phone numbers or [short codes](www.twilio.com/docs/sms/api/short-code) purchased from Twilio also work here. You cannot, for example, spoof messages from a private cell phone number. If you are using ‘messaging_service_sid`, this parameter must be empty.

  • : (messaging_service_sid)
    String

    The SID of the [Messaging Service](www.twilio.com/docs/sms/services#send-a-message-with-copilot) you want to associate with the Message. Set this parameter to use the [Messaging Service Settings and Copilot Features](www.twilio.com/console/sms/services) you have configured and leave the ‘from` parameter empty. When only this parameter is set, Twilio will use your enabled Copilot Features to select the `from` phone number for delivery.

  • : (body)
    String

    The text of the message you want to send. Can be up to 1,600 characters in length.

  • : (content_sid)
    String

    The SID of the preconfigured [Content Template](www.twilio.com/docs/content-api/create-and-send-your-first-content-api-template#create-a-template) you want to associate with the Message. Must be used in conjuction with a preconfigured [Messaging Service Settings and Copilot Features](www.twilio.com/console/sms/services) When this parameter is set, Twilio will use your configured content template and the provided ‘ContentVariables`. This Twilio product is currently in Private Beta.

  • : (media_url)
    Array<String>

    The URL of the media to send with the message. The media can be of type ‘gif`, `png`, and `jpeg` and will be formatted correctly on the recipient’s device. The media size limit is 5MB for supported file types (JPEG, PNG, GIF) and 500KB for [other types](www.twilio.com/docs/sms/accepted-mime-types) of accepted media. To send more than one image in the message body, provide multiple ‘media_url` parameters in the POST request. You can include up to 10 `media_url` parameters per message. You can send images in an SMS message in only the US and Canada.

  • : (status_callback)
    String

    The URL we should call using the "status_callback_method" to send status information to your application. If specified, we POST these message status changes to the URL - queued, failed, sent, delivered, or undelivered. Twilio will POST its [standard request parameters](www.twilio.com/docs/messaging/twiml#request-parameters) as well as some additional parameters including "MessageSid", "MessageStatus", and "ErrorCode". If you include this parameter with the "messaging_service_sid", we use this URL instead of the Status Callback URL of the [Messaging Service](www.twilio.com/docs/messaging/services/api). URLs must contain a valid hostname and underscores are not allowed.

  • : (validity_period)
    String

    How long in seconds the message can remain in our outgoing message queue. After this period elapses, the message fails and we call your status callback. Can be between 1 and the default value of 14,400 seconds. After a message has been accepted by a carrier, however, we cannot guarantee that the message will not be queued after this period. We recommend that this value be at least 5 seconds.

  • : (send_at)
    String

    The time at which Twilio will send the message. This parameter can be used to schedule a message to be sent at a particular time. Must be in ISO 8601 format.

  • : (schedule_type)
    String

    This parameter indicates your intent to schedule a message. Pass the value ‘fixed` to schedule a message at a fixed time. This parameter works in conjuction with the `SendAt` parameter.

  • : (shorten_urls)
    Boolean

    Determines the usage of Click Tracking. Setting it to ‘true` will instruct Twilio to replace all links in the Message with a shortened version based on the associated Domain Sid and track clicks on them. If this parameter is not set on an API call, we will use the value set on the Messaging Service. If this parameter is not set and the value is not configured on the Messaging Service used this will default to `false`.

  • : (send_as_mms)
    Boolean

    If set to True, Twilio will deliver the message as a single MMS message, regardless of the presence of media.

  • : (max_price)
    Float

    The maximum total price in US dollars that you will pay for the message to be delivered. Can be a decimal value that has up to 4 decimal places. All messages are queued for delivery and the message cost is checked before the message is sent. If the cost exceeds max_price, the message will fail and a status of Failed is sent to the status callback. If MaxPrice is not set, the message cost is not checked.

  • : (attempt)
    String

    Total number of attempts made ( including this ) to send out the message regardless of the provider used

  • : (smart_encoded)
    Boolean

    This parameter indicates whether to detect Unicode characters that have a similar GSM-7 character and replace them. Can be true or false.

  • : (force_delivery)
    Boolean

    This parameter allows Twilio to send SMS traffic to carriers without checking/caring whether the destination number is a mobile or a landline.

  • : (application_sid)
    String

    The SID of the application that should receive message status. We POST a message_sid parameter and a message_status parameter with a value of sent or failed to the application’s message_status_callback. If a status_callback parameter is also passed, it will be ignored and the application’s message_status_callback parameter will be used.



40
41
42
# File 'lib/twilio-ruby/rest/preview_messaging/v1/message.rb', line 40

def messages
  @messages
end

#messaging_service_sidObject

Parameters:

  • : (messages)
    Array<MessageList.MessagingV1Message>
  • : (from)
    String

    A Twilio phone number in [E.164](www.twilio.com/docs/glossary/what-e164) format, an [alphanumeric sender ID](www.twilio.com/docs/sms/send-messages#use-an-alphanumeric-sender-id), or a [Channel Endpoint address](www.twilio.com/docs/sms/channels#channel-addresses) that is enabled for the type of message you want to send. Phone numbers or [short codes](www.twilio.com/docs/sms/api/short-code) purchased from Twilio also work here. You cannot, for example, spoof messages from a private cell phone number. If you are using ‘messaging_service_sid`, this parameter must be empty.

  • : (messaging_service_sid)
    String

    The SID of the [Messaging Service](www.twilio.com/docs/sms/services#send-a-message-with-copilot) you want to associate with the Message. Set this parameter to use the [Messaging Service Settings and Copilot Features](www.twilio.com/console/sms/services) you have configured and leave the ‘from` parameter empty. When only this parameter is set, Twilio will use your enabled Copilot Features to select the `from` phone number for delivery.

  • : (body)
    String

    The text of the message you want to send. Can be up to 1,600 characters in length.

  • : (content_sid)
    String

    The SID of the preconfigured [Content Template](www.twilio.com/docs/content-api/create-and-send-your-first-content-api-template#create-a-template) you want to associate with the Message. Must be used in conjuction with a preconfigured [Messaging Service Settings and Copilot Features](www.twilio.com/console/sms/services) When this parameter is set, Twilio will use your configured content template and the provided ‘ContentVariables`. This Twilio product is currently in Private Beta.

  • : (media_url)
    Array<String>

    The URL of the media to send with the message. The media can be of type ‘gif`, `png`, and `jpeg` and will be formatted correctly on the recipient’s device. The media size limit is 5MB for supported file types (JPEG, PNG, GIF) and 500KB for [other types](www.twilio.com/docs/sms/accepted-mime-types) of accepted media. To send more than one image in the message body, provide multiple ‘media_url` parameters in the POST request. You can include up to 10 `media_url` parameters per message. You can send images in an SMS message in only the US and Canada.

  • : (status_callback)
    String

    The URL we should call using the "status_callback_method" to send status information to your application. If specified, we POST these message status changes to the URL - queued, failed, sent, delivered, or undelivered. Twilio will POST its [standard request parameters](www.twilio.com/docs/messaging/twiml#request-parameters) as well as some additional parameters including "MessageSid", "MessageStatus", and "ErrorCode". If you include this parameter with the "messaging_service_sid", we use this URL instead of the Status Callback URL of the [Messaging Service](www.twilio.com/docs/messaging/services/api). URLs must contain a valid hostname and underscores are not allowed.

  • : (validity_period)
    String

    How long in seconds the message can remain in our outgoing message queue. After this period elapses, the message fails and we call your status callback. Can be between 1 and the default value of 14,400 seconds. After a message has been accepted by a carrier, however, we cannot guarantee that the message will not be queued after this period. We recommend that this value be at least 5 seconds.

  • : (send_at)
    String

    The time at which Twilio will send the message. This parameter can be used to schedule a message to be sent at a particular time. Must be in ISO 8601 format.

  • : (schedule_type)
    String

    This parameter indicates your intent to schedule a message. Pass the value ‘fixed` to schedule a message at a fixed time. This parameter works in conjuction with the `SendAt` parameter.

  • : (shorten_urls)
    Boolean

    Determines the usage of Click Tracking. Setting it to ‘true` will instruct Twilio to replace all links in the Message with a shortened version based on the associated Domain Sid and track clicks on them. If this parameter is not set on an API call, we will use the value set on the Messaging Service. If this parameter is not set and the value is not configured on the Messaging Service used this will default to `false`.

  • : (send_as_mms)
    Boolean

    If set to True, Twilio will deliver the message as a single MMS message, regardless of the presence of media.

  • : (max_price)
    Float

    The maximum total price in US dollars that you will pay for the message to be delivered. Can be a decimal value that has up to 4 decimal places. All messages are queued for delivery and the message cost is checked before the message is sent. If the cost exceeds max_price, the message will fail and a status of Failed is sent to the status callback. If MaxPrice is not set, the message cost is not checked.

  • : (attempt)
    String

    Total number of attempts made ( including this ) to send out the message regardless of the provider used

  • : (smart_encoded)
    Boolean

    This parameter indicates whether to detect Unicode characters that have a similar GSM-7 character and replace them. Can be true or false.

  • : (force_delivery)
    Boolean

    This parameter allows Twilio to send SMS traffic to carriers without checking/caring whether the destination number is a mobile or a landline.

  • : (application_sid)
    String

    The SID of the application that should receive message status. We POST a message_sid parameter and a message_status parameter with a value of sent or failed to the application’s message_status_callback. If a status_callback parameter is also passed, it will be ignored and the application’s message_status_callback parameter will be used.



40
41
42
# File 'lib/twilio-ruby/rest/preview_messaging/v1/message.rb', line 40

def messaging_service_sid
  @messaging_service_sid
end

#schedule_typeObject

Parameters:

  • : (messages)
    Array<MessageList.MessagingV1Message>
  • : (from)
    String

    A Twilio phone number in [E.164](www.twilio.com/docs/glossary/what-e164) format, an [alphanumeric sender ID](www.twilio.com/docs/sms/send-messages#use-an-alphanumeric-sender-id), or a [Channel Endpoint address](www.twilio.com/docs/sms/channels#channel-addresses) that is enabled for the type of message you want to send. Phone numbers or [short codes](www.twilio.com/docs/sms/api/short-code) purchased from Twilio also work here. You cannot, for example, spoof messages from a private cell phone number. If you are using ‘messaging_service_sid`, this parameter must be empty.

  • : (messaging_service_sid)
    String

    The SID of the [Messaging Service](www.twilio.com/docs/sms/services#send-a-message-with-copilot) you want to associate with the Message. Set this parameter to use the [Messaging Service Settings and Copilot Features](www.twilio.com/console/sms/services) you have configured and leave the ‘from` parameter empty. When only this parameter is set, Twilio will use your enabled Copilot Features to select the `from` phone number for delivery.

  • : (body)
    String

    The text of the message you want to send. Can be up to 1,600 characters in length.

  • : (content_sid)
    String

    The SID of the preconfigured [Content Template](www.twilio.com/docs/content-api/create-and-send-your-first-content-api-template#create-a-template) you want to associate with the Message. Must be used in conjuction with a preconfigured [Messaging Service Settings and Copilot Features](www.twilio.com/console/sms/services) When this parameter is set, Twilio will use your configured content template and the provided ‘ContentVariables`. This Twilio product is currently in Private Beta.

  • : (media_url)
    Array<String>

    The URL of the media to send with the message. The media can be of type ‘gif`, `png`, and `jpeg` and will be formatted correctly on the recipient’s device. The media size limit is 5MB for supported file types (JPEG, PNG, GIF) and 500KB for [other types](www.twilio.com/docs/sms/accepted-mime-types) of accepted media. To send more than one image in the message body, provide multiple ‘media_url` parameters in the POST request. You can include up to 10 `media_url` parameters per message. You can send images in an SMS message in only the US and Canada.

  • : (status_callback)
    String

    The URL we should call using the "status_callback_method" to send status information to your application. If specified, we POST these message status changes to the URL - queued, failed, sent, delivered, or undelivered. Twilio will POST its [standard request parameters](www.twilio.com/docs/messaging/twiml#request-parameters) as well as some additional parameters including "MessageSid", "MessageStatus", and "ErrorCode". If you include this parameter with the "messaging_service_sid", we use this URL instead of the Status Callback URL of the [Messaging Service](www.twilio.com/docs/messaging/services/api). URLs must contain a valid hostname and underscores are not allowed.

  • : (validity_period)
    String

    How long in seconds the message can remain in our outgoing message queue. After this period elapses, the message fails and we call your status callback. Can be between 1 and the default value of 14,400 seconds. After a message has been accepted by a carrier, however, we cannot guarantee that the message will not be queued after this period. We recommend that this value be at least 5 seconds.

  • : (send_at)
    String

    The time at which Twilio will send the message. This parameter can be used to schedule a message to be sent at a particular time. Must be in ISO 8601 format.

  • : (schedule_type)
    String

    This parameter indicates your intent to schedule a message. Pass the value ‘fixed` to schedule a message at a fixed time. This parameter works in conjuction with the `SendAt` parameter.

  • : (shorten_urls)
    Boolean

    Determines the usage of Click Tracking. Setting it to ‘true` will instruct Twilio to replace all links in the Message with a shortened version based on the associated Domain Sid and track clicks on them. If this parameter is not set on an API call, we will use the value set on the Messaging Service. If this parameter is not set and the value is not configured on the Messaging Service used this will default to `false`.

  • : (send_as_mms)
    Boolean

    If set to True, Twilio will deliver the message as a single MMS message, regardless of the presence of media.

  • : (max_price)
    Float

    The maximum total price in US dollars that you will pay for the message to be delivered. Can be a decimal value that has up to 4 decimal places. All messages are queued for delivery and the message cost is checked before the message is sent. If the cost exceeds max_price, the message will fail and a status of Failed is sent to the status callback. If MaxPrice is not set, the message cost is not checked.

  • : (attempt)
    String

    Total number of attempts made ( including this ) to send out the message regardless of the provider used

  • : (smart_encoded)
    Boolean

    This parameter indicates whether to detect Unicode characters that have a similar GSM-7 character and replace them. Can be true or false.

  • : (force_delivery)
    Boolean

    This parameter allows Twilio to send SMS traffic to carriers without checking/caring whether the destination number is a mobile or a landline.

  • : (application_sid)
    String

    The SID of the application that should receive message status. We POST a message_sid parameter and a message_status parameter with a value of sent or failed to the application’s message_status_callback. If a status_callback parameter is also passed, it will be ignored and the application’s message_status_callback parameter will be used.



40
41
42
# File 'lib/twilio-ruby/rest/preview_messaging/v1/message.rb', line 40

def schedule_type
  @schedule_type
end

#send_as_mmsObject

Parameters:

  • : (messages)
    Array<MessageList.MessagingV1Message>
  • : (from)
    String

    A Twilio phone number in [E.164](www.twilio.com/docs/glossary/what-e164) format, an [alphanumeric sender ID](www.twilio.com/docs/sms/send-messages#use-an-alphanumeric-sender-id), or a [Channel Endpoint address](www.twilio.com/docs/sms/channels#channel-addresses) that is enabled for the type of message you want to send. Phone numbers or [short codes](www.twilio.com/docs/sms/api/short-code) purchased from Twilio also work here. You cannot, for example, spoof messages from a private cell phone number. If you are using ‘messaging_service_sid`, this parameter must be empty.

  • : (messaging_service_sid)
    String

    The SID of the [Messaging Service](www.twilio.com/docs/sms/services#send-a-message-with-copilot) you want to associate with the Message. Set this parameter to use the [Messaging Service Settings and Copilot Features](www.twilio.com/console/sms/services) you have configured and leave the ‘from` parameter empty. When only this parameter is set, Twilio will use your enabled Copilot Features to select the `from` phone number for delivery.

  • : (body)
    String

    The text of the message you want to send. Can be up to 1,600 characters in length.

  • : (content_sid)
    String

    The SID of the preconfigured [Content Template](www.twilio.com/docs/content-api/create-and-send-your-first-content-api-template#create-a-template) you want to associate with the Message. Must be used in conjuction with a preconfigured [Messaging Service Settings and Copilot Features](www.twilio.com/console/sms/services) When this parameter is set, Twilio will use your configured content template and the provided ‘ContentVariables`. This Twilio product is currently in Private Beta.

  • : (media_url)
    Array<String>

    The URL of the media to send with the message. The media can be of type ‘gif`, `png`, and `jpeg` and will be formatted correctly on the recipient’s device. The media size limit is 5MB for supported file types (JPEG, PNG, GIF) and 500KB for [other types](www.twilio.com/docs/sms/accepted-mime-types) of accepted media. To send more than one image in the message body, provide multiple ‘media_url` parameters in the POST request. You can include up to 10 `media_url` parameters per message. You can send images in an SMS message in only the US and Canada.

  • : (status_callback)
    String

    The URL we should call using the "status_callback_method" to send status information to your application. If specified, we POST these message status changes to the URL - queued, failed, sent, delivered, or undelivered. Twilio will POST its [standard request parameters](www.twilio.com/docs/messaging/twiml#request-parameters) as well as some additional parameters including "MessageSid", "MessageStatus", and "ErrorCode". If you include this parameter with the "messaging_service_sid", we use this URL instead of the Status Callback URL of the [Messaging Service](www.twilio.com/docs/messaging/services/api). URLs must contain a valid hostname and underscores are not allowed.

  • : (validity_period)
    String

    How long in seconds the message can remain in our outgoing message queue. After this period elapses, the message fails and we call your status callback. Can be between 1 and the default value of 14,400 seconds. After a message has been accepted by a carrier, however, we cannot guarantee that the message will not be queued after this period. We recommend that this value be at least 5 seconds.

  • : (send_at)
    String

    The time at which Twilio will send the message. This parameter can be used to schedule a message to be sent at a particular time. Must be in ISO 8601 format.

  • : (schedule_type)
    String

    This parameter indicates your intent to schedule a message. Pass the value ‘fixed` to schedule a message at a fixed time. This parameter works in conjuction with the `SendAt` parameter.

  • : (shorten_urls)
    Boolean

    Determines the usage of Click Tracking. Setting it to ‘true` will instruct Twilio to replace all links in the Message with a shortened version based on the associated Domain Sid and track clicks on them. If this parameter is not set on an API call, we will use the value set on the Messaging Service. If this parameter is not set and the value is not configured on the Messaging Service used this will default to `false`.

  • : (send_as_mms)
    Boolean

    If set to True, Twilio will deliver the message as a single MMS message, regardless of the presence of media.

  • : (max_price)
    Float

    The maximum total price in US dollars that you will pay for the message to be delivered. Can be a decimal value that has up to 4 decimal places. All messages are queued for delivery and the message cost is checked before the message is sent. If the cost exceeds max_price, the message will fail and a status of Failed is sent to the status callback. If MaxPrice is not set, the message cost is not checked.

  • : (attempt)
    String

    Total number of attempts made ( including this ) to send out the message regardless of the provider used

  • : (smart_encoded)
    Boolean

    This parameter indicates whether to detect Unicode characters that have a similar GSM-7 character and replace them. Can be true or false.

  • : (force_delivery)
    Boolean

    This parameter allows Twilio to send SMS traffic to carriers without checking/caring whether the destination number is a mobile or a landline.

  • : (application_sid)
    String

    The SID of the application that should receive message status. We POST a message_sid parameter and a message_status parameter with a value of sent or failed to the application’s message_status_callback. If a status_callback parameter is also passed, it will be ignored and the application’s message_status_callback parameter will be used.



40
41
42
# File 'lib/twilio-ruby/rest/preview_messaging/v1/message.rb', line 40

def send_as_mms
  @send_as_mms
end

#send_atObject

Parameters:

  • : (messages)
    Array<MessageList.MessagingV1Message>
  • : (from)
    String

    A Twilio phone number in [E.164](www.twilio.com/docs/glossary/what-e164) format, an [alphanumeric sender ID](www.twilio.com/docs/sms/send-messages#use-an-alphanumeric-sender-id), or a [Channel Endpoint address](www.twilio.com/docs/sms/channels#channel-addresses) that is enabled for the type of message you want to send. Phone numbers or [short codes](www.twilio.com/docs/sms/api/short-code) purchased from Twilio also work here. You cannot, for example, spoof messages from a private cell phone number. If you are using ‘messaging_service_sid`, this parameter must be empty.

  • : (messaging_service_sid)
    String

    The SID of the [Messaging Service](www.twilio.com/docs/sms/services#send-a-message-with-copilot) you want to associate with the Message. Set this parameter to use the [Messaging Service Settings and Copilot Features](www.twilio.com/console/sms/services) you have configured and leave the ‘from` parameter empty. When only this parameter is set, Twilio will use your enabled Copilot Features to select the `from` phone number for delivery.

  • : (body)
    String

    The text of the message you want to send. Can be up to 1,600 characters in length.

  • : (content_sid)
    String

    The SID of the preconfigured [Content Template](www.twilio.com/docs/content-api/create-and-send-your-first-content-api-template#create-a-template) you want to associate with the Message. Must be used in conjuction with a preconfigured [Messaging Service Settings and Copilot Features](www.twilio.com/console/sms/services) When this parameter is set, Twilio will use your configured content template and the provided ‘ContentVariables`. This Twilio product is currently in Private Beta.

  • : (media_url)
    Array<String>

    The URL of the media to send with the message. The media can be of type ‘gif`, `png`, and `jpeg` and will be formatted correctly on the recipient’s device. The media size limit is 5MB for supported file types (JPEG, PNG, GIF) and 500KB for [other types](www.twilio.com/docs/sms/accepted-mime-types) of accepted media. To send more than one image in the message body, provide multiple ‘media_url` parameters in the POST request. You can include up to 10 `media_url` parameters per message. You can send images in an SMS message in only the US and Canada.

  • : (status_callback)
    String

    The URL we should call using the "status_callback_method" to send status information to your application. If specified, we POST these message status changes to the URL - queued, failed, sent, delivered, or undelivered. Twilio will POST its [standard request parameters](www.twilio.com/docs/messaging/twiml#request-parameters) as well as some additional parameters including "MessageSid", "MessageStatus", and "ErrorCode". If you include this parameter with the "messaging_service_sid", we use this URL instead of the Status Callback URL of the [Messaging Service](www.twilio.com/docs/messaging/services/api). URLs must contain a valid hostname and underscores are not allowed.

  • : (validity_period)
    String

    How long in seconds the message can remain in our outgoing message queue. After this period elapses, the message fails and we call your status callback. Can be between 1 and the default value of 14,400 seconds. After a message has been accepted by a carrier, however, we cannot guarantee that the message will not be queued after this period. We recommend that this value be at least 5 seconds.

  • : (send_at)
    String

    The time at which Twilio will send the message. This parameter can be used to schedule a message to be sent at a particular time. Must be in ISO 8601 format.

  • : (schedule_type)
    String

    This parameter indicates your intent to schedule a message. Pass the value ‘fixed` to schedule a message at a fixed time. This parameter works in conjuction with the `SendAt` parameter.

  • : (shorten_urls)
    Boolean

    Determines the usage of Click Tracking. Setting it to ‘true` will instruct Twilio to replace all links in the Message with a shortened version based on the associated Domain Sid and track clicks on them. If this parameter is not set on an API call, we will use the value set on the Messaging Service. If this parameter is not set and the value is not configured on the Messaging Service used this will default to `false`.

  • : (send_as_mms)
    Boolean

    If set to True, Twilio will deliver the message as a single MMS message, regardless of the presence of media.

  • : (max_price)
    Float

    The maximum total price in US dollars that you will pay for the message to be delivered. Can be a decimal value that has up to 4 decimal places. All messages are queued for delivery and the message cost is checked before the message is sent. If the cost exceeds max_price, the message will fail and a status of Failed is sent to the status callback. If MaxPrice is not set, the message cost is not checked.

  • : (attempt)
    String

    Total number of attempts made ( including this ) to send out the message regardless of the provider used

  • : (smart_encoded)
    Boolean

    This parameter indicates whether to detect Unicode characters that have a similar GSM-7 character and replace them. Can be true or false.

  • : (force_delivery)
    Boolean

    This parameter allows Twilio to send SMS traffic to carriers without checking/caring whether the destination number is a mobile or a landline.

  • : (application_sid)
    String

    The SID of the application that should receive message status. We POST a message_sid parameter and a message_status parameter with a value of sent or failed to the application’s message_status_callback. If a status_callback parameter is also passed, it will be ignored and the application’s message_status_callback parameter will be used.



40
41
42
# File 'lib/twilio-ruby/rest/preview_messaging/v1/message.rb', line 40

def send_at
  @send_at
end

#shorten_urlsObject

Parameters:

  • : (messages)
    Array<MessageList.MessagingV1Message>
  • : (from)
    String

    A Twilio phone number in [E.164](www.twilio.com/docs/glossary/what-e164) format, an [alphanumeric sender ID](www.twilio.com/docs/sms/send-messages#use-an-alphanumeric-sender-id), or a [Channel Endpoint address](www.twilio.com/docs/sms/channels#channel-addresses) that is enabled for the type of message you want to send. Phone numbers or [short codes](www.twilio.com/docs/sms/api/short-code) purchased from Twilio also work here. You cannot, for example, spoof messages from a private cell phone number. If you are using ‘messaging_service_sid`, this parameter must be empty.

  • : (messaging_service_sid)
    String

    The SID of the [Messaging Service](www.twilio.com/docs/sms/services#send-a-message-with-copilot) you want to associate with the Message. Set this parameter to use the [Messaging Service Settings and Copilot Features](www.twilio.com/console/sms/services) you have configured and leave the ‘from` parameter empty. When only this parameter is set, Twilio will use your enabled Copilot Features to select the `from` phone number for delivery.

  • : (body)
    String

    The text of the message you want to send. Can be up to 1,600 characters in length.

  • : (content_sid)
    String

    The SID of the preconfigured [Content Template](www.twilio.com/docs/content-api/create-and-send-your-first-content-api-template#create-a-template) you want to associate with the Message. Must be used in conjuction with a preconfigured [Messaging Service Settings and Copilot Features](www.twilio.com/console/sms/services) When this parameter is set, Twilio will use your configured content template and the provided ‘ContentVariables`. This Twilio product is currently in Private Beta.

  • : (media_url)
    Array<String>

    The URL of the media to send with the message. The media can be of type ‘gif`, `png`, and `jpeg` and will be formatted correctly on the recipient’s device. The media size limit is 5MB for supported file types (JPEG, PNG, GIF) and 500KB for [other types](www.twilio.com/docs/sms/accepted-mime-types) of accepted media. To send more than one image in the message body, provide multiple ‘media_url` parameters in the POST request. You can include up to 10 `media_url` parameters per message. You can send images in an SMS message in only the US and Canada.

  • : (status_callback)
    String

    The URL we should call using the "status_callback_method" to send status information to your application. If specified, we POST these message status changes to the URL - queued, failed, sent, delivered, or undelivered. Twilio will POST its [standard request parameters](www.twilio.com/docs/messaging/twiml#request-parameters) as well as some additional parameters including "MessageSid", "MessageStatus", and "ErrorCode". If you include this parameter with the "messaging_service_sid", we use this URL instead of the Status Callback URL of the [Messaging Service](www.twilio.com/docs/messaging/services/api). URLs must contain a valid hostname and underscores are not allowed.

  • : (validity_period)
    String

    How long in seconds the message can remain in our outgoing message queue. After this period elapses, the message fails and we call your status callback. Can be between 1 and the default value of 14,400 seconds. After a message has been accepted by a carrier, however, we cannot guarantee that the message will not be queued after this period. We recommend that this value be at least 5 seconds.

  • : (send_at)
    String

    The time at which Twilio will send the message. This parameter can be used to schedule a message to be sent at a particular time. Must be in ISO 8601 format.

  • : (schedule_type)
    String

    This parameter indicates your intent to schedule a message. Pass the value ‘fixed` to schedule a message at a fixed time. This parameter works in conjuction with the `SendAt` parameter.

  • : (shorten_urls)
    Boolean

    Determines the usage of Click Tracking. Setting it to ‘true` will instruct Twilio to replace all links in the Message with a shortened version based on the associated Domain Sid and track clicks on them. If this parameter is not set on an API call, we will use the value set on the Messaging Service. If this parameter is not set and the value is not configured on the Messaging Service used this will default to `false`.

  • : (send_as_mms)
    Boolean

    If set to True, Twilio will deliver the message as a single MMS message, regardless of the presence of media.

  • : (max_price)
    Float

    The maximum total price in US dollars that you will pay for the message to be delivered. Can be a decimal value that has up to 4 decimal places. All messages are queued for delivery and the message cost is checked before the message is sent. If the cost exceeds max_price, the message will fail and a status of Failed is sent to the status callback. If MaxPrice is not set, the message cost is not checked.

  • : (attempt)
    String

    Total number of attempts made ( including this ) to send out the message regardless of the provider used

  • : (smart_encoded)
    Boolean

    This parameter indicates whether to detect Unicode characters that have a similar GSM-7 character and replace them. Can be true or false.

  • : (force_delivery)
    Boolean

    This parameter allows Twilio to send SMS traffic to carriers without checking/caring whether the destination number is a mobile or a landline.

  • : (application_sid)
    String

    The SID of the application that should receive message status. We POST a message_sid parameter and a message_status parameter with a value of sent or failed to the application’s message_status_callback. If a status_callback parameter is also passed, it will be ignored and the application’s message_status_callback parameter will be used.



40
41
42
# File 'lib/twilio-ruby/rest/preview_messaging/v1/message.rb', line 40

def shorten_urls
  @shorten_urls
end

#smart_encodedObject

Parameters:

  • : (messages)
    Array<MessageList.MessagingV1Message>
  • : (from)
    String

    A Twilio phone number in [E.164](www.twilio.com/docs/glossary/what-e164) format, an [alphanumeric sender ID](www.twilio.com/docs/sms/send-messages#use-an-alphanumeric-sender-id), or a [Channel Endpoint address](www.twilio.com/docs/sms/channels#channel-addresses) that is enabled for the type of message you want to send. Phone numbers or [short codes](www.twilio.com/docs/sms/api/short-code) purchased from Twilio also work here. You cannot, for example, spoof messages from a private cell phone number. If you are using ‘messaging_service_sid`, this parameter must be empty.

  • : (messaging_service_sid)
    String

    The SID of the [Messaging Service](www.twilio.com/docs/sms/services#send-a-message-with-copilot) you want to associate with the Message. Set this parameter to use the [Messaging Service Settings and Copilot Features](www.twilio.com/console/sms/services) you have configured and leave the ‘from` parameter empty. When only this parameter is set, Twilio will use your enabled Copilot Features to select the `from` phone number for delivery.

  • : (body)
    String

    The text of the message you want to send. Can be up to 1,600 characters in length.

  • : (content_sid)
    String

    The SID of the preconfigured [Content Template](www.twilio.com/docs/content-api/create-and-send-your-first-content-api-template#create-a-template) you want to associate with the Message. Must be used in conjuction with a preconfigured [Messaging Service Settings and Copilot Features](www.twilio.com/console/sms/services) When this parameter is set, Twilio will use your configured content template and the provided ‘ContentVariables`. This Twilio product is currently in Private Beta.

  • : (media_url)
    Array<String>

    The URL of the media to send with the message. The media can be of type ‘gif`, `png`, and `jpeg` and will be formatted correctly on the recipient’s device. The media size limit is 5MB for supported file types (JPEG, PNG, GIF) and 500KB for [other types](www.twilio.com/docs/sms/accepted-mime-types) of accepted media. To send more than one image in the message body, provide multiple ‘media_url` parameters in the POST request. You can include up to 10 `media_url` parameters per message. You can send images in an SMS message in only the US and Canada.

  • : (status_callback)
    String

    The URL we should call using the "status_callback_method" to send status information to your application. If specified, we POST these message status changes to the URL - queued, failed, sent, delivered, or undelivered. Twilio will POST its [standard request parameters](www.twilio.com/docs/messaging/twiml#request-parameters) as well as some additional parameters including "MessageSid", "MessageStatus", and "ErrorCode". If you include this parameter with the "messaging_service_sid", we use this URL instead of the Status Callback URL of the [Messaging Service](www.twilio.com/docs/messaging/services/api). URLs must contain a valid hostname and underscores are not allowed.

  • : (validity_period)
    String

    How long in seconds the message can remain in our outgoing message queue. After this period elapses, the message fails and we call your status callback. Can be between 1 and the default value of 14,400 seconds. After a message has been accepted by a carrier, however, we cannot guarantee that the message will not be queued after this period. We recommend that this value be at least 5 seconds.

  • : (send_at)
    String

    The time at which Twilio will send the message. This parameter can be used to schedule a message to be sent at a particular time. Must be in ISO 8601 format.

  • : (schedule_type)
    String

    This parameter indicates your intent to schedule a message. Pass the value ‘fixed` to schedule a message at a fixed time. This parameter works in conjuction with the `SendAt` parameter.

  • : (shorten_urls)
    Boolean

    Determines the usage of Click Tracking. Setting it to ‘true` will instruct Twilio to replace all links in the Message with a shortened version based on the associated Domain Sid and track clicks on them. If this parameter is not set on an API call, we will use the value set on the Messaging Service. If this parameter is not set and the value is not configured on the Messaging Service used this will default to `false`.

  • : (send_as_mms)
    Boolean

    If set to True, Twilio will deliver the message as a single MMS message, regardless of the presence of media.

  • : (max_price)
    Float

    The maximum total price in US dollars that you will pay for the message to be delivered. Can be a decimal value that has up to 4 decimal places. All messages are queued for delivery and the message cost is checked before the message is sent. If the cost exceeds max_price, the message will fail and a status of Failed is sent to the status callback. If MaxPrice is not set, the message cost is not checked.

  • : (attempt)
    String

    Total number of attempts made ( including this ) to send out the message regardless of the provider used

  • : (smart_encoded)
    Boolean

    This parameter indicates whether to detect Unicode characters that have a similar GSM-7 character and replace them. Can be true or false.

  • : (force_delivery)
    Boolean

    This parameter allows Twilio to send SMS traffic to carriers without checking/caring whether the destination number is a mobile or a landline.

  • : (application_sid)
    String

    The SID of the application that should receive message status. We POST a message_sid parameter and a message_status parameter with a value of sent or failed to the application’s message_status_callback. If a status_callback parameter is also passed, it will be ignored and the application’s message_status_callback parameter will be used.



40
41
42
# File 'lib/twilio-ruby/rest/preview_messaging/v1/message.rb', line 40

def smart_encoded
  @smart_encoded
end

#status_callbackObject

Parameters:

  • : (messages)
    Array<MessageList.MessagingV1Message>
  • : (from)
    String

    A Twilio phone number in [E.164](www.twilio.com/docs/glossary/what-e164) format, an [alphanumeric sender ID](www.twilio.com/docs/sms/send-messages#use-an-alphanumeric-sender-id), or a [Channel Endpoint address](www.twilio.com/docs/sms/channels#channel-addresses) that is enabled for the type of message you want to send. Phone numbers or [short codes](www.twilio.com/docs/sms/api/short-code) purchased from Twilio also work here. You cannot, for example, spoof messages from a private cell phone number. If you are using ‘messaging_service_sid`, this parameter must be empty.

  • : (messaging_service_sid)
    String

    The SID of the [Messaging Service](www.twilio.com/docs/sms/services#send-a-message-with-copilot) you want to associate with the Message. Set this parameter to use the [Messaging Service Settings and Copilot Features](www.twilio.com/console/sms/services) you have configured and leave the ‘from` parameter empty. When only this parameter is set, Twilio will use your enabled Copilot Features to select the `from` phone number for delivery.

  • : (body)
    String

    The text of the message you want to send. Can be up to 1,600 characters in length.

  • : (content_sid)
    String

    The SID of the preconfigured [Content Template](www.twilio.com/docs/content-api/create-and-send-your-first-content-api-template#create-a-template) you want to associate with the Message. Must be used in conjuction with a preconfigured [Messaging Service Settings and Copilot Features](www.twilio.com/console/sms/services) When this parameter is set, Twilio will use your configured content template and the provided ‘ContentVariables`. This Twilio product is currently in Private Beta.

  • : (media_url)
    Array<String>

    The URL of the media to send with the message. The media can be of type ‘gif`, `png`, and `jpeg` and will be formatted correctly on the recipient’s device. The media size limit is 5MB for supported file types (JPEG, PNG, GIF) and 500KB for [other types](www.twilio.com/docs/sms/accepted-mime-types) of accepted media. To send more than one image in the message body, provide multiple ‘media_url` parameters in the POST request. You can include up to 10 `media_url` parameters per message. You can send images in an SMS message in only the US and Canada.

  • : (status_callback)
    String

    The URL we should call using the "status_callback_method" to send status information to your application. If specified, we POST these message status changes to the URL - queued, failed, sent, delivered, or undelivered. Twilio will POST its [standard request parameters](www.twilio.com/docs/messaging/twiml#request-parameters) as well as some additional parameters including "MessageSid", "MessageStatus", and "ErrorCode". If you include this parameter with the "messaging_service_sid", we use this URL instead of the Status Callback URL of the [Messaging Service](www.twilio.com/docs/messaging/services/api). URLs must contain a valid hostname and underscores are not allowed.

  • : (validity_period)
    String

    How long in seconds the message can remain in our outgoing message queue. After this period elapses, the message fails and we call your status callback. Can be between 1 and the default value of 14,400 seconds. After a message has been accepted by a carrier, however, we cannot guarantee that the message will not be queued after this period. We recommend that this value be at least 5 seconds.

  • : (send_at)
    String

    The time at which Twilio will send the message. This parameter can be used to schedule a message to be sent at a particular time. Must be in ISO 8601 format.

  • : (schedule_type)
    String

    This parameter indicates your intent to schedule a message. Pass the value ‘fixed` to schedule a message at a fixed time. This parameter works in conjuction with the `SendAt` parameter.

  • : (shorten_urls)
    Boolean

    Determines the usage of Click Tracking. Setting it to ‘true` will instruct Twilio to replace all links in the Message with a shortened version based on the associated Domain Sid and track clicks on them. If this parameter is not set on an API call, we will use the value set on the Messaging Service. If this parameter is not set and the value is not configured on the Messaging Service used this will default to `false`.

  • : (send_as_mms)
    Boolean

    If set to True, Twilio will deliver the message as a single MMS message, regardless of the presence of media.

  • : (max_price)
    Float

    The maximum total price in US dollars that you will pay for the message to be delivered. Can be a decimal value that has up to 4 decimal places. All messages are queued for delivery and the message cost is checked before the message is sent. If the cost exceeds max_price, the message will fail and a status of Failed is sent to the status callback. If MaxPrice is not set, the message cost is not checked.

  • : (attempt)
    String

    Total number of attempts made ( including this ) to send out the message regardless of the provider used

  • : (smart_encoded)
    Boolean

    This parameter indicates whether to detect Unicode characters that have a similar GSM-7 character and replace them. Can be true or false.

  • : (force_delivery)
    Boolean

    This parameter allows Twilio to send SMS traffic to carriers without checking/caring whether the destination number is a mobile or a landline.

  • : (application_sid)
    String

    The SID of the application that should receive message status. We POST a message_sid parameter and a message_status parameter with a value of sent or failed to the application’s message_status_callback. If a status_callback parameter is also passed, it will be ignored and the application’s message_status_callback parameter will be used.



40
41
42
# File 'lib/twilio-ruby/rest/preview_messaging/v1/message.rb', line 40

def status_callback
  @status_callback
end

#validity_periodObject

Parameters:

  • : (messages)
    Array<MessageList.MessagingV1Message>
  • : (from)
    String

    A Twilio phone number in [E.164](www.twilio.com/docs/glossary/what-e164) format, an [alphanumeric sender ID](www.twilio.com/docs/sms/send-messages#use-an-alphanumeric-sender-id), or a [Channel Endpoint address](www.twilio.com/docs/sms/channels#channel-addresses) that is enabled for the type of message you want to send. Phone numbers or [short codes](www.twilio.com/docs/sms/api/short-code) purchased from Twilio also work here. You cannot, for example, spoof messages from a private cell phone number. If you are using ‘messaging_service_sid`, this parameter must be empty.

  • : (messaging_service_sid)
    String

    The SID of the [Messaging Service](www.twilio.com/docs/sms/services#send-a-message-with-copilot) you want to associate with the Message. Set this parameter to use the [Messaging Service Settings and Copilot Features](www.twilio.com/console/sms/services) you have configured and leave the ‘from` parameter empty. When only this parameter is set, Twilio will use your enabled Copilot Features to select the `from` phone number for delivery.

  • : (body)
    String

    The text of the message you want to send. Can be up to 1,600 characters in length.

  • : (content_sid)
    String

    The SID of the preconfigured [Content Template](www.twilio.com/docs/content-api/create-and-send-your-first-content-api-template#create-a-template) you want to associate with the Message. Must be used in conjuction with a preconfigured [Messaging Service Settings and Copilot Features](www.twilio.com/console/sms/services) When this parameter is set, Twilio will use your configured content template and the provided ‘ContentVariables`. This Twilio product is currently in Private Beta.

  • : (media_url)
    Array<String>

    The URL of the media to send with the message. The media can be of type ‘gif`, `png`, and `jpeg` and will be formatted correctly on the recipient’s device. The media size limit is 5MB for supported file types (JPEG, PNG, GIF) and 500KB for [other types](www.twilio.com/docs/sms/accepted-mime-types) of accepted media. To send more than one image in the message body, provide multiple ‘media_url` parameters in the POST request. You can include up to 10 `media_url` parameters per message. You can send images in an SMS message in only the US and Canada.

  • : (status_callback)
    String

    The URL we should call using the "status_callback_method" to send status information to your application. If specified, we POST these message status changes to the URL - queued, failed, sent, delivered, or undelivered. Twilio will POST its [standard request parameters](www.twilio.com/docs/messaging/twiml#request-parameters) as well as some additional parameters including "MessageSid", "MessageStatus", and "ErrorCode". If you include this parameter with the "messaging_service_sid", we use this URL instead of the Status Callback URL of the [Messaging Service](www.twilio.com/docs/messaging/services/api). URLs must contain a valid hostname and underscores are not allowed.

  • : (validity_period)
    String

    How long in seconds the message can remain in our outgoing message queue. After this period elapses, the message fails and we call your status callback. Can be between 1 and the default value of 14,400 seconds. After a message has been accepted by a carrier, however, we cannot guarantee that the message will not be queued after this period. We recommend that this value be at least 5 seconds.

  • : (send_at)
    String

    The time at which Twilio will send the message. This parameter can be used to schedule a message to be sent at a particular time. Must be in ISO 8601 format.

  • : (schedule_type)
    String

    This parameter indicates your intent to schedule a message. Pass the value ‘fixed` to schedule a message at a fixed time. This parameter works in conjuction with the `SendAt` parameter.

  • : (shorten_urls)
    Boolean

    Determines the usage of Click Tracking. Setting it to ‘true` will instruct Twilio to replace all links in the Message with a shortened version based on the associated Domain Sid and track clicks on them. If this parameter is not set on an API call, we will use the value set on the Messaging Service. If this parameter is not set and the value is not configured on the Messaging Service used this will default to `false`.

  • : (send_as_mms)
    Boolean

    If set to True, Twilio will deliver the message as a single MMS message, regardless of the presence of media.

  • : (max_price)
    Float

    The maximum total price in US dollars that you will pay for the message to be delivered. Can be a decimal value that has up to 4 decimal places. All messages are queued for delivery and the message cost is checked before the message is sent. If the cost exceeds max_price, the message will fail and a status of Failed is sent to the status callback. If MaxPrice is not set, the message cost is not checked.

  • : (attempt)
    String

    Total number of attempts made ( including this ) to send out the message regardless of the provider used

  • : (smart_encoded)
    Boolean

    This parameter indicates whether to detect Unicode characters that have a similar GSM-7 character and replace them. Can be true or false.

  • : (force_delivery)
    Boolean

    This parameter allows Twilio to send SMS traffic to carriers without checking/caring whether the destination number is a mobile or a landline.

  • : (application_sid)
    String

    The SID of the application that should receive message status. We POST a message_sid parameter and a message_status parameter with a value of sent or failed to the application’s message_status_callback. If a status_callback parameter is also passed, it will be ignored and the application’s message_status_callback parameter will be used.



40
41
42
# File 'lib/twilio-ruby/rest/preview_messaging/v1/message.rb', line 40

def validity_period
  @validity_period
end

Instance Method Details

#to_json(options = {}) ⇒ Object



60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/twilio-ruby/rest/preview_messaging/v1/message.rb', line 60

def to_json(options = {})
{
        messages: @messages,
        from: @from,
        messaging_service_sid: @messaging_service_sid,
        body: @body,
        content_sid: @content_sid,
        media_url: @media_url,
        status_callback: @status_callback,
        validity_period: @validity_period,
        send_at: @send_at,
        schedule_type: @schedule_type,
        shorten_urls: @shorten_urls,
        send_as_mms: @send_as_mms,
        max_price: @max_price,
        attempt: @attempt,
        smart_encoded: @smart_encoded,
        force_delivery: @force_delivery,
        application_sid: @application_sid,
}.to_json(options)
end