About

This API method allows you to programmatically retrieve details about a previously sent or received SMS message.

Your account and property must be enabled for SMS. Please contact client services to have SMS enabled.

Resource URI

SMS messages are retrieved using the following call.

GET
/v2/Messages/{MessageSid}

Request

URI Parameters

ParameterTypeDescription
MessageSidstringThe secure identifier of the message.

Response

200 - OK

On successful retrieval of the SMS message, a 200 OK is returned with a JSON formatted Message Resource instance.

Note that all timestamp fields are specified as seconds since the unix epoch and all represented within UTC.

Message Resource Parameters

ParameterTypeDescription
MessageSidstringThe message secure identifier which uniquely identifies this message.
AccountSidstringThe account secure identifier associated with the message.
PropertySidstringThe property secure identifier associated with the message.
FromstringThe alphanumeric or E164 formatted sender ID of the message.
TostringThe E164 formatted recipient of the SMS message.
TextstringThe content of the SMS message.
DeliveryReceiptbooleanSet to true if a delivery receipt was requested and false otherwise.
NumSegmentsintegerThe number of message segments.
StatusstringThe message status. See below table for possible values.
DirectionstringThe direction of the message (as a response to this request always Transmit. Possible values: Transmit and Receive).
ScheduledtimestampTimestamp of when the message is/was scheduled to be sent.
CreatedtimestampTimestamp of when the message resource was created.
SubmittedtimestampTimestamp of when the message was submitted to the SMS Center.
DeliveredtimestampTimestamp of when the message delivery occurred.
ReceivedtimestampTimestamp of when an inbound message was received.
ErrorCodestringError code (if message submission or delivery failed).
ExternalIdstringuser-defind id provided when sending the message.

Example: An example response to the successful retrieval of the SMS.

{
	"MessageSid": "M87DMNHSDJHSD48DMNSDS6VJCNKD9MD0",
	"AccountSid": "AG5T3HFR5ASD54FS5GB3SDAFJAKSH6DS",
	"PropertySid": "S7DNJ9KJDS0MDS23DKS9QMZ8DKJSD9KL",
	"From": "+6199111222",
	"To": "+61488023555",
	"Text": "You call that an antenna?",
	"DeliveryReceipt": true,
	"NumSegments": 0,
	"Status": "Processing",
	"Direction": "Transmit",
	"Created": 1506568010,
	"ErrorCode": "",
	"ExternalId": "TestId"
}

Description of possible status values

StatusDescription
ProcessingThe message has been received by our system and is being processed.
SubmittedThe message has been submitted successfully to the SMS Center.
DeliveredThe message has been delivered successfully (if delivery receipts are activated).
FailedThe message has failed (submission to the SMS Center was not possible within a reasonable time limit).
ReceivedThe message has been received (for inbound messages).

400 - Error

For error codes and messages, please refer to the REST API Error Codes page.