Menu

Expand
Rate this page:

UserDefinedMessage Resource

This feature is in Public Beta.

See the Voice SDK Call Message Events page for more information.

A UserDefinedMessage Resource represents a user-defined message that is sent to a Voice SDK end user during an active Call.

A UserDefinedMessage Resource can only be created during an active Call associated with the Voice SDK.

Read more about the Voice SDK messaging feature on the Voice SDK Call Message Events Page.

UserDefinedMessage Resource Properties

Resource Properties in REST API format
account_sid
sid<AC> Not PII

The SID of the Account that created User Defined Message.

call_sid
sid<CA> Not PII

The SID of the Call the User Defined Message is associated with.

sid
sid<KX> Not PII

The SID that uniquely identifies this User Defined Message.

date_created
date_time<rfc2822> Not PII

The date that this User Defined Message was created, given in RFC 2822 format.

Create a UserDefinedMessage Resource

post
https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/UserDefinedMessages.json
Parameters
Parameters in REST API format
account_sid
Path
post sid<AC> Not PII

The SID of the Account that created User Defined Message.

call_sid
Path
post sid<CA> Not PII

The SID of the Call the User Defined Message is associated with.

content
Required
post string Not PII

The User Defined Message in the form of URL-encoded JSON string.

idempotency_key
Optional
post string Not PII

A unique string value to identify API call. This should be a unique string value per API call and can be a randomly generated.

Send a message from the server side to the Voice SDK by making a POST request to an active Call's UserDefinedMessages endpoint.

The content of your message is contained in the Content parameter of your request as a stringified JSON object.

Use the appropriate Call SID in the path of your POST request. Use the parent Call SID if you wish to send a message to parent Call leg. Use the child Call SID if you wish to send a message to the child Call leg.

See the Voice SDK Overview page for more information on Voice SDK Call legs.

Example 1
Loading Code Sample...
        
        

        Send a message to an SDK end-user

        Related resources

        Go to the Voice SDK Call Message Events page to learn more.

        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