Update

View as Markdown

Use this endpoint for the Media method to update a message body after it has been sent. Useful for removing sensitive information from the body after the message has been received.

Path parameters

AccountSidstringRequiredformat: "uuid"
The unique identifier of the project that sent or received this message.
SidstringRequiredformat: "uuid"
A unique ID that identifies this specific message.

Request

BodystringRequired<=0 characters
The new body of the message. Must be an empty string to redact the message content.

Response

account_sidstringRequiredformat: "uuid"
The unique identifier of the project that sent or received this message.
api_versionstringRequired
The version number of the SignalWire cXML REST API used to handle this message.
bodystring or nullRequired
The text of the message. Up to 1600 characters long. May be null if filtered for spam.
num_segmentsintegerRequired
The number of segments that make up the entire message.
num_mediaintegerRequired
The number of media files that were included with the message.
date_createdstringRequired
The date and time the message was created in RFC 2822 format.
date_sentstring or nullRequired
The date and time the message was sent in RFC 2822 format, or null if not yet sent.
date_updatedstringRequired
The date and time the message was last updated in RFC 2822 format.
directionenumRequired
The direction of the message.
Allowed values:
error_codestring or nullRequired
If an error has occurred on the message, the error code will give you a specific code, or null if no error.
error_messagestring or nullRequired
A human readable description of the error that occurred, or null if no error.
fromstringRequired
The phone number in E.164 format that sent the message.
pricedouble or nullRequired
The cost of the individual message billed to your project, or null if not yet calculated.
price_unitstringRequired
The currency in which `price` is charged as.
sidstringRequiredformat: "uuid"
A unique ID that identifies this specific message.
statusenumRequired
Current status of the message.
tostringRequired
The phone number in E.164 format that received the message.
messaging_service_sidstring or nullRequiredformat: "uuid"
If a number group was used when sending an outbound message, the number group's ID will be present, or null otherwise.
uristringRequired
The URI of this particular message.
subresource_urisobjectRequired
The URIs for any subresources associated with this message.

Request examples

1const { RestClient } = require('@signalwire/compatibility-api')
2const client = RestClient('YourProjectID', 'YourAuthToken', { signalwireSpaceUrl: 'example.signalwire.com' })
3
4client.messages('MessageSid')
5 .update({body: 'Overridden'})
6 .then(message => console.log(message.to))
7 .done();

Request: redact a message

Redact a message body by posting an empty string as the body to a sent message.

1const { RestClient } = require('@signalwire/compatibility-api')
2const client = RestClient('YourProjectID', 'YourAuthToken', { signalwireSpaceUrl: 'example.signalwire.com' })
3
4client.messages('MessageSid')
5 .update({body: ''})
6 .then((message) => process.stdout.write(message.body));