Helpful

CallbacksData callback

Bidir

This callback will be triggered when a message has been received from a device including a downlink payload request. More information about the downlink service: Downlink information

This service requires the Downlink mode set to “Callback” in device type settings. For more details refer to Downlink Callback article.

For examples of correct downlink payload JSON bodies, please see the JSON body examples section.

Variables

TypeFormat

Description

time

integerEpoch time in seconds

The event timestamp (in seconds since the Unix Epoch)

deviceTypeIdstringin hexadecimal, up to 24 charactersDevice Type identifier (in hexadecimal – up to 8 characters <=> 4 bytes)

device

stringin hexadecimal, up to 8 characters

Device identifier (in hexadecimal – up to 8 characters <=> 4 bytes)

rssi

floattwo maximum fraction digits

The RSSI (in dBm – Float value with two maximum fraction digits). If there is no data to be returned, then the value is null.

Condition: for devices with contract option NETWORK METADATA

station

stringin hexadecimal, 4 characters

The base station identifier (in hexadecimal – 4 characters <=> 2 bytes)

Condition: for devices with contract option NETWORK METADATA

data

stringhexadecimal

The user data (in hexadecimal)

seqNumber

integer

The sequence number of the message if available

longPollingbool
True if device support long poling mechanism for downlink (required compatible device)

ack

bool

True if this message needs to be acknowledged, false else.

JSON body examples

Sending a data payload

Sending a downlink payload requires complying with the following JSON structure:

{
"1234":{
"downlinkData": "1234567890123456"
}
}

With batch callbacks, multiple devices may need an answer. The response must contain the data for all devices.

{

   "1234":{

        "downlinkData":"1234567890123456"

    },

    "5678":{

        "downlinkData":"1234567890123456"

    }

}   

If the JSON body contains other data or data related to devices not asking for acknowledgment, it will be ignored.

Providing an answer without data

You can decide not to send any answer to the device. There are 2 ways to do so :

  • respond to the callback with the HTTP NO_CONTENT code (204)
  • respond with a JSON data containing the noData field:
{
"1234":{
      "noData":true
   }
}

Can't find what you're looking for ?

Have questions? Our worldwide Community of expert fans can answer them.
Have answers? Join the Community and help!

slack logo

Ask the community >