Update message
Individual chat messages
Path parameters
-
The SID of the Service to update the Message resource in.
Minimum length is
34
, maximum length is34
. Format should match the following pattern:^IS[0-9a-fA-F]{32}$
. -
The SID of the Channel the Message resource to update belongs to. This value can be the Channel resource's
sid
orunique_name
. -
The SID of the Message resource to update.
Minimum length is
34
, maximum length is34
. Format should match the following pattern:^IM[0-9a-fA-F]{32}$
.
Body
-
The message to send to the channel. Can be an empty string or
null
, which sets the value as an empty string. You can send structured data in the body by serializing it as a string. -
A valid JSON string that contains application-specific data.
-
The date, specified in ISO 8601 format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. This parameter should only be used when a Chat's history is being recreated from a backup/separate source.
-
The date, specified in ISO 8601 format, to assign to the resource as the date it was last updated.
-
The Identity of the User who last updated the Message, if applicable.
-
The Identity of the message's author.
curl \
--request POST 'https://chat.twilio.com/v2/Services/{ServiceSid}/Channels/{ChannelSid}/Messages/{Sid}' \
--user "username:password" \
--header "Content-Type: application/x-www-form-urlencoded" \
--header "X-Twilio-Webhook-Enabled: true" \
--data 'Body=Hello&From=fromUser&Attributes=%7B+%22foo%22%3A+%22bar%22+%7D&DateCreated=2015-12-16T22%3A18%3A37Z&DateUpdated=2015-12-16T22%3A18%3A38Z&LastUpdatedBy=username'
{"Body"=>"Hello", "From"=>"fromUser", "Attributes"=>"{ \"foo\": \"bar\" }", "DateCreated"=>"2015-12-16T22:18:37Z", "DateUpdated"=>"2015-12-16T22:18:38Z", "LastUpdatedBy"=>"username"}
{
"to": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"sid": "IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"body": "Hello",
"from": "fromUser",
"type": "text",
"index": 0,
"media": null,
"attributes": "{ \"foo\": \"bar\" }",
"was_edited": true,
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"date_created": "2015-12-16T22:18:37Z",
"date_updated": "2015-12-16T22:18:38Z",
"last_updated_by": "username"
}