Menu

Expand
Rate this page:

Sending Messages

We can send text messages through the Proxy API by creating a Message Interaction on a Participant. The referenced Participant will receive the message from their allocated proxy number on the appropriate channel.

Note: Only POST (create) is available on Message Interactions. To query past messages you've created with this resource, query the Interaction resource.

MessageInteraction properties

Resource Properties in REST API format
sid
sid<KI> Not PII

The unique string that we created to identify the MessageInteraction resource.

session_sid
sid<KC> Not PII

The SID of the parent Session resource.

service_sid
sid<KS> Not PII

The SID of the parent Service resource.

account_sid
sid<AC> Not PII

The SID of the Account that created the MessageInteraction resource.

data

A JSON string that includes the message body sent to the participant. (e.g. {"body": "hello"})

type
enum:type Not PII

The Type of Message Interaction. This value is always message.

participant_sid
sid<KP> Not PII

The SID of the Participant resource.

inbound_participant_sid
sid<KP> Not PII

Always empty for created Message Interactions.

inbound_resource_sid
sid Not PII

Always empty for created Message Interactions.

inbound_resource_status
enum:resource_status Not PII

Always empty for created Message Interactions.

inbound_resource_type
string Not PII

Always empty for created Message Interactions.

inbound_resource_url
url Not PII

Always empty for created Message Interactions.

outbound_participant_sid
sid<KP> Not PII

The SID of the outbound Participant resource.

outbound_resource_sid
sid Not PII

The SID of the outbound Message resource.

outbound_resource_status
enum:resource_status Not PII

The outbound message resource status. Can be: accepted, deleted, delivered, delivery-unknown, failed, queued, received, receiving, scheduled, sending, sent, undelivered, or unknown.

outbound_resource_type
string Not PII

The outbound resource type. This value is always Message.

outbound_resource_url
url Not PII

The URL of the Twilio message resource.

date_created
date_time<iso8601> Not PII

The ISO 8601 date and time in GMT when the resource was created.

date_updated
date_time<iso8601> Not PII

The ISO 8601 date and time in GMT when the resource was last updated.

url
url Not PII

The absolute URL of the MessageInteraction resource.

Create a MessageInteraction resource

post
https://proxy.twilio.com/v1/Services/{ServiceSid}/Sessions/{SessionSid}/Participants/{ParticipantSid}/MessageInteractions
Parameters
Parameters in REST API format
service_sid
Path
post sid<KS> Not PII

The SID of the parent Service resource.

session_sid
Path
post sid<KC> Not PII

The SID of the parent Session resource.

participant_sid
Path
post sid<KP> Not PII

The SID of the Participant resource.

body
Required if media_url is not passed
post string Not PII

The message to send to the participant

media_url
Required if body is not passed
post url[] Not PII

Reserved. Not currently supported.

Example 1
Loading Code Sample...
        
        

        Create Message Interaction

        Rate this page:

        Need some help?

        We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd by visiting Twilio's Stack Overflow Collective or browsing the Twilio tag on Stack Overflow.

        Loading Code Sample...
              
              
              

              Thank you for your feedback!

              Please select the reason(s) for your feedback. The additional information you provide helps us improve our documentation:

              Sending your feedback...
              🎉 Thank you for your feedback!
              Something went wrong. Please try again.

              Thanks for your feedback!

              thanks-feedback-gif