Retrieve

View as Markdown

Use this endpoint for the Media method to retrieve a single message.

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.

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.
Response
1{
2 "account_sid": "ea108133-d6b3-407c-9536-9fad8a929a6a",
3 "api_version": "2010-04-01",
4 "body": "Hello World!",
5 "num_segments": 1,
6 "num_media": 1,
7 "date_created": "Mon, 13 Aug 2018 21:38:46 +0000",
8 "date_sent": "Mon, 13 Aug 2018 21:38:46 +0000",
9 "date_updated": "Mon, 13 Aug 2018 21:38:46 +0000",
10 "direction": "inbound",
11 "error_code": "30001",
12 "error_message": "Queue overflow",
13 "from": "+15551234567",
14 "price": 0.005,
15 "price_unit": "USD",
16 "sid": "0a059168-ead0-41af-9d1f-343dae832527",
17 "status": "queued",
18 "to": "+15557654321",
19 "messaging_service_sid": "b3877c40-da60-4998-90ad-b792e98472ms",
20 "uri": "/api/laml/2010-04-01/Accounts/ea108133-d6b3-407c-9536-9fad8a929a6a/Messages/0a059168-ead0-41af-9d1f-343dae832527.json",
21 "subresource_uris": {
22 "media": "/api/laml/2010-04-01/Accounts/ea108133-d6b3-407c-9536-9fad8a929a6a/Messages/0a059168-ead0-41af-9d1f-343dae832527/Media.json"
23 }
24}

Request examples

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