Skip to content

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.

CodeError stringDescription
1UnauthenticatedClient sent a non-authentication message after connecting.
2Authentication timeoutClient failed to send authentication message in time.
3Authentication failedAuthentication could not be performed. Currently only used if the server receives a mangled, non-JSON message.
4Invalid tokenThe token used for authentication is not in a valid format, or the token record does not exist.
5Expired tokenThe token used for authentication has already expired.
6Revoked tokenThe 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

SchemaExample

Set configuration iqrfSensorData_SetConfig

SchemaExample

Start worker iqrfSensorData_Start

SchemaExample

Stop worker iqrfSensorData_Stop

SchemaExample

Invoke worker iqrfSensorData_Invoke

SchemaExample

Worker status iqrfSensorData_Status

SchemaExample

Asynchronous report iqrfSensorData_ReportAsyncAsync

SchemaExample

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.

SchemaExample

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.

SchemaExample

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

SchemaExample

Get device information iqrfDb_GetDevice

SchemaExample

Get information about multiple devices iqrfDb_GetDevices

SchemaExample

Get user-defined device metadata iqrfDb_GetDeviceMetadata

SchemaExample

Set user-defined device metadata iqrfDb_SetDeviceMetadata

SchemaExample

Get binary outputs iqrfDb_GetBinaryOutputs

SchemaExample

Get lights iqrfDb_GetLights

SchemaExample

Get sensors iqrfDb_GetSensors

SchemaExample

Get network topology iqrfDb_GetNetworkTopology

SchemaExample

Annotate responses with metadata iqrfDb_MetadataAnnotation

SchemaExample

Reset database iqrfDb_Reset

SchemaExample