Retrieve SMS Event History for a Device:

POST /devices/sms/history/actions/list

Returns the history of mobile-originated/mobile-terminated SMS messages for a single device that were sent or received via ThingSpace, within a specified time period.

Contents

Uses and Requirements

The following limitations apply to retrieving the SMS event history:

  • A maximum of 500 SmsEvent records can be returned in a single request. To obtain more records, you can call the API multiple times, adjusting the earliest and latest parameters each time to start where the previous request ended.
  • ThingSpace persists historical SMS messages for up to 3 months.

You must register for the DeviceService callback service to receive the callback response.

Request Components

HTTP Request

POST https://thingspace.verizon.com/api/m2m/v1/devices/sms/history/actions/list

Resource Path and Query Parameters

None.

Header Parameters

The request header must contain a current ThingSpace authorization bearer token and a valid VZ-M2M session token, and must set the content-type to JSON.

Parameter Name Data Type Description
Parameter NameAuthorization
required
Data Typestring DescriptionHTTP Authorization bearer token.
Parameter NameVZ-M2M-Token
required
Data Typestring DescriptionA valid session token returned by POST /session/login.
Parameter NameContent-Type
required
Data Typestring DescriptionMust be application/json.

Request Body

The request body identifies the device identifier and specifies a time frame for which SMS events should be returned.

Parameter Name Data Type Description
Parameter NamedeviceId
optional
Data TypedeviceId object DescriptionAn identifier for a single device.
Parameter NamedeviceId.kind,
deviceId.id
required for deviceId
Data Typestring DescriptionThe type and value of the device identifier.
  • ESN - decimal, 11 digits
  • ICCID - decimal, up to 20 digits
  • IMEI - decimal, up to 15 digits
  • MDN - decimal, 10 digits
  • MEID - hexadecimal, 14 hex digits
  • MSISDN - decimal, 11 digits
Parameter Nameearliest
optional
Data Typestring DescriptionOnly include smsEvents that occurred after this date and time.
Parameter Namelatest
optional
Data Typestring DescriptionOnly include smsEvents that occurred before this date and time.

Example Request Body

{
   "deviceId":{
      "id":"89148000000800139708",
      "kind":"iccid"
   },
   "earliest":"2019-05-01T00:00:01Z",
   "latest":"2019-06-01T00:00:01Z"
}

Success Response

Status 200

Parameter Name Data Type Description
Parameter NamerequestId Data Typestring DescriptionA unique string that associates the request with the results that are sent via a callback message.
ThingSpace sends a separate callback message for each device that was in the request indicating whether the operation succeeded for that device. All of the callback messages have the same requestId.

Example Success Response

{
   "requestId":"595f5c44-c31c-4552-8670-020a1545a84d"
}

Callback Responses

The DeviceService sends a callback that contains an array of a maximum of 500 SmsEvents objects, that contain detailed information about each event.

Parameter Name Data Type Description
Parameter Nameusername Data Typestring DescriptionThe username defined when a URL was registered for the callback service, or an empty element if no username was defined.
Parameter Namepassword Data Typestring DescriptionThe password defined when a URL was registered for the callback service, or an empty element if no password was defined.
Parameter NamerequestId Data Typestring DescriptionA unique string that matches the RequestId returned in the synchronous response to the original API request. A separate callback message is sent for each device that matched the request criteria, indicating whether the operation succeeded for that device. All of the callback messages have the same RequestId.
Parameter NamedeviceResponse Data Typearray DescriptionAn array of objects.
Parameter NamesmsEventHistoryResponse Data Typearray DescriptionArray of device identifiers and smsEvents objects.
Parameter NamedeviceId
optional
Data TypedeviceId object DescriptionAn identifier for a single device.
Parameter NamedeviceId.kind,
deviceId.id
required for deviceId
Data Typestring DescriptionThe type and value of the device identifier.
  • ESN - decimal, 11 digits
  • ICCID - decimal, up to 20 digits
  • IMEI - decimal, up to 15 digits
  • MDN - decimal, 10 digits
  • MEID - hexadecimal, 14 hex digits
  • MSISDN - decimal, 11 digits
Parameter NameSmsEvents Data Typearray DescriptionArray of SmsEvent objects.
Parameter NameSmsEvents.TimeStamp Data TypedateTime DescriptionThe date and time that the message was sent or received.
Parameter NameSmsEvents.SmsType Data Typestring DescriptionValid values include:
  • MoSms - mobile originated
  • MtSms - mobile terminated
Parameter NameSmsEvents.SentTo Data Typestring DescriptionThe identifier to which the message was sent.
Parameter NameSmsEvents.SentFrom Data Typestring DescriptionThe identifier from where the message was sent.
Parameter NameSmsEvents.Message Data Typestring DescriptionThe contents of the message.
Parameter NameSmsEvents.encoding Data Typestring DescriptionThe type of message encoding that was used to send the message.
Parameter NamesmsEvents.deliveryStatus Data Typestring Description

The status of the message. Valid values include:

  • Scheduled
  • Enroute
  • Delivered
  • Expired
  • Deleted
  • Undeliverable
  • Accepted
  • Unknown
  • Rejected
  • Skipped
  • Failed
Parameter NamecallbackCount Data Typeinteger DescriptionThe number of times this callback message has been sent.
Parameter NamemaxCallbackThreshold Data Typeinteger DescriptionThe maximum number of times this callback message is sent if it is not correctly acknowledged.

Example Success Response

{
   "username":"string",
   "password":"string",
   "requestId":"1555a252-e23f-4914-b916-7b477e4c9d90",
   "deviceResponse":{
      "smsEventHistoryResponse":{
         "deviceId":{
            "id":"0123456789",
            "kind":"msisdn"
         },
         "smsEvents":[
            {
               "timestamp":"2020-02-28T17:52:17+0000",
               "smsType":"MoSms",
               "sentFrom":"17243253868",
               "message":"?{h??",
               "encoding":"US-ASCII",
               "deliveryStatus":"Delivered"
            },
            {
               "timestamp":"2020-03-03T17:42:53+0000",
               "smsType":"MtSms",
               "sentTo":"2557177127",
               "message":"labttqhfvn",
               "encoding":"US-ASCII",
               "deliveryStatus":"Scheduled"
            },
            {
               "timestamp":"2020-03-09T14:58:08+0000",
               "smsType":"MtSms",
               "sentTo":"2557177127",
               "message":"lryuchiedd",
               "encoding":"US-ASCII",
               "deliveryStatus":"Delivered"
            },
            {
               "timestamp":"2020-03-09T16:55:16+0000",
               "smsType":"MtSms",
               "sentTo":"2557177127",
               "message":"ygpcmzbrhn",
               "encoding":"US-ASCII",
               "deliveryStatus":"Scheduled"
            },
            {
               "timestamp":"2020-03-10T16:26:24+0000",
               "smsType":"MtSms",
               "sentTo":"2557177127",
               "message":"iqiqhwjkmu",
               "encoding":"US-ASCII",
               "deliveryStatus":"Delivered"
            },
            {
               "timestamp":"2020-03-10T16:28:55+0000",
               "smsType":"MtSms",
               "sentTo":"2557177127",
               "message":"evgnmtcuhj",
               "encoding":"US-ASCII",
               "deliveryStatus":"Delivered"
            },
            {
               "timestamp":"2020-03-10T16:35:06+0000",
               "smsType":"MtSms",
               "sentTo":"2557177127",
               "message":"zdskemrpsg",
               "encoding":"US-ASCII",
               "deliveryStatus":"Delivered"
            },
            {
               "timestamp":"2020-03-10T16:43:37+0000",
               "smsType":"MtSms",
               "sentTo":"2557177127",
               "message":"xxfkjlinyz",
               "encoding":"US-ASCII",
               "deliveryStatus":"Delivered"
            },
            {
               "timestamp":"2020-03-10T17:00:36+0000",
               "smsType":"MtSms",
               "sentTo":"2557177127",
               "message":"nxlhfceybs",
               "encoding":"US-ASCII",
               "deliveryStatus":"Scheduled"
            },
            {
               "timestamp":"2020-03-10T17:05:56+0000",
               "smsType":"MtSms",
               "sentTo":"2557177127",
               "message":"czbsvpekzb",
               "encoding":"US-ASCII",
               "deliveryStatus":"Scheduled"
            },
            {
               "timestamp":"2020-03-12T13:26:38+0000",
               "smsType":"MtSms",
               "sentTo":"2557177127",
               "message":"gfdvidznli",
               "encoding":"US-ASCII",
               "deliveryStatus":"Delivered"
            },
            {
               "timestamp":"2020-03-12T15:21:14+0000",
               "smsType":"MtSms",
               "sentTo":"2557177127",
               "message":"hrnbhdiygu",
               "encoding":"US-ASCII",
               "deliveryStatus":"Scheduled"
            },
            {
               "timestamp":"2020-03-12T15:29:59+0000",
               "smsType":"MtSms",
               "sentTo":"2557177127",
               "message":"uxcikgvinz",
               "encoding":"US-ASCII",
               "deliveryStatus":"Delivered"
            },
            {
               "timestamp":"2020-03-12T15:32:29+0000",
               "smsType":"MtSms",
               "sentTo":"2557177127",
               "message":"ksbsrcgkfb",
               "encoding":"US-ASCII",
               "deliveryStatus":"Delivered"
            },
            {
               "timestamp":"2020-03-16T15:14:14+0000",
               "smsType":"MtSms",
               "sentTo":"2557177127",
               "message":"vxaghtkpeb",
               "encoding":"US-ASCII",
               "deliveryStatus":"Delivered"
            },
            {
               "timestamp":"2020-03-16T15:41:14+0000",
               "smsType":"MtSms",
               "sentTo":"2557177127",
               "message":"zxnckzabzw",
               "encoding":"US-ASCII",
               "deliveryStatus":"Scheduled"
            }
         ]
      }
   },
   "callbackCount":1,
   "maxCallbackThreshold":4
}

Failure Responses

Status 400

All error messages are returned in this format:

{
   "errorCode":"error code string",
   "errorMessage":"error message string"
}

Error codes and messages are listed on the Error Messages page, along with explanations and suggestions for corrective actions.