Appearance
Beta Daemon API
This page is dedicated to in development APIs that may be subject to change.
WebSocket authentication
As of version 2.7, clients are required to authenticate before using the Daemon JSON API via WebSocket. New client sessions are expected to authenticate within configurable time period, otherwise the connection is terminated by the server with policy error code (1008). The server expects authentication request to be the first message sent by client after establishing connection.
Clients can authenticate their session via special authentication API messages below.
Note that authentication is required when connecting directly to the WebSocket server, if you are using the IQRF Gateway Webapp user interface, the application handles session authentication for users upon singing in.
Authentication request
The authentication request message is a JSON request in the following format:
json
{
"type": "auth",
"token": "<YOUR_API_TOKEN>"
}Authentication response
In case of successful authentication, the server responds with a message confirming authentication, and includes expiration time of the session and whether the used API key has sufficient permissions for use of service mode API.
json
{
"type": "auth_success",
"expiration": "2026-06-29T12:20:02.188Z",
"service": false
}If on the other hand, the authentication fails, the server responds with an authentication failure message, informing the client of the authentication failure reason via a code and short message, and the connection is terminated with policy error code (1008).
json
{
"type": "auth_error",
"code": 4,
"error": "Invalid token"
}Authentication error codes
Below is a table of authentication error codes and their meaning.
| Code | Error string | Description |
|---|---|---|
| 1 | Unauthenticated | Client sent a non-authentication message after connecting. |
| 2 | Authentication timeout | Client failed to send authentication message in time. |
| 3 | Authentication failed | Authentication could not be performed. Currently only used if the server receives a mangled, non-JSON message. |
| 4 | Invalid token | The token used for authentication is not in a valid format, or the token record does not exist. |
| 5 | Expired token | The token used for authentication has already expired. |
| 6 | Revoked token | The token used for authentication has been revoked. |
IQRF Sensor Data
The sensor data service allows for periodic collecting of sensor measurement data and storing latest values in the database.
Get configuration iqrfSensorData_GetConfig
| Schema | Example |
|---|---|
Set configuration iqrfSensorData_SetConfig
| Schema | Example |
|---|---|
Start worker iqrfSensorData_Start
| Schema | Example |
|---|---|
Stop worker iqrfSensorData_Stop
| Schema | Example |
|---|---|
Invoke worker iqrfSensorData_Invoke
| Schema | Example |
|---|---|
Worker status iqrfSensorData_Status
| Schema | Example |
|---|---|
Asynchronous report iqrfSensorData_ReportAsyncAsync
| Schema | Example |
|---|---|
Daemon Management
With the introduction management and network request queues, the following messages are available to pause and resume execution of network requests if necessary. For example, if there are multiple network requests queued up, the network queue can be paused to allow for management tasks to be performed, without losing network messages.
Start network queue mngDaemon_StartNetworkQueue
Resumes network request queue.
| Schema | Example |
|---|---|
Stop network queue mngDaemon_StopNetworkQueue
Pauses network request queue, if a network request is currently being processed, the queue is paused once the network request is finished.
| Schema | Example |
|---|---|
Daemon Database
API for network enumeration and querying database for network device data. This API will replace the Daemon Information API in the future.
Device enumeration iqrfDb_Enumerate
| Schema | Example |
|---|---|
Get device information iqrfDb_GetDevice
| Schema | Example |
|---|---|
Get information about multiple devices iqrfDb_GetDevices
| Schema | Example |
|---|---|
Get user-defined device metadata iqrfDb_GetDeviceMetadata
| Schema | Example |
|---|---|
Set user-defined device metadata iqrfDb_SetDeviceMetadata
| Schema | Example |
|---|---|
Get binary outputs iqrfDb_GetBinaryOutputs
| Schema | Example |
|---|---|
Get lights iqrfDb_GetLights
| Schema | Example |
|---|---|
Get sensors iqrfDb_GetSensors
| Schema | Example |
|---|---|
Get network topology iqrfDb_GetNetworkTopology
| Schema | Example |
|---|---|
Annotate responses with metadata iqrfDb_MetadataAnnotation
| Schema | Example |
|---|---|
Reset database iqrfDb_Reset
| Schema | Example |
|---|---|