About Callback Services

About Software Management Services API Callback Notifications

Overview

The ThingSpace Software Management Services API can use a callback service (webhook) to send messages to your application when new firmware versions are available and when upgrades start and finish.

Subscribing to Callback Services

To receive callback messages, you will need to create and deploy a web service that can validate and process REST messages that conform to the callback JSON schema. You then need to register the URL of your web service so that ThingSpace knows where to send the callback messages.

NOTE: You will have to provide a way through your firewalls for the callback messages, such as by whitelisting the IP address used by the Verizon ThingSpace servers. That address is 68.128.212.217.

NOTE: To test your callback listening services in a non-production environment, you must have an external URL for the server that is hosting the web services. ThingSpace cannot send callback messages to a system that does not have a URL.

Callback Security

When you register to receive callback messages, you can specify a username and/or password that you want ThingSpace to include in each message. ThingSpace will not interact with any sort of authentication system. It will include the username and password as plain text in the callback message, like this:

  "password": "string",
  "username": "string"

To increase security when receiving callback messages from ThingSpace, you can implement these protocols:

  • Enable white-listing on your firewall or front-end server and add the ThingSpace IP address (68.128.212.217) to the white list. This will allow your servers to reject requests from other IP addresses.
  • Install a one-way certificate and enable HTTPS. You must use a certificate from a third-party certificate service; a self-signed certificate will not work. ThingSpace will check the validity of the certificate at the start of every session.

Callback JSON Schema

All callback messages conform to this structure. Note that elements will be empty if not applicable to the current callback type. For example, the firmwareList element will be an empty array in an upgradeProgress callback message.

{
  "accountName": "string",
  "participantName": "string",
  "type": "string",
  "username": "string",
  "password": "string",
  "firmwareList": [
    {
      "firmwareName": "string",
      "participantName": "string",
      "launchDate": "string",
      "releaseNote": "string",
      "model": "string",
      "make": "string",
      "fromVersion": "string",
      "toVersion": "string"
    }
  ],
  "upgradeScheduled": {
    "firmwareName": "string",
    "upgradeId": "string",
    "startDate": "string",
    "status": "string"
},
  "upgradeProgress": {
    "firmwareName": "string",
    "upgradeId": "string",
    "resultCode": "string",
    "resultReason": "string",
    "finishTime": "string"
},
  "upgradeFinished": {
    "firmwareName": "string",
    "upgradeId": "string",
    "deviceList": [
      {
      "imei": "string",
      "status": "string"
      }
    ]
  }
}

Calback Parameter Definitions

Property Name Data Type Description
accountName string The account name in the format ##########-#####
devicelist array The IMEIs and statuses of the devices that were included in the upgrade. Status is either “succeed” or “fail”
finishTime string The intended firmware upgrade finish time
firmwareList array List of newly available firmware if type=newFirmware, otherwise an empty array
firmwareName string The name of the firmware image that will be used for the upgrade.
fromVersion string The firmware version that must currently be on the device to upgrade.
launchDate string The release date of the firmware image.
make string The device make that the firmware applies to.
model string The device model that the firmware applies to.
password string The password provided when the callback URL was registered
releaseNote string Short description of the release
resultCode “Succeeded” if the firmware upgrade request was successfully initiated.
resultReason Additional notes about the resultCode.
startDate string Intended start date for a scheduled upgrade.
status string The status of a scheduled upgrade.
toVersion string The firmware version that will be on the device after an upgrade.
type string Callback type: newFirmware, upgradeScheduled, upgradeProgress, or upgradeFinished
upgradeFinished object Contains the final report of a completed upgrade, include the list of devices that were included.
upgradeId UUID string The UUID of the scheduled upgrade, returned by POST /upgrades when the upgrade was scheduled.
upgradeProgress object Contains information about an upgrade that has started if type=upgradeProgress, otherwise empty.
username string The username provided when the callback URL was registered

Example Callback

New Firmware callback

{
  "accountName":"1223334444-12345",
  "type":"newFirmware",
  "username":"",
  "password":"",
  "firmwareList": [
    {
      "firmwareName":"FOTA_Verizon_Model-A_01To02_HF",
      "launchDate":"2017-11-08 20:15:42.738 +0000 UTC",
      "releaseNote":"",
      "model":"Model-A",
      "make": "Verizon",
      "fromVersion":"VerizonFirmwareVersion-01",
      "toVersion":"VerizonFirmwareVersion-02"
    },
    { 
      "firmwareName":"FOTA_Verizon_Model-B_03To04_HF",
      "launchDate":"2017-10-11 05:25:12.738 +0000 UTC",
      "releaseNote":"",
      "model":"Model-B",
      "make": "Verizon",
      "fromVersion":"VerizonFirmwareVersion-03",
      "toVersion":"VerizonFirmwareVersion-04"
    } 
  ],
  "upgradeScheduled": {},
  "upgradeProgress": {},
  "upgradeFinished": {}
}

Upgrade Scheduled callback

{
  "accountName":"1223334444-12345",
  "type":"upgradeScheduled",
  "username":"",
  "password":"",
  "firmwareList": [],
  "upgradeScheduled": {
    "upgradeId":"f9ce4356-0812-4ae3-86ff-e34e46d11fae",
    "firmwareName":"FOTA_Verizon_Model-A_01To02_HF",
    "startDate":"2018-07-04 00:00:00 +0000 UTC",
    "status":"Scheduled"
  },
  "upgradeProgress": {},
  "upgradeFinished": {}
}

Upgrade Started callback

{
  "accountName":"1223334444-12345",
  "type":"upgradeProgress",
  "username":"",
  "password":"",
  "firmwareList": [],
  "upgradeScheduled": {},
  "upgradeProgress": {
    "firmwareName":"FOTA_Verizon_Model-A_01To02_HF",
    "upgradeId":"f9ce4356-0812-4ae3-86ff-e34e46d11fae",
    "resultCode":"Succeeded",
    "resultReason":"Successfully requested to upgrade server system.",
    "startTime":"2018-04-02 00:49:19 +0000 UTC"
  },
  "upgradeFinished": {}
}

Upgrade Finished callback

{
  "accountName":"1223334444-12345",
  "type":"upgradeFinished",
  "username":"",
  "password":"",
  "firmwareList": [],
  "upgradeScheduled": {},
  "upgradeProgress": {},
  "upgradeFinished": {
    "firmwareName":"FOTA_Verizon_Model-A_01To02_HF",
    "upgradeId":"f9ce4356-0812-4ae3-86ff-e34e46d11fae"
  }
}