Navigate to: Integrations -> REST

Swagger API documentation: https://platform.lobaro.com/api

Access Tokens

All API calls must be authenticated with an access token. Access tokens can be managed on the REST Integration page.

Each token has a list of roles assigned to it.

Token roles:

Add the Token into the HTTP request Header:

Pagination

Pagination is required to query big amounts of data.

Query ParameterDefaultMaximum valueDescription
limit10010.000Maximum number of records to receive
offset0
Offset for the first record to receive


To fetch all data from an endpoint:

Filter query parameters

Filters parameters can be appended to some requests in the form of <type>:<field>=<op>:<value> e.g. f:createdAt=gt:<timestamp> to filter by createdAt date.


<op> must be one of the following operators:

In QueryMeaningValid for <type>
eq=f
lte<=f
lt<f
gte>=f
gt>f
like
SQL LIKE operatorf
ilike
SQL ILIKE operatorf
isnullSQL is (not) null operator value: "true","t","1" (= is Null) or "false","f","0" (= is not Null)f / fa
containsarray field contains all of the valuesfa
containedbyarray field is contained by by the list of valuesfa
overlaparray field and list of values overlapfa

If no operator is given the default eq operator will be used for fields and contains for arrays.


Examples

"data" is a database field of type JSON, you can even query into the JSON structure. 

Please note that these fields are not indexed. For performance reasons always limit the result set e.g. by setting a date range.

# Query JSON field "data.mbus.Id" for a number
&f:data.mbus.Id=eq:130567728

# Query JSON field "data.mbus.IdString" for a string
&f:data.mbus.IdString=eq:"10130567728"


To filter a date range, the same filter can be applied multiple times with different operators

&f:createdAt=gt:2000-01-01T02:37:00%2B01:00?f:createdAt=lt:2000-01-02T02:37:00%2B01:00


Usage recommendations

Example requests

Get data from a single devices by address or tag

Find relevant device(s):

The result contains an "data.id" field that is used to query the data, just replace {deviceId} with the ID from the first query and adjust the date and limit parameters as needed:


Additional Endpoints:

DescriptionMethodHeaderURLURL Path ParamsURL Query ParamsRequest PayloadReturn
Downlink creationPOST
  • Authorization with org-admin or device-admin token (see Access Tokens)
/api/devices/{devId}/downlink
  • devId: Database ID of the device

The Body contains the downlink content.

See also: Downlinks

  • 200 ok
    • Body: Empty
  • error status code
    • Body: information about the error
Device creationPOST
  • Authorization with org-admin or device-admin token (see Access Tokens)
/api/devices--

deviceInput as JSON

{

"name": "Gateway_1",

"addr": "FFFFFFFFFFFFFFFF",

"description": "3.OG Wohnung Müller", 

"deviceTypeId": 2,

"initialConfig": null,

"location": null,

"serial": "1337",

"tags": ["Müller", "MbusGw", "3.OG"],

"certEnforcesDtls": false

}

  • 200 ok
    • Body: Device as JSON
  • error status code
    • Body: information about the error
User creationPOST
  • Authorization with org-admin token (see Access Tokens)
/api/organisation/user--

userInput as JSON :
{
"name": "Eample Test",
"email": "e.test@test.com",
"password": "s0meSecur3Pw",
"roles": ["org-admin","device-admin"]
}

  • 200 ok
    • Body: User Json
    • {"data":{"id":17,"createdAt":"2022-07-04T10:59:41.975812+02:00","updatedAt":"2022-07-04T10:59:41.975812+02:00","login":"e.test@test.com","name":"Eample Test","email":"e.test@test.com","organisationId":1,"roles":["device-admin"]}}
  • error status code
    • Body: information about the error