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 |
|---|---|---|
Measurements | Periodic sensor measurement events |
|
GeoLocations | Periodic device geolocation updates |
|
Device Occurrences | Device status/occurrence events |
|
Message envelope
Each message is wrapped in an envelope.
Field | Type | Description |
|---|---|---|
| string (const | Envelope message version |
| string | type of Data model used |
| string | JSON of the data |
Data Models
MeasurementMessage
Field | Type | Description |
|---|---|---|
| string (const | API message version |
| integer | Measurement curve identifier |
| UUID | Run identifier |
| string | Device serial number |
| number | Measured value |
| string | Type of sensor, possible values:
|
| date-time | UTC timestamp |
| integer | Numeric status code |
GeoLocationMessage
Field | Type | Description |
|---|---|---|
| string (const | API message version |
| integer | Geolocation curve identifier |
| UUID | Correlation identifier |
| string | Device serial number |
| number | Latitude (8-digit precision) |
| number | Longitude (8-digit precision) |
| number | Accuracy in meters |
| date-time | UTC timestamp |
DeviceOccurrenceMessage
Field | Type | Description |
|---|---|---|
| string (const | API message version |
| integer | Unique occurrence identifier |
| UUID | Correlation identifier |
| string | Device serial number |
| string | Occurrence details |
| 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"
}
}