GET /messaging/v1/sms/messages/?type=notSent

Gets a paginated list of messages that weren't sent, ordered from oldest to newest.

URL Parameters

Name Type Description
type string Required. Only notSent is supported.
$pageSize integer Number of messageKeys (array elements) to return per response page.
lastEventId integer Event ID from which you want the response to start. To obtain the initial event ID, submit a request without a lastEventId. The events in the response are listed top to bottom from oldest to newest.

Responses

Status Name Type Description
200     Success. Review example response.
  lastEventID integer Event ID from which you want the response to start. To obtain the initial event ID, submit a request without a lastEventId. The events in the response are listed top to bottom from oldest to newest.
  statusCode integer Integer value of the reason the send didn't complete. Review Send Error Codes for more information.
  statusMessage string The reason the send didn't complete. Review Send Error Codes for more information.
  eventCategoryType string TransactionalSendEvent event type. SMSSent indicates that the message was sent for delivery. SMSNotSent indicates that the message wasn't sent and includes the reason. SMSQueued indicates that the SMS hasn't yet been processed for sending.
  timestamp string Time the event occured in Central Standard Time without daylight saving time applied.
  definitionKey string Unique identifier of the definition.
  eventID integer Numeric identifier of the event.
  messageKey string Unique identifier to track message send status.
  contactKey string Unique identifier for a subscriber.
  to string Channel address of the recipient. For SMS, it’s the recipient's mobile address.

Usage

This sample request shows how to retrieve unsent SMS messages for a specified SMS event.

Host: https://YOUR_SUBDOMAIN.rest.marketingcloudapis.com
GET /messaging/v1/sms/messages/?type=notSent&$pagesize=20&lastEventId=35759
Content-Type: application/json
Authorization: Bearer YOUR_ACCESS_TOKEN

The response is an HTTP 200 response that contains information about the unsent messages.

{
  "lastEventID": 35774,
  "messages": [
    {
      "statusCode": 24,
      "statusMessage": "Error Message",
      "eventCategoryType": "TransactionalSendEvents.SMSNotSent",
      "timestamp": "2018-12-17T13:05:40.947",
      "definitionKey": "account-reset",
      "eventID": 35760,
      "info": {
        "messageKey": "2iQNfGHj2UqTalK9x2gPow",
        "contactKey": "example1"
      }
    }
  ],
  "count": 1
}

HTTP Responses

Response Reason
200 OK Success. Review example response.
400 Bad Request Invalid request
401 Unauthorized Failed to pass authorization.
500 Server Error Internal error