...
The Endpoint REST API URL https://apibridge.elpro.cloud
The API token is provided by ELPRO
For Developers the OpenAPI technical specification as Swagger UI https://apibridge.elpro.cloud/swagger
3.1 Data sets and general request scheme
...
Provide your API authorization code in the Request Header as Key and Value:
EAPI-ELCLV2 | 123a45b67_SAMPLE_f12345ab6c789d0 |
In case of lack or mismatch, an Error message with HTTP Status 401 “Unauthorized” will be returned.
...
Retrieved data is in the scope of the organization of the authenticated API User. It will be returned with HTTP-Statuscode 200 (Success).
3.1.3 Http Error Codes
400 Bad Request | e.g. missing mandatory parameter |
401 Unauthorized | Invalid or missing API Key |
404 Resource not found | Invalid serial number or id |
406 Not Acceptable | Accept Header should be only application/json |
410 License exhausted | Number of queries or datatransfer used up |
500 Server Error | Unexpected internal exception |
503 Service Temporarily Unavailable | Service down due to maintenance or update |
3.2 Configuration API
The REST interface provides a very basic endpoint for configuring LIBERO Gx devices.
Create and upload configuration template
Use the wizard to create a configuration template for a LIBERO Gx
Select the correct type of LIBERO Gx (first three numbers of the serial number are of importance)
Fill in the wizard forms until the summary page is reached
Alt+Click on the “Buy and Start Sensor” button
A file download fill appear
Save the file with a fitting name
Use the
POST /api/v1/Templates
endpoint to upload the contents of the saved configuration JSON fileImportant: The configuration has to be json-escaped. Do this programatically or use an online tool
The request object is described in the swagger ui
Optional: Use the
GET /api/v1/Templates
endpoint to list all available templates
Configure the templates
Use the
PUT /api/v1/Device/{deviceSerialNumber}
endpoint to configure the devicesOne call per device. Use a script to automate this process
Three possible payloads, as denoted by
$type
Check the swagger ui for more information on the specific objects
DeviceConfigurationRequestByTemplateId
andDeviceConfigurationRequestByTemplateName
can be used to configure a deviceOptional: provide metadata, see swagger ui for more information on placeholders
DeviceConfigurationRequestClearPending
can be used to clear a pending configuration for devices that have not been paired to the organization yet
3.3 Version of the REST-
...
AP/
For the REST-API a versioning mechanism is implemented.
...
The Queue Messages will have following basic payload as JSON:
Fieldname | Type | Description |
type | String | Possible Message types:
|
data | JSON object | Inner JSON representation of an info message, see info data models later in this document |
4.2 Message Type
Each Type represents a dedicated json payload inside the Data JSON object. So a consumer knows which Data Model is used.
...
The Data payloads are different for each type.
4.3.1 Measurement
Fieldname | Type | Description |
sensorId | Int64 | Id for the sensor data representing a data sink. |
deviceId | String | Identifier of the device |
value | Decimal | Numeric value of the measure
|
timeStamp | DateTimeOffset | DateTime of measure as timezone utc |
unit | String | Unit Token Possible Values: K,°C,°F, % |
unitType | String | Type of unit as text:
|
4.3.1.1 Example Measurements
...
Code Block | ||
---|---|---|
| ||
{ "type": "eapi_measurement_new", "data": { "timeStamp": "2022-10-11T16:21:27+00:00", "value": 24.6, "unit": "°C", "unitType": “temperature", "deviceId": "951FF00000340", "sensorId": "5368" } } |
4.3.2 GeoData
Fieldname | Type | Description |
sensorId | Int64 | Id for the sensor data representing a data sink. |
deviceId | String | Identifier of the device |
latitude | Double | Latitude with 8 digits precision |
longitude | Double | Longitude with 8 digits precision |
timestamp | DateTimeOffset | datetime in timezone utc |
accuracy | Decimal | Accuracy in meters |
4.3.2.1 Example GeoData
Data with type: “eapi_geodata_new”
Code Block |
---|
{ "type": "eapi_geodata_new", "data": { "timeStamp": "2022-10-11T15:21:24+00:00", "latitude": 47.19999075, "longitude": 9.50875282, "accuracy": 2316, "deviceId": "951FF00000340", "sensorId": "5369" } } |
4.3.3 Occurrence
Fieldname | Type | Description |
sensorId | Int64 | Id for the sensor data representing a data sink. |
deviceId | String | Identifier of the device |
timeStamp | DateTime | DateTime of occurrence as timezone utc |
typeName | String | "LoggerStatusChange” |
previousState | String | Possible values: "Undefined", "Init", "Shelflife", "Pairing", "Start", "LogDelayed", "LogTransit", LogPaused", "LogArrived", "StopStopped", "StopSleep", "Calibration", "EmergencyReadOut", "FatalError", "ProductionCalibration" |
newState | String |
4.3.3.1 Example Occurence
...
Code Block | ||
---|---|---|
| ||
{ "type": "eapi_occurrence_new", "data": { "timeStamp": "2022-10-11T15:21:24+00:00", "typeName": "LoggerStatusChange", "previousState": "Start", "newState": "LogDelayed", "deviceId": "951FF00000340", "sensorId": "5369" } } |
4.3.4 Deviation
Fieldname | Type | Description |
sensorId | Int64 | Id for the sensor data representing a data sink. |
deviceId | String | Identifier of the device |
timestamp | DateTimeOffset | DateTime of deviation as timezone utc |
historyType | String | Type of Deviation describring begin or end of deviation. Possible values: “enter” |
deviationType | String | Deviation type, possible values: "battery", |
reason | String | Deviation explanation code |
limitzone | String (opt.) | Limit Zone code for a limit deviation Possible values: L1,L2,L3, H1,H2,H3… |
4.3.4.1 Example Deviation Enter
...