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:
- network-server: Allows to write device data. Required for LoRaWAN Network Server Integrations.
Add the Token into the HTTP request Header:
- Field:
Authorization
- Value:
Bearer eyJhbGciOiJIU...
Pagination
Pagination is required to query big amounts of data.
Query Parameter | Default | Maximum value | Description |
---|---|---|---|
limit | 100 | 10.000 | Maximum number of records to receive |
offset | 0 | Offset for the first record to receive |
To fetch all data from an endpoint:
- ?limit=100&offset=0
- ?limit=100&offset=100
- ...
- Increase offset by limit until number of returned rows is lower than limit
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.
<type>
is either "f" for fields, or "fa" for arrays (e.g. to search in tags)<field>
is the field to be queried and specified for each endpoint separately. Common fields are e.g. "id", "createdAt", "updatedAt"<value>
is the value to be queried. The Value must be URL encoded e.g. a timestamp might look likegt:2000-01-01T02:37:00%2B01:00
<op>
is the operator between the field and the value, see list of allowed operators below.
<op>
must be one of the following operators:
In Query | Meaning | Valid for <type> |
---|---|---|
eq | = | f |
lte | <= | f |
lt | < | f |
gte | >= | f |
gt | > | f |
like | SQL LIKE operator | f |
ilike | SQL ILIKE operator | f |
isnull | SQL is (not) null operator value: "true","t","1" (= is Null) or "false","f","0" (= is not Null) | f / fa |
contains | array field contains all of the values | fa |
containedby | array field is contained by by the list of values | fa |
overlap | array field and list of values overlap | fa |
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
- Set the gzip encoding header to reduce network traffic:
Accept-Encoding: gzip
- Use pagination with page sizes smaller than 10.000 entries
Example requests
Get data from a single devices by address or tag
Find relevant device(s):
- By Address (printed on the device and QR Code):
- By Tag:
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:
Description | Method | Header | URL | URL Path Params | URL Query Params | Request Payload | Return |
---|---|---|---|---|---|---|---|
Downlink creation | POST |
| /api/devices/{devId}/downlink |
|
| The Body contains the downlink content. See also: Downlinks |
|
Device creation | POST |
| /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 } |
|
User creation | POST |
| /api/organisation/user | - | - | userInput as JSON : |
|