Skip to main content

BlueCold API

1 Introduction

1.1 Purpose of this document

This document describes the technical specifications of the APIs available as output from the BlueCold solution. They allow retrieval of all raw data related to the fleet of sensors and gateways managed by the user, as well as business information that may have been entered in BlueCold:

  • Device characteristics
  • Data generated by devices
  • Asset characteristics
  • Sensor / asset associations
  • Gateway characteristics

2 How the API works

2.1 General

All endpoints refer to a <base_url> parameter.

The URL used is: https://bluecold.elainnovation.com

2.2 Authentication

Obtaining an authentication token

POST <base_url>/api/auth/login

Payload:

{
"username": "user@example.com",
"password": "password"
}

Response:

{
"token": "<ACCESS_TOKEN>",
"refreshToken": "<REFRESH_TOKEN>"
}

Refreshing an existing token

If the user has already authenticated and holds an active token, the refreshToken field can be used to renew it:

POST <base_url>/api/auth/token

Payload:

{
"refreshToken": "<REFRESH_TOKEN>"
}

Response:

{
"token": "<ACCESS_TOKEN>",
"refreshToken": "<REFRESH_TOKEN>"
}

Default validity periods

TokenDuration
Access Token (JWT)2.5 hours (9,000 seconds)
Refresh Token1 week (604,800 seconds)

The token must then be included in the Authorization header of subsequent requests, with the value:

Bearer <ACCESS_TOKEN>

Note: If the user has neither reconnected nor refreshed their token for more than one week, they will be required to re-authenticate.

2.3 Storage format description

BlueCold stores data in four formats, all linked to an entity (i.e. a beacon or an asset):

FormatDescriptionExample
Entity InfoCore characteristic data of the entityName
AttributeSecondary data of the entityELA order number
TimeseriesTime-stamped historical data linked to a sensorTemperature
RelationsAssociations between sensors and assets

2.4 List of fields available via API

The table below summarises all fields available through the API, the format in which they are stored in BlueCold, and their field name. Users can query these fields by making a generic call on the entity infos, attributes, or timeseries of an entity, specifying the desired field name (last column).

FieldSensorAssetGatewayStored asField name in BlueCold
MAC address / identifierEntity infoname
bluecold_idEntity infoid
NameEntity infolabel
Sensor user groupAttributesensorGroupMember
Gateway user groupAttributegatewayGroupMember
Firmware versionAttributefirmwareVersion
StatusAttributeactive
ELA order numberAttributeorder
Date added to BlueColdAttributeadded
Battery levelTimeseriesbatteryLevel
Last calibration dateAttributelastCalibrationDate
Next calibration dateAttributenextCalibrationDate
Active calibration certificate URLAttributecalibrationReportUrl
Gateway typeAttributegatewayType
Last gateway connection dateAttributelastConnectTime
Last gateway disconnection dateAttributelastDisconnectTime
Last gateway activity dateAttributelastActivityTime
Asset association historyAttributeassetHistory
Sensor position list within the assetAttributeassetPositions
Sensor data: sensor timestamp (see section 2.4.1)TimeseriessensorValue
Sensor data: server timestamp (see section 2.4.1)TimeseriessensorValue_received
DataloggerTimeseriesdatalogger
Asset containing the sensorRelations
Sensors associated with the assetRelations

2.4.1 Sensor data timestamps

BlueCold provides two fields to retrieve sensor data:

  • sensorValue: sensor data timestamped at the moment the Bluetooth frame is scanned by the gateway. This allows reconstruction of a historical data timeline for the sensor.
{
"sensorValue": [
{
"ts": 1751292795758,
"value": "{\"type\":\"temperature_live\",\"value\":-5.12}"
}
]
}
  • sensorValue_received: sensor data timestamped at the moment it is saved in the BlueCold platform. This allows retrieval of historical data as it becomes available. The value additionally contains the measuredTs field, which provides the original sensor measurement timestamp.
{
"sensorValue_received": [
{
"ts": 1751292795758,
"value": "{\"type\":\"temperature\",\"value\":26.87,\"measuredTs\":1751292785750}"
}
]
}

2.5 Workflow example: initialising a third-party system

  1. Authentication → Retrieve the JWT token for subsequent requests
  2. List client devices
    • Read bluecold ids, names and labels
  3. List client assets
    • Read bluecold ids, names and labels
  4. For each device
    • Read the bluecold id, name and label
    • Read attributes
    • Retrieve telemetry
    • Resolve relation to the asset containing the device (if any)
  5. For each asset
    • Read the bluecold id, name and label
    • Read attributes

3 API Reference

3.1 Device list (sensors and gateways)

3.1.1 Description

Lists all client devices and provides their bluecold_id, used for queries on a specific device.

3.1.2 URL

GET <base_url>/api/user/devices?pageSize=<page_size>&page=<page_num>

3.1.3 Parameters

ParameterDescription
page_sizeNumber of devices per page. Example: 100
page_numRequested page number, starting at 0. Example: 0 (first page)

3.1.4 Response

{
"data": [
{
"id": {
"entityType": "DEVICE",
"id": "<bluecold_id>"
},
"createdTime": 1751289432568,
"tenantId": {
"entityType": "TENANT",
"id": "<tenant_id>"
},
"customerId": {
"entityType": "CUSTOMER",
"id": "<customer_id>"
},
"name": "<device_name>",
"type": "default",
"label": "",
"deviceProfileId": null,
"firmwareId": null,
"softwareId": null,
"externalId": null,
"version": null,
"ownerId": {
"entityType": "CUSTOMER",
"id": "<customer_id>"
},
"additionalInfo": {
"gateway": false,
"overwriteActivityTime": false,
"description": ""
},
"deviceData": null
}
],
"totalPages": 15,
"totalElements": 30,
"hasNext": true
}

3.2 Asset list

3.2.1 Description

Lists all client assets and provides their bluecold_id, used for queries on a specific asset.

3.2.2 URL

GET <base_url>/api/user/assets?pageSize=<page_size>&page=<page_num>

3.2.3 Parameters

ParameterDescription
page_sizeNumber of assets per page. Example: 100
page_numRequested page number, starting at 0. Example: 0 (first page)

3.2.4 Response

{
"data": [
{
"id": {
"entityType": "ASSET",
"id": "<bluecold_id>"
},
"createdTime": 1751293508556,
"tenantId": {
"entityType": "TENANT",
"id": "<tenant_id>"
},
"customerId": {
"entityType": "CUSTOMER",
"id": "<customer_id>"
},
"name": "<asset_name>",
"type": "default",
"label": null,
"assetProfileId": null,
"externalId": null,
"version": null,
"ownerId": {
"entityType": "CUSTOMER",
"id": "<customer_id>"
},
"additionalInfo": {
"description": ""
}
}
],
"totalPages": 1,
"totalElements": 1,
"hasNext": false
}

3.3 Historical data (timeseries)

3.3.1 Description

Provides access to the historical data of each device in BlueCold.

Note: There are no timeseries on the asset side.

3.3.2 URL

GET <base_url>/api/plugins/telemetry/DEVICE/<bluecold_id>/values/timeseries?keys=<telemetry_keys>&startTs=<start_ts>&endTs=<end_ts>

3.3.3 Parameters

ParameterDescription
bluecold_idUnique internal device identifier, specific to BlueCold. See section 3.1. Note: this id is neither the NAME nor the MAC ADDRESS.
telemetry_keysNames of the fields to retrieve, comma-separated. Example for a temperature sensor: sensorValue or sensorValue_received
start_tsStart boundary of the time range. Format: UNIX milliseconds
end_tsEnd boundary of the time range. Format: UNIX milliseconds
limit(Optional) Maximum number of time-series data points to retrieve. Maximum: 50,000.
orderBy(Optional) Sort order: ASC (ascending) or DESC (descending).

3.3.4 Response

{
"sensorValue_received": [
{
"ts": 1751292795758,
"value": "{\"type\":\"temperature\",\"value\":26.87,\"measuredTs\":1751292785750}"
}
]
}

3.4 Attributes

3.4.1 Description

Provides access to the secondary characteristics (attributes) of each device in BlueCold.

3.4.2 URL

To retrieve attributes for a device:

GET <base_url>/api/plugins/telemetry/DEVICE/<bluecold_id>/values/attributes?keys=<attribute_keys>

A gateway is treated as a device. For example, to retrieve the user groups of a gateway:

GET <base_url>/api/plugins/telemetry/DEVICE/<bluecold_id>/values/attributes?keys=gatewayGroupMember

To retrieve attributes for an asset:

GET <base_url>/api/plugins/telemetry/ASSET/<bluecold_id>/values/attributes?keys=<attribute_keys>

3.4.3 Parameters

ParameterDescription
bluecold_idUnique internal device identifier, specific to BlueCold. See section 3.1. Note: this id is neither the NAME nor the MAC ADDRESS.
attribute_keysNames of the fields to retrieve, comma-separated. Example: lastCalibrationDate,nextCalibrationDate

3.4.4 Response

[
{
"lastUpdateTs": 1750668601047,
"key": "lastCalibrationDate",
"value": "2025-05-12"
}
]

3.5 Relations

This API allows retrieval of the asset containing the current device (see workflow example).

3.5.1 URL

Query to retrieve the asset containing the current device:

GET <base_url>/api/relations?fromId=<bluecold_id_sensor>&fromType=DEVICE

Query to list the sensors contained within an asset:

GET <base_url>/api/relations?toId=<bluecold_id_asset>&toType=ASSET

3.5.2 Parameters

ParameterDescription
bluecold_id_sensorUnique internal identifier of the device whose associated asset is being looked up. Note: this id is neither the NAME nor the MAC ADDRESS.
bluecold_id_assetUnique internal identifier of the asset whose associated devices are being listed. Note: this id is neither the NAME nor the MAC ADDRESS.

3.5.3 Response

Response for fromType=DEVICE (asset containing the device):

[
{
"from": {
"entityType": "ASSET",
"id": "<bluecold_id_asset>"
},
"to": {
"entityType": "DEVICE",
"id": "<bluecold_id_sensor>"
},
"type": "Contains",
"typeGroup": "COMMON",
"version": 791355646,
"additionalInfo": {
"created": 123456789
}
}
]

Response for toType=ASSET (devices contained within the asset):

[
{
"from": {
"entityType": "ASSET",
"id": "<bluecold_id_asset>"
},
"to": {
"entityType": "DEVICE",
"id": "<bluecold_id_sensor>"
},
"type": "Contains",
"typeGroup": "COMMON",
"version": 791355646,
"additionalInfo": {
"created": 123456789
}
}
]