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 | Type | Format | Description |
---|---|---|---|
time | integer | Epoch time in seconds | The event timestamp (in seconds since the Unix Epoch) |
deviceTypeId | string | in hexadecimal, up to 24 characters | Device Type identifier (in hexadecimal – up to 8 characters <=> 4 bytes) |
device | string | in hexadecimal, up to 8 characters | Device identifier (in hexadecimal – up to 8 characters <=> 4 bytes) |
rssi | float | two 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 | string | in hexadecimal, 4 characters | The base station identifier (in hexadecimal – 4 characters <=> 2 bytes) Condition: for devices with contract option NETWORK METADATA |
data | string | hexadecimal | The user data (in hexadecimal) |
seqNumber | integer | The sequence number of the message if available | |
longPolling | bool | 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:
{ |
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:
{ |