Get SMS Event History

Get SMS 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
Authorization
required
string HTTP Authorization bearer token.
VZ-M2M-Token
required
string A valid session token returned by POST /session/login.
Content-Type
required
string Must 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
deviceId
optional
deviceId object An identifier for a single device.
deviceId.kind,
deviceId.id
required for deviceId
string The 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
earliest
optional
string Only include smsEvents that occurred after this date and time.
latest
optional
string Only 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:01Z5"
}

Success Response

Status 200

Parameter Name Data Type Description
requestId string A 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
username string The username defined when a URL was registered for the callback service, or an empty element if no username was defined.
password string The password defined when a URL was registered for the callback service, or an empty element if no password was defined.
requestId string A 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.
deviceResponse array An array of objects.
smsEventHistoryResponse array Array of device identifiers and smsEvents objects.
deviceId
optional
deviceId object An identifier for a single device.
deviceId.kind,
deviceId.id
required for deviceId
string The 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
SmsEvents array Array of SmsEvent objects.
SmsEvents.TimeStamp dateTime The date and time that the message was sent or received.
SmsEvents.SmsType string Valid values include:
  • MoSms - mobile originated
  • MtSms - mobile terminated
SmsEvents.SentTo string The identifier to which the message was sent.
SmsEvents.SentFrom string The identifier from where the message was sent.
SmsEvents.Message string The contents of the message.
SmsEvents.encoding string The type of message encoding that was used to send the message.
smsEvents.deliveryStatus string The status of the message. Valid values include:
  • Scheduled
  • Delivered
callbackCount integer The number of times this callback message has been sent.
maxCallbackThreshold integer The maximum number of times this callback message is sent if it is not correctly acknowledged.

Example Success Response

{
  "username" : "",
  "password" : "",
  "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.