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
|
The SID of the Account that created User Defined Message. |
call_sid
|
The SID of the Call the User Defined Message is associated with. |
sid
|
The SID that uniquely identifies this User Defined Message. |
date_created
|
The date that this User Defined Message was created, given in RFC 2822 format. |
Create a UserDefinedMessage Resource
https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/UserDefinedMessages.json
Parameters
Parameters in REST API format | |
---|---|
account_sid
Path
|
The SID of the Account that created User Defined Message. |
call_sid
Path
|
The SID of the Call the User Defined Message is associated with. |
content
Required
|
The User Defined Message in the form of URL-encoded JSON string. |
idempotency_key
Optional
|
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
Related resources
Go to the Voice SDK Call Message Events page to learn more.
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.