AWS End User Messaging SMS can stream event data about SMS, MMS, and voice message deliveries. Events generated
by carriers can take up to 72 hours to be received and should not be used to determine if
there is a delay in outbound message delivery. After 72 hours, if AWS End User Messaging SMS has not received a
final event from a carrier, the service will automatically return an UNKNOWN
messageStatus
as we do not know what happened to that message.
SMS example log
The JSON object for an SMS event contains the data shown in the following example.
{
"eventType": "TEXT_SUCCESSFUL",
"eventVersion": "1.0",
"eventTimestamp": 1686975103470,
"isFinal": true,
"originationPhoneNumber": "+12065550152",
"destinationPhoneNumber": "+14255550156",
"isoCountryCode": "US",
"mcc": "310",
"mnc": "800",
"messageId": "862a8790-60c0-4430-9b2b-658bdexample",
"messageRequestTimestamp": 1686975103170,
"messageEncoding": "GSM",
"messageType": "PROMOTIONAL",
"messageStatus": "SUCCESSFUL",
"messageStatusDescription": "Message has been accepted by phone carrier",
"context": {
"account": "bar"
},
"totalMessageParts": 1,
"totalMessagePrice": 0.09582,
"totalCarrierFee": 0.0
}
Attribute | Description |
---|---|
eventType |
The type of event. Values are listed in Event types for SMS, MMS, and voice |
eventVersion |
The version of the event JSON schema. |
eventTimestamp |
The time when the event was reported, shown as Unix time in milliseconds. |
isFinal |
True if this is the final status for the message. There
are intermediate message statuses and it can take up to 72 hours for the
final message status to be received. |
originationPhoneNumber |
The phone number that the message was sent from. |
destinationPhoneNumber |
The phone number that you attempted to send the message to. |
isoCountryCode |
The country that's associated with the recipient's phone number, shown in ISO 3166-1 alpha-2 format. |
mcc |
Mobile Country Codes identifies the country which a phone number belongs to. This field is optional and may not be present. |
mnc |
Mobile Network Codes identifies a mobile network operator. This field is optional and may not be present. |
messageId |
The unique ID that AWS End User Messaging SMS generates when it accepts the message. |
messageRequestTimestamp |
The time when the SMS message request was received, shown as Unix time in milliseconds. |
messageEncoding |
The encoding of the message. Possible values are GSM and Unicode. For more information on message encoding, see SMS character limits. |
messageType |
The type of message. Possible values are Promotional and Transactional. |
messageStatus |
The status of the message. Possible values are:
|
messageStatusDescription |
A description of the message status. |
context |
Custom attributes you can specify and will be logged, when you send a message. |
totalMessageParts |
The number of message parts that AWS End User Messaging SMS created in order to send the message. Generally, SMS messages can contain only 160 GSM-7 characters or 67 non-GSM characters, although these limits can vary by country . If you send a message that exceeds these limits, AWS End User Messaging SMS automatically splits the message into smaller parts. We bill you based on the number of message parts that you send. For more information on message parts, see What are the Message Parts per Second (MPS) limits. |
totalMessagePrice |
The amount that we charged you to send the message. This price is
shown in thousandths of a United States cent. For example, if the value
of this attribute is 645 , then we charged you 0.645¢
to send the message (645 / 1000 = 0.645¢ =
$0.00645). |
totalCarrierFee |
The total cost of carrier fees for a message. |
Voice example event log
The JSON object for a Voice event contains the data shown in the following example.
{
"eventType": "VOICE_COMPLETED",
"eventVersion": "1.0",
"eventTimestamp": 1697835373500,
"isFinal": true,
"originationPhoneNumber": "+12065550153",
"destinationPhoneNumber": "+14255550159",
"isoCountryCode": "US",
"messageId": "567f6c11-6e8b-4352-9749-a42a0example",
"messageRequestTimestamp": 1697835372720,
"messageStatus": "COMPLETED",
"callDurationInSeconds": 60,
"totalDurationInMinutes": 1,
"totalMessagePrice": 0.013,
"context": {
"account": "bar"
}
}
Attribute | Description |
---|---|
eventType |
The type of event. Values are listed in Event types for SMS, MMS, and voice |
eventVersion |
The version of the event JSON schema. |
eventTimestamp |
The time when the event was reported, shown as Unix time in milliseconds. |
isFinal |
True if this is the final status for the message. There
are intermediate message statuses. |
originationPhoneNumber |
The phone number that the message was sent from. |
destinationPhoneNumber |
The phone number that you attempted to send the message to. |
isoCountryCode |
The country that's associated with the recipient's phone number, shown in ISO 3166-1 alpha-2 format. |
messageId |
The unique ID that AWS End User Messaging SMS generates when it accepts the message. |
messageRequestTimestamp |
The time when the SMS message request was received, shown as Unix time in milliseconds. |
messageStatus |
The status of the message. Possible values are:
|
callDurationInSeconds |
The duration of the call in seconds. |
totalDurationInMinutes |
The duration of the call in minutes. |
totalMessagePrice |
The amount that we charged you to send the voice message. This price is shown in thousandths of a United States cent. |
context |
Custom attributes you can specify and will be logged, when you send a message. |
MMS example log
The JSON object for an MMS event contains the data shown in the following example.
{
"contentType":"MMS",
"eventType": "MEDIA_DELIVERED",
"eventVersion": "1.0",
"eventTimestamp": 1635197695208,
"isFinal": true,
"originationPhoneNumber": "+12065550153",
"destinationPhoneNumber": "+14255550159",
"isoCountryCode": "US",
"messageId": "b4a3196d-5b61-4884-a0d9-745acf1f6235example",
"messageRequestTimestamp": 1635197693241,
"messageType": "TRANSACTIONAL",
"messageStatus": "DELIVERED",
"messageStatusDescription": "Message has been accepted by phone",
"context": {"foo":"bar"},
"totalMessageParts": 1,
"totalMessagePrice": 0.0195,
"totalCarrierFee": 0.00266
}
Attribute | Description |
---|---|
eventType |
The type of event. Values are listed in Event types for SMS, MMS, and voice |
eventVersion |
The version of the event JSON schema. |
eventTimestamp |
The time when the event was reported, shown as Unix time in milliseconds. |
isFinal |
True if this is the final status for the message. There
are intermediate message statuses and it can take up to 72 hours for the
final message status to be received. |
originationPhoneNumber |
The phone number that the message was sent from. |
destinationPhoneNumber |
The phone number that you attempted to send the message to. |
isoCountryCode |
The country that's associated with the recipient's phone number, shown in ISO 3166-1 alpha-2 format. |
messageId |
The unique ID that AWS End User Messaging SMS generates when it accepts the message. |
messageRequestTimestamp |
The time when the SMS message request was received, shown as Unix time in milliseconds. |
messageType |
The type of message. Possible values are Promotional and Transactional. |
messageStatus |
The status of the message. Possible values are:
|
messageStatusDescription |
A description of the message status. |
context |
Custom attributes you can specify and will be logged, when you send a message. |
totalMessageParts |
The number of message parts that AWS End User Messaging SMS created in order to send the message. For more information on message parts, see What are the Message Parts per Second (MPS) limits. |
totalMessagePrice |
The amount that we charged you to send the message. This price is
shown in thousandths of a United States cent. For example, if the value
of this attribute is 645 , then we charged you 0.645¢
to send the message (645 / 1000 = 0.645¢ =
$0.00645). |
totalCarrierFee |
The total cost of carrier fees for a message. |