API Reference
Behaviors
Behaviors
Behaviors are an abstraction of Over the Air (OTA) commands that allow for remote control and configuration of devices. With the Behaviors API, developers can easily send OTA commands to devices, changing their configuration, settings, reporting frequency, and other values.
The main advantage of using the Behaviors API is that it abstracts the complexities of the hardware specifics and exposes a safe and comprehensive way to control the behavior of devices remotely.
Using the Behaviors API simplifies the process of managing IoT devices without worrying about the low-level details of the hardware or the communication protocols involved. The Behaviors API allows you to create or delete behaviors and apply them to one or multiple devices at once.
Using Behaviors
For a behavior to be applied, it must be supported by the device type. Each device exposes the list of behaviors it supports.
The following example illustrates the definition of a behavior that modifies the reporting frequency of the device. All behaviors describe the parameters they support.
Example
{
"name": "REPORT_FREQ",
"description": "Change Reporting Frequency",
"parameters": [
{
"name": "frequency",
"type": "number",
"min": 5,
"max": 60
}
]
}
Using the previous behavior, the reporting frequency can be modified by sending the following data to the Send Behavior endpoint
Set the reporting frequency to 45 seconds
{
"name": "REPORT_FREQ",
"parameters": {
"frequency": 45
},
"highPriority": false
}
Endpoints
The Behaviors API has the following endpoints:
- Get Device Supported Behaviors Get the list of the behaviors supported by a device.
- Get Device Sent Behaviors Get the list of the behaviors sent to a device.
- Get Device Behavior Status Get the status of a behavior sent to a device.
- Send Device Behavior Send a behavior to a device.
- Send Bulk Behavior Send a behavior to multiple devices.
- Send Ping Send a high priority ping to the a device. This behavior tries to wakeup the device and force it to reports to the platform.
- Cancel Behavior Cancels a behavior by IMEI or by behavior task identifier.
On This Page