You are viewing the Spanish (Mexico) site, but your language preference is set to English. Switch to English site →

Menu

Expand
Calificar esta página:

Message Resource

A Message resource represents an inbound or outbound message. Twilio creates a Message when any of the following occur:

With this REST API, you can:

Are you looking for step-by-step instructions for sending your first SMS with Twilio using the helper libraries? Check out one of our SMS quickstarts in your programming language of choice: C#/.NET, Java, Node.js, PHP, Python, or Ruby.

Or, if you're looking to get up and running with the Twilio API for WhatsApp Quickstart: C#/.NET, Java, Node.js, PHP, Python, or Ruby.

Message properties

Resource Properties in REST API format
body

El texto del mensaje. Puede tener hasta 1600 caracteres de longitud.

num_segments
string Not PII

La cantidad de segmentos que componen el mensaje completo. Un cuerpo de mensaje que es demasiado grande para enviarse en un solo mensaje SMS se segmenta y se carga como varios mensajes. Los mensajes entrantes de más de 160 caracteres se vuelven a juntar cuando se recibe el mensaje. Nota: Cuando uses un servicio de mensajería para enviar mensajes, “num_segments” siempre será 0 en la respuesta de Twilio a la solicitud de tu API.

direction
enum:direction Not PII

La dirección del mensaje. Puede ser: “inbound” para mensajes entrantes, “outbound-api” para mensajes iniciados por una API REST, “outbound-call” para mensajes iniciados durante una llamada o “outbound-reply” para mensajes iniciados en respuesta a un mensaje entrante.

from
phone_number PII MTL: 120 DAYS

El número de teléfono (en formato E.164), el alphanumeric sender ID o la Wireless SIM que inició el mensaje. Para los mensajes entrantes, este será el número del teléfono del remitente. Para los mensajes salientes, este valor será uno de sus números de teléfono de Twilio o el ID de remitente alfanumérico utilizado.

to

El número de teléfono en formato E.164 que recibió el mensaje. Para los mensajes entrantes, este será uno de tus números de teléfono de Twilio. Para los mensajes salientes, este será el número del teléfono del remitente.

date_updated
date_time<rfc2822> Not PII

La fecha y hora en GMT en que se actualizó el recurso por última vez, especificadas en el formato RFC 2822.

price
string Not PII

El importe facturado por el mensaje, en la moneda especificada por “price_unit”. Ten en cuenta que se cargará en tu cuenta cada segmento que enviemos al teléfono. Se rellena después de enviar el mensaje. Puede que no esté disponible inmediatamente.

error_message
string Not PII

La descripción del “error_code” si el “status” (estado) de tu mensaje es “failed” (fallido) o “undelivered” (no entregado). Si el mensaje se envió correctamente, este valor es nulo.

uri
string Not PII

La URL del recurso, referente a “https://api.twilio.com”.

account_sid
sid<AC> Not PII

El SID de la Account que envió el mensaje que creó el recurso.

num_media
string Not PII

La cantidad de archivos multimedia asociados al mensaje. Un mensaje puede enviar hasta 10 archivos multimedia.

status
enum:status Not PII

The status of the message. Can be: accepted, scheduled, canceled, queued, sending, sent, failed, delivered, undelivered, receiving, received, or read (WhatsApp only). For more information, See detailed descriptions.

messaging_service_sid
sid<MG> Not PII

El SID del Messaging Service utilizado con el mensaje. El valor es nulo si no se utilizó un servicio de mensajería.

sid
sid<MM> Not PII

La cadena única que creamos para identificar el recurso Message.

date_sent
date_time<rfc2822> Not PII

La fecha y hora en GMT en que se envió el recurso, especificadas en formato RFC 2822. Para los mensajes salientes, es cuando enviamos el mensaje. En el caso de los mensajes entrantes, es cuando realizamos la solicitud HTTP a tu aplicación móvil.

date_created
date_time<rfc2822> Not PII

La fecha y hora en GMT en que se creó el recurso, especificadas en formato RFC 2822.

error_code
integer? Not PII

El código de error devuelto si el “status” (estado) de tu mensaje es “failed” (fallido) o “undelivered” (no entregado). El error_code proporciona más información sobre el error. Si el mensaje se envió correctamente, este valor es nulo.

price_unit
currency Not PII

Moneda en la que se mide el “precio”, en formato ISO 4127 (por ejemplo, “USD”, “EUR”, “JPY”).

api_version
string Not PII

La versión de API utilizada para procesar el mensaje.

subresource_uris
uri_map Not PII

Una lista de recursos relacionados identificados por sus URL en relación con “https://api.twilio.com”

Create a Message resource

post
https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Messages.json

To send a new outgoing message, make an HTTP POST to this Messages list resource URI.

If you want to send messages while in trial mode, you must first verify your 'To' phone number with Twilio. You can verify your phone number by adding it to your Verified Caller IDs in the console.

When creating a new message via the API, you must include the To parameter. This value should be either a destination phone number or a Channel address. You also need to pass a Body or MediaUrl containing the message's content.

A WhatsApp media message can only contain one media object. Additional MediaURL parameters will be ignored.

You must also include either the From parameter or MessagingServiceSid parameter. You may use MessagingServiceSid if sending your message with a messaging service. Alternatively, you can choose a specific number in a messaging service to set as the From.

There is a slight difference in how Twilio's API responds based on the parameter you include:

  • From: Twilio will validate the phone numbers or Channel addresses synchronously. The API returns either a queued status or an error.
  • MessagingServiceSid: the API will first return a status of accepted. Twilio then determines the optimal From phone number. Any delivery errors will be sent asynchronously to your StatusCallback URL.

If the body of your message is more than 160 GSM-7 characters (or 70 UCS-2 characters), Twilio will send the message as a segmented SMS and charge your account accordingly.

Parameters
Parameters in REST API format
account_sid
Path
post sid<AC> Not PII

El SID de la Account que creará el recurso.

to
Required
post phone_number PII MTL: 120 DAYS

El número de teléfono de destino en formato E.164 para SMS/MMS o la Channel user address para otros canales de terceros.

status_callback
Optional
post url Not PII

La URL a la que deberíamos llamar mediante el “status_callback_method” para enviar información del estado a tu aplicación móvil. Si se especifica, PUBLICAMOS estos cambios de estado de mensaje en la dirección URL: “queued” (en cola), “failed” (fallido), “sent” (enviado), “delivered” (entregado)o “undelivered” (no entregado). Twilio PUBLICARÁ sus standard request parameters así como algunos parámetros adicionales, incluidos “MessageSid”, “MessageStatus” y “ErrorCode”. Si incluyes este parámetro con “messaging_service_sid”, utilizamos esta URL en lugar de la URL de información sobre el estado de los mensajes de Messaging Service. Las URL deben contener un nombre de host válido y no se permiten los guiones bajos.

application_sid
Optional
post sid<AP> Not PII

El SID de la aplicación móvil que debería recibir el estado del mensaje. PUBLICAMOS un parámetro “message_sid” y un parámetro “message_status” con un valor de “sent” (enviado) o “failed” (fallido) en el “message_status_callback” de la application. Si también se pasa un parámetro “status_callback”, este se ignorará y se utilizará el parámetro “message_status_callback” de la aplicación móvil.

max_price
Optional
post decimal Not PII

El precio total máximo en dólares estadounidenses que pagarás por el mensaje que se debe entregar. Puede ser un valor decimal con hasta 4 cifras decimales. Todos los mensajes se ponen en cola para su entrega y el costo del mensaje se comprueba antes de enviarlo. Si el costo excede “max_price”, el mensaje fallará y se enviará un estado de “failed” (fallido) a la información sobre el estado de los mensajes. Si no se establece “MaxPrice”, el costo del mensaje no se comprueba.

provide_feedback
Optional
post boolean Not PII

Si se confirma la entrega del mensaje. Establece este valor como “true” (verdadero) si estás enviando mensajes que tienen una acción de usuario rastreable y tienes la intención de confirmar la entrega del mensaje mediante la Message Feedback API. Este parámetro es “false” (falso) de forma predeterminada.

attempt
Optional
post integer Not PII

Cantidad total de intentos realizados (incluido este) para enviar el mensaje independientemente del proveedor utilizado

validity_period
Optional
post integer Not PII

Cuánto tiempo en segundos puede permanecer el mensaje en nuestra cola de mensajes salientes. Una vez transcurrido este período, el mensaje falla y realizamos una llamada a tu información sobre el estado de los mensajes. Puede ser entre 1 y el valor predeterminado de 14 400 segundos. Sin embargo, después de que un operador móvil haya aceptado un mensaje, no podemos garantizar que el mensaje no se pondrá en cola después de este período. Recomendamos que este valor sea de al menos 5 segundos.

force_delivery
Optional
post boolean Not PII

Reservado

content_retention
Optional
post enum:content_retention Not PII

Determina si el contenido del mensaje se puede almacenar o censurar según la configuración de privacidad

address_retention
Optional
post enum:address_retention Not PII

Determina si la dirección se puede almacenar u ocultar según la configuración de privacidad

smart_encoded
Optional
post boolean Not PII

Si se detectan caracteres Unicode que tienen un carácter GSM-7 similar y se reemplazan. Puede ser: “true” (verdadero) o “false” (falso).

persistent_action
Optional
post string[] Not PII

Acciones enriquecidas para mensajes de canales.

shorten_urls
Optional
post boolean Not PII

Determina el uso del seguimiento de clic. Si se establece en “true” (verdadero), se le indicará a Twilio que reemplace todos los enlaces del mensaje con una versión abreviada basada en el SID del dominio asociado y que haga un seguimiento de los clic en ellos. Si este parámetro no se establece en una llamada a la API, usaremos el valor establecido en el servicio de mensajería. Si este parámetro no se establece y el valor no está configurado en el servicio de mensajería utilizado, el valor predeterminado será “false” (falso).

schedule_type
Optional
post ienum:schedule_type Not PII

Indica tu intención de programar un mensaje. Pasa el valor “fixed” (fijo) para programar un mensaje a una hora fija.

send_at
Optional
post date_time<iso8601> Not PII

La hora a la que Twilio enviará el mensaje. Debe estar en formato ISO 8601.

send_as_mms
Optional
post boolean Not PII

Si se establece en True (Verdadero), Twilio entregará el mensaje como un único mensaje MMS, independientemente de la presencia de archivos multimedia.

content_variables
Optional
post string Not PII

Key-value pairs of variable names to substitution values, used alongside a content_sid. If not specified, Content API will default to the default variables defined at create time.

from
Required if messaging_service_sid is not passed
post phone_number PII MTL: 120 DAYS

Un número de teléfono de Twilio en formato E.164, un alphanumeric sender ID o una Channel Endpoint address que están habilitados para el tipo de mensaje que deseas enviar. Los números de teléfono o short codes que se compraron a Twilio también funcionan aquí. No puedes, por ejemplo, suplantar mensajes de un número de teléfono celular privado. Si estás usando “messaging_service_sid”, este parámetro debe estar vacío.

messaging_service_sid
Required if from is not passed
post sid<MG> Not PII

El SID del Messaging Service que deseas asociar al mensaje. Establece este parámetro para utilizar el Messaging Service Settings and Copilot Features que hayas configurado y deja el parámetro “from” (desde) vacío. Cuando se establezca solo este parámetro, Twilio utilizará las funciones de copiloto habilitadas a fin de seleccionar el número de teléfono de origen para la entrega.

body
Required if media_url, content_sid is not passed
post string PII MTL: 30 DAYS

El texto del mensaje que deseas enviar. Puede tener hasta 1600 caracteres de longitud.

media_url
Required if body, content_sid is not passed
post url[] PII MTL: 30 DAYS

La URL del archivo multimedia que se enviará con el mensaje. El archivo multimedia puede ser del tipo “gif”, “png” y “jpeg” y tendrá el formato correcto en el dispositivo del destinatario. El límite de tamaño de los archivos multimedia es de 5 MB para los tipos de archivo admitidos (JPEG, PNG, GIF) y de 500 KB para other types de archivos multimedia aceptados. Para enviar más de una imagen en el cuerpo del mensaje, proporciona varios parámetros “media_url” en la solicitud POST. Puede incluir hasta 10 parámetros “media_url” por mensaje. Puede enviar imágenes en un mensaje SMS solo en EE. UU. y Canadá.

content_sid
Required if body, media_url is not passed
post sid<HX> Not PII

The SID of the Content object returned at Content API content create time (https://www.twilio.com/docs/content-api/create-and-send-your-first-content-api-template#create-a-template). If this parameter is not specified, then the Content API will not be utilized.

Example 1
Loading Code Sample...
        
        

        Create a message

        Example 2
        Loading Code Sample...
              
              
              Use the whatsapp: prefix to send a WhatsApp message

              Create a WhatsApp Message

              Use the whatsapp: prefix to send a WhatsApp message
              Example 3
              Loading Code Sample...
                    
                    

                    Create a message and specify a StatusCallback URL

                    A note on message rate limiting

                    As you send more messages via the API, Twilio will queue them up for delivery at your prescribed rate limit. API requests for messages that exceed the specified rates will be queued and executed as capacity is available.

                    If your application tries to enqueue more than 4 hours worth of outbound traffic (e.g., enqueuing more than 14,400 messages to Canada over one long code phone number), the API will start returning 429 errors.

                    If you need to enqueue a large volume of messages, you may find that it's helpful to leverage Twilio's Messaging Services. See our guide on how to set up and send messages from a messaging service in your language of choice for more tips.

                    Schedule a Message resource

                    If you'd like to cancel scheduled messages, navigate to the Cancel a Scheduled Message section to learn more.

                    Message scheduling functionality gives you the ability to schedule an SMS, MMS or WhatsApp message for a fixed time in the future.

                    POST https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Messages.json

                    To schedule a new outgoing message, make an HTTP POST to the Messages list resource URI shown above with the following two required parameters:

                    • ScheduleType: This parameter indicates your intent to schedule a message. You should pass the value "fixed" to schedule a message to be sent at a fixed time.
                    • SendAt: This parameter indicates when Twilio will send a message. Your datetime should be in ISO-8601 format.

                    In addition to the two scheduling parameters, you must still include the regular parameters to send a message as described in the Create a Message Resource section: To, Body, MediaUrl (if sending an MMS), and MessageServiceSid (you can pass the MessagingServiceSid in either the MessagingServiceSid parameter or the From parameter).

                    Important Considerations when using Message Scheduling

                    For the full list of Message Scheduling limitations, please see the Message Scheduling FAQ support article. If any of these limitations are blockers, please reach out to us via support@twilio.com:

                    Please note that message scheduling has the following limitations as of now:

                    • Message Scheduling is only accessible on Messaging Services. You need to pass a MessagingServiceSid using either the MessagingServiceSid parameter or From parameter.
                    • A message must be scheduled at least 15 min in advance of message send time and cannot be scheduled more than 7 days in advance of the request.
                    • If you plan to use message scheduling at scale, please review the limitations in the support article.
                    Example 4
                    Loading Code Sample...
                          
                          

                          Schedule a message

                          Note: There is no status callback event for the scheduled status. You can continue to receive existing callback events by including the optional StatusCallBack parameter in the message request.

                          Response Status Codes

                          Valid Parameters: An HTTP 201 (scheduled) will be returned in the synchronous API response when your request parameters are valid. When a message is scheduled, you will see scheduled instead of accepted.

                          Invalid Parameters: An HTTP 400 code will be returned in the API response when your request parameters are invalid.

                          Example 5
                          Loading Code Sample...
                                
                                

                                Schedule a message with an Image URL

                                Example 6
                                Loading Code Sample...
                                      
                                      

                                      Schedule a WhatsApp message

                                      Note: Ensure that your approved WhatsApp sender is added to the number pool of your Messaging Service you intend to use for scheduling a WhatsApp message.

                                      WhatsApp requires that business-initiated notifications sent by your application be templated and pre-registered, with the exception of messages sent as a reply to a user-initiated message. (See Conversational Messaging on WhatsApp for more details).

                                      When scheduling a WhatsApp message, the check for pre-registered templates will only be done at the time of sending the message and not at the time of scheduling the message. If your message does not adhere to the pre-approved WhatsApp templates in your account, the message will be scheduled and fail at send time.

                                      Canceling Scheduled Messages

                                      Once a message is scheduled, you can cancel it from being sent. See the "Cancel a Scheduled Message" section to learn how to cancel scheduled messages.

                                      Fetch a Message resource

                                      get
                                      https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Messages/{Sid}.json

                                      Returns a single message specified by the provided Message {SID}.

                                      Parameters
                                      Parameters in REST API format
                                      account_sid
                                      Path
                                      get sid<AC> Not PII

                                      El SID de la Account que creó el recurso Message que se obtendrá.

                                      sid
                                      Path
                                      get sid<MM> Not PII

                                      La cadena que proporciona Twilio para identificar de forma única el recurso Message que se obtendrá.

                                      Example 1
                                      Loading Code Sample...
                                            
                                            

                                            Fetch Message

                                            Read multiple Message resources

                                            get
                                            https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Messages.json

                                            Returns a list of messages associated with your account. If you are using the Twilio REST API or the Twilio-CLI, the list includes paging information. If you use one of Twilio's Server-Side Helper Libraries, paging happens under the hood.

                                            When getting the list of all messages, results will be sorted on the DateSent field with the most recent messages appearing first.

                                            If you are using the Twilio REST API and plan on requesting more records than will fit on a single page, you may want to use the provided nextpageuri. This method ensures that your next request picks up where it left off and can prevent you from retrieving duplicate data if you are actively sending or receiving messages.

                                            This is not necessary if you are using a Twilio Helper Library, which will automatically handle paging. Take a look at the Helper Library documentation for more information.

                                            You may also filter the list by providing the following query string parameters to the listing resource:

                                            Parameters
                                            Parameters in REST API format
                                            account_sid
                                            Path
                                            get sid<AC> Not PII

                                            El SID de la Account que creó los recursos Message que se leerán.

                                            to
                                            Optional
                                            get phone_number PII MTL: 120 DAYS

                                            Lee mensajes enviados solo a este número de teléfono.

                                            from
                                            Optional
                                            get phone_number PII MTL: 120 DAYS

                                            Lee mensajes enviados solo desde este número de teléfono o ID de remitente alfanumérico.

                                            date_sent
                                            Optional
                                            get date_time_inequality<iso8601> Not PII

                                            La fecha de los mensajes que se van a mostrar. Especifica una fecha como “AAAA-MM-DD” en GMT para leer solo los mensajes enviados en esta fecha. Por ejemplo: “2009-07-06”. También puedes especificar una desigualdad, como “DateSent<=YYYY-MM-DD”, para leer los mensajes enviados un día o antes de la medianoche de una fecha, y “DateSent>=YYYY-MM-DD” para leer los mensajes enviados un día o después de la medianoche de una fecha.

                                            Example 1
                                            Loading Code Sample...
                                                  
                                                  
                                                  Get all messages associated with your account

                                                  Read: List all messages

                                                  Get all messages associated with your account
                                                  Example 2
                                                  Loading Code Sample...
                                                        
                                                        
                                                        List all messages sent on August 31, 2016 from +15017122661 and to +15558675310

                                                        Read: List messages matching filter criteria

                                                        List all messages sent on August 31, 2016 from +15017122661 and to +15558675310
                                                        Example 3
                                                        Loading Code Sample...
                                                              
                                                              
                                                              List all messages sent before March 1st, 2019

                                                              Read: List messages (filter by 'before sent' date)

                                                              List all messages sent before March 1st, 2019
                                                              Example 4
                                                              Loading Code Sample...
                                                                    
                                                                    
                                                                    List all messages sent between January 15th, 2021, 01:23:45 UTC and January 17th, 2021, 01:23:45 UTC

                                                                    Read: List messages (filter by a period of time)

                                                                    List all messages sent between January 15th, 2021, 01:23:45 UTC and January 17th, 2021, 01:23:45 UTC

                                                                    Update a Message resource

                                                                    post
                                                                    https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Messages/{Sid}.json

                                                                    Updates the body of a Message resource.

                                                                    This action is primarily used to redact messages: to do so, POST to the above URI and set the Body parameter as an empty string: "". This will allow you to effectively redact the text of a message while keeping the other message resource properties intact.

                                                                    Parameters
                                                                    Parameters in REST API format
                                                                    account_sid
                                                                    Path
                                                                    post sid<AC> Not PII

                                                                    El SID de la Account que creó los recursos Message que se actualizarán.

                                                                    sid
                                                                    Path
                                                                    post sid<MM> Not PII

                                                                    La cadena que proporciona Twilio para identificar de forma única el recurso Message que se actualizará.

                                                                    body
                                                                    Optional
                                                                    post string PII MTL: 30 DAYS

                                                                    El texto del mensaje que deseas enviar. Puede tener hasta 1600 caracteres de longitud.

                                                                    status
                                                                    Optional
                                                                    post ienum:update_status Not PII

                                                                    Cuando se establece como “canceled” (cancelado), permite una solicitud de cancelación de mensaje si aún no se ha enviado.

                                                                    Example 1
                                                                    Loading Code Sample...
                                                                          
                                                                          
                                                                          To redact the message-body from a message record, POST to the instance with an empty Body

                                                                          Update: redact a message

                                                                          To redact the message-body from a message record, POST to the instance with an empty Body

                                                                          Cancel a Scheduled Message

                                                                          Before you use this functionality:

                                                                          1. Ensure the status value of canceled is spelled with one "l", (canceled) and not two (cancelled).
                                                                          2. Ensure that you store the MessageSid of the messages you schedule. You need to reference the MessageSid for each message cancelation request
                                                                          3. There is no bulk cancelation. If you’d like to cancel multiple messages, you must send in a cancelation request for each message and reference the MessageSid.
                                                                          4. There is a new status callback event for "Canceled". You can continue to receive existing callback events by including the optional StatusCallBack parameter in the message request.

                                                                          Note: We make the best attempt to cancel a scheduled message when we receive your request.

                                                                          Example 2
                                                                          Loading Code Sample...
                                                                                
                                                                                

                                                                                Cancel a scheduled message

                                                                                Delete a Message resource

                                                                                delete
                                                                                https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Messages/{Sid}.json

                                                                                Deletes a message record from your account. Once the record is deleted, it will no longer appear in the API and Account Portal logs.

                                                                                If successful, returns HTTP 204 (No Content) with no body.

                                                                                Attempting to delete an in-progress message record will result in an error.

                                                                                Parameters
                                                                                Parameters in REST API format
                                                                                account_sid
                                                                                Path
                                                                                delete sid<AC> Not PII

                                                                                El SID de la Account que creó los recursos Message que se eliminarán.

                                                                                sid
                                                                                Path
                                                                                delete sid<MM> Not PII

                                                                                La cadena que proporciona Twilio para identificar de forma única el recurso Message que se eliminará.

                                                                                Note: Deleting a message will also delete any media associated with the message, unless the same media object is associated with another message on your account that has not been deleted. For example, if you sent 1000 media messages with the same media attachment, that media object would remain accessible until the 1000 message records associated with it were deleted.

                                                                                Example 1
                                                                                Loading Code Sample...
                                                                                      
                                                                                      

                                                                                      Delete Message

                                                                                      Message Media Subresources

                                                                                      Media List Subresource

                                                                                      Message instance resources have a Media list resource for the set of media elements included with a given Message:

                                                                                      /2010-04-01/Accounts/{AccountSid}/Messages/{MessageSid}/Media

                                                                                      Media Instance Subresource

                                                                                      Message instance resources have Media instance subresources. If media exists on a given message, you can retrieve information about images and other media.

                                                                                      /2010-04-01/Accounts/{AccountSid}/Messages/{MessageSid}/Media/{MediaSid}

                                                                                      Appendix

                                                                                      Message Status Values

                                                                                      The following are the possible values for the 'Status' parameter:

                                                                                      Status Description
                                                                                      accepted Twilio has received your API request to send a message with a Messaging Service and a From number is being dynamically selected. This will be the initial status when sending with a Messaging Service and the From parameter.
                                                                                      scheduled The message is scheduled to be sent. This will be the initial status when scheduling a message with a Messaging Service
                                                                                      queued The API request to send a message was successful and the message is queued to be sent out. This will be the initial status when you are not using a Messaging Service
                                                                                      sending Twilio is in the process of dispatching your message to the nearest upstream carrier in the network.
                                                                                      sent The nearest upstream carrier accepted the message.
                                                                                      receiving The inbound message has been received by Twilio and is currently being processed.
                                                                                      received On inbound messages only. The inbound message was received by one of your Twilio numbers.
                                                                                      delivered Twilio has received confirmation of message delivery from the upstream carrier, and, where available, the destination handset.
                                                                                      undelivered Twilio has received a delivery receipt indicating that the message was not delivered. This can happen for many reasons including carrier content filtering and the availability of the destination handset.
                                                                                      failed The message could not be sent. This can happen for various reasons including queue overflows, account suspensions and media errors (in the case of MMS). Twilio does not charge you for failed messages.
                                                                                      read On WhatsApp messages only. The message has been delivered and opened by the recipient in the conversation. The recipient must have enabled read receipts.
                                                                                      canceled The message has been canceled. This status is only accessible when using a Messaging Service

                                                                                      Minimum library values that support "READ" receipts for WhatsApp messages

                                                                                      • C#: 5.30.0
                                                                                      • Java: 7.39.0
                                                                                      • Node: 3.32.0
                                                                                      • PHP: 5.33.0
                                                                                      • Python: 6.28.0
                                                                                      • Ruby: 5.24.0

                                                                                      Back to the Message properties list.

                                                                                      Delivery Related Errors

                                                                                      When a message's status is 'failed' or 'undelivered', the ErrorCode and ErrorMessage properties will contain one of the following.

                                                                                      Note that the ErrorMessage is meant to be a human-readable description – the values returned are subject to change in the future. A full list of Twilio Error Codes and troubleshooting tips can help you troubleshoot delivery issues.

                                                                                      Error Code Error Message Description
                                                                                      30001 Queue overflow You tried to send too many messages too quickly, and your message queue overflowed. Try sending your message again after waiting for some time.
                                                                                      30002 Account suspended Your account was suspended between the time of message send and delivery. Please contact Twilio.
                                                                                      30003 Unreachable destination handset The destination handset you are trying to reach is switched off or otherwise unavailable.
                                                                                      30004 Message blocked The destination number you are trying to reach is blocked from receiving this message (e.g., due to blacklisting).
                                                                                      30005 Unknown destination handset The destination number you are trying to reach is unknown and may no longer exist.
                                                                                      30006 Landline or unreachable carrier The destination number is unable to receive this message. Potential reasons could include trying to reach a landline or, in the case of short codes, an unreachable carrier.
                                                                                      30007 Carrier violation Your message was flagged as objectionable by the carrier. To protect their subscribers, many carriers have implemented content or spam filtering. Learn more about carrier filtering
                                                                                      30008 Unknown error The error does not fit into any of the above categories.
                                                                                      30009 Missing segment One or more segments associated with your multi-part inbound message was not received.
                                                                                      30010 Message price exceeds max price. The price of your message exceeds the max price parameter.

                                                                                      The following ErrorCodes apply only when you are sending a message via WhatsApp or a Channel.

                                                                                      ErrorCode ErrorMessage Description
                                                                                      63001 Channel could not authenticate the request Channel authentication credentials are incorrect. Please check the credentials in Channel page in Console or re-authenticate with the Channel.
                                                                                      63002 Channel could not find From address The From address does not map to any configured Channels. Check that you are using the correct Channel endpoint address from the Channel page.
                                                                                      63003 Channel could not find To address The To address is incorrect.
                                                                                      63005 Channel did not accept given content
                                                                                      63006 Could not format given content for the channel
                                                                                      63007 Twilio could not find a Channel with the specified From address The From address does not map to any configured Channels. Check that you are using the correct Channel endpoint address from the Channel page.
                                                                                      63008 Could not execute the request because the channel module is misconfigured Please check the Channel configuration in Twilio.
                                                                                      63009 Channel returned an error when executing the request Please see Channel specific error message for more information.
                                                                                      63010 Channels - Twilio Internal error
                                                                                      63012 Channel returned an internal error that prevented it from completing the request
                                                                                      63013 This message send failed because it violates Channel provider's policy. Please see Channel specific error message for more information.
                                                                                      63014 This message failed to be delivered to the user because it was blocked by a user action. Please see Channel specific error message for more information.

                                                                                      Back to the Message properties list.

                                                                                      NumSegments Property

                                                                                      For outbound messages, this property indicates the number of SMS messages it took to deliver the body of the message.

                                                                                      If the body of a message is more than 160 GSM-7 characters (or 70 UCS-2 characters), Twilio will segment and annotate your messages to attempt proper reassembly on the recipient's handset (not supported by all carriers and handsets). This ensures your body text transmits with the highest fidelity.

                                                                                      On inbound messages, this property indicates the number of SMS messages that make up the message received.

                                                                                      If the body of a message is more than 160 GSM-7 characters (or 70 UCS-2 characters), Twilio will attempt to reassemble the message received by your Twilio phone number. All carriers and handsets do not necessarily support this.

                                                                                      Your account will be charged for each segment sent or received.

                                                                                      Back to the Message properties list.

                                                                                      StatusCallback Request Parameters

                                                                                      The parameters Twilio passes to your application in its request to the StatusCallback URL include a subset of the standard request parameters and these additional parameters:

                                                                                      Parameter Description
                                                                                      MessageStatus The status of the message. Message delivery information is reflected in message status. The possible values are listed in the Message resource.
                                                                                      ErrorCode The error code (if any) associated with your message. If your message status is failed or undelivered, the ErrorCode can give you more information about the failure. If the message was delivered successfully, no ErrorCode will be present. Find the possible values here.
                                                                                      ChannelInstallSid The Installed Channel SID (found on the Channel detail page) that was used to send this message. Only present if the message was sent using a Channel.
                                                                                      ChannelStatusMessage The Error message returned by the underlying Channel if Message delivery failed. Only present if the message was sent using a Channel and message delivery failed.
                                                                                      ChannelPrefix Channel specific prefix that allows you to identify which channel this message was sent over.
                                                                                      EventType Contains post-delivery events. If the Channel supports Read receipts, this parameter will be included with a value of READ after the user has read the message. Currently supported only for WhatsApp.

                                                                                      Back to Create a Message resource

                                                                                      Calificar esta página:

                                                                                      ¿Necesitas ayuda?

                                                                                      Todos la necesitamos a veces; la programación es difícil. Obtén ayuda ahora de nuestro equipo de soporte, o recurre a la sabiduría de la multitud visitando Stack Overflow Collective de Twilio o navegando por la etiqueta de Twilio en Stack Overflow.

                                                                                      Loading Code Sample...
                                                                                            
                                                                                            
                                                                                            

                                                                                            Gracias por tus comentarios.

                                                                                            Selecciona los motivos de tus comentarios. La información adicional que nos brindas nos ayuda a mejorar nuestra documentación:

                                                                                            Enviando tus comentarios…
                                                                                            🎉 Gracias por tus comentarios.
                                                                                            Se produjo un error. Inténtalo de nuevo.

                                                                                            Gracias por tus comentarios.

                                                                                            thanks-feedback-gif