liberoMANAGER Data Exchange

liberoMANAGER Data Exchange

liberoMANAGER Pub/Sub API

API Version: 1.0.0
Last Updated: 2025-04-24

Summary

All messages flow over a single Topic exchange named liberomanager.exchange.
Subscribers bind to routing keys of the form org.{organizationId}.{messageType} using your tenant’s credentials over TLS.

The TTL of the messages is 3 days

Routing

Messages are routed via RabbitMQ topic bindings:

  • Exchange: liberomanager.exchange (type: topic, durable)

  • Routing Key Pattern: org.{organizationId}.{messageType}

Channels

Channel

Description

Routing Key Pattern

Channel

Description

Routing Key Pattern

Measurements

Periodic sensor measurement events

org.{organizationId}.measurements

GeoLocations

Periodic device geolocation updates

org.{organizationId}.geoLocations

Device Occurrences

Device status/occurrence events

org.{organizationId}.deviceOccurrences

Message envelope

Each message is wrapped in an envelope.

Field

Type

Description

Field

Type

Description

MessageVersion

string (const "1.0.0")

Envelope message version

$type

string

type of Data model used

Data

string

JSON of the data

Data Models

MeasurementMessage

Field

Type

Description

Field

Type

Description

MessageVersion

string (const "1.0.0")

API message version

CurveId

integer

Measurement curve identifier

RunId

UUID

Run identifier

SerialNumber

string

Device serial number

Value

number

Measured value

SensorType

string

Type of sensor, possible values:

  • Temperature

  • Temperature2

  • RelativeHumidity

Timestamp

date-time

UTC timestamp

Status

integer

Numeric status code

GeoLocationMessage

Field

Type

Description

Field

Type

Description

MessageVersion

string (const "1.0.0")

API message version

CurveId

integer

Geolocation curve identifier

RunId

UUID

Correlation identifier

SerialNumber

string

Device serial number

Latitude

number

Latitude (8-digit precision)

Longitude

number

Longitude (8-digit precision)

Accuracy

number

Accuracy in meters

Timestamp

date-time

UTC timestamp

DeviceOccurrenceMessage

Field

Type

Description

Field

Type

Description

MessageVersion

string (const "1.0.0")

API message version

OccurrenceId

integer

Unique occurrence identifier

RunId

UUID

Correlation identifier

SerialNumber

string

Device serial number

Content

string

Occurrence details

Timestamp

date-time

UTC timestamp

3. Consume AMQP Messages

3.1 Example Client Code with RabbitMQ in C#

using RabbitMQ.Client; using RabbitMQ.Client.Events; using System; using System.Text; // 1) Configuration const string exchangeName = "liberomanager.exchange"; const string queuePrefix = "org"; string organizationId = "org123"; // your org ID string messageType = "measurements"; // or "geoLocations", "deviceOccurrences" string queueName = $"{queuePrefix}-{organizationId}-{messageType}"; string routingKey = $"{queuePrefix}.{organizationId}.{messageType}"; var factory = new ConnectionFactory { HostName = "your-rabbit-host", Port = 5671, UserName = "your-username", Password = "your-password", Ssl = new SslOption { Enabled = true, ServerName = "your-rabbit-host" }, AutomaticRecoveryEnabled = true }; using var connection = factory.CreateConnection(); using var channel = connection.CreateModel(); // 2) Declare exchange, queue, then bind them channel.ExchangeDeclare( exchange: exchangeName, type: "topic", durable: true, autoDelete: false); channel.QueueDeclare( queue: queueName, durable: true, exclusive: false, autoDelete: false, arguments: new System.Collections.Generic.Dictionary<string, object> { { "x-message-ttl", 259_200_000 } // 3 days in ms }); channel.QueueBind( queue: queueName, exchange: exchangeName, routingKey: routingKey); Console.WriteLine($"[*] Waiting for messages on queue '{queueName}' (bound to '{routingKey}')…"); // 3) Consumer var consumer = new EventingBasicConsumer(channel); consumer.Received += (model, ea) => { var json = Encoding.UTF8.GetString(ea.Body.ToArray()); Console.WriteLine($"Received [{ea.RoutingKey}]: {json}"); }; channel.BasicConsume( queue: queueName, autoAck: true, consumer: consumer); // Keep alive Console.WriteLine("Press [enter] to exit."); Console.ReadLine();

3.2 Example Messages

MeasurementMessage

Routing key: org.org123.measurements

{ "$type": "MeasurementMessage", "MessageVersion": "1.0.0", "Data": { "MessageVersion": "1.0.0", "CurveId": 42, "RunId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "SerialNumber": "ABC123XYZ", "Value": 24.6, "SensorType": "Temperature", "Timestamp": "2025-04-24T12:34:56Z", "Status": 0 } }

GeoLocationMessage

Routing key: org.org123.geoLocations

{ "$type": "GeoLocationMessage", "MessageVersion": "1.0.0", "Data": { "MessageVersion": "1.0.0", "CurveId": 99, "RunId": "d2719a18-8eac-4f47-9f64-0473f33bc4aa", "SerialNumber": "ABC123XYZ", "Latitude": 47.497912, "Longitude": 19.040235, "Accuracy": 5.2, "Timestamp": "2025-04-24T12:35:00Z" } }

DeviceOccurrenceMessage

Routing key: org.org123.deviceOccurrences

{ "$type": "DeviceOccurrenceMessage", "MessageVersion": "1.0.0", "Data": { "MessageVersion": "1.0.0", "OccurrenceId": 7, "RunId": "0a7b9c2e-9f2b-4d4a-839e-123456abcdef", "SerialNumber": "ABC123XYZ", "Content": "Battery low warning", "Timestamp": "2025-04-24T12:35:05Z" } }