Download OpenAPI specification:Download
SensorBucket processes data from different sources and devices into a single standardized format. An applications connected to SensorBucket, can use all devices SensorBucket supports.
Missing a device or source? SensorBucket is designed to be scalable and extendable. Create your own worker that receives data from an AMQP source, process said data and output in the expected worker output format.
Find out more at: https://developer.sensorbucket.nl/
Developed and designed by Provincie Zeeland and Pollex'
Fetch a list of devices.
Devices can be filtered on three items: properties, distance from a location or a bounding box.
The filters distance from location and bounding box are mutually exclusive. The location distance filter will take precedence.
properties | string Example: properties={ "eui": "1122334455667788" } Used to filter devices by its properties. This filters devices on whether their property contains the provided value. The value must be a JSON string and depending on your client should be URL Escaped |
north | number <double> Example: north=3.6175560329103202 Used to filter devices within a bounding box |
west | number <double> Example: west=51.518796779610035 Used to filter devices within a bounding box |
east | number <double> Example: east=51.47912508218688 Used to filter devices within a bounding box |
south | number <double> Example: south=3.655955445579366 Used to filter devices within a bounding box |
latitude | number <double> Example: latitude=51.496227862014685 Used to filter devices within a distance from a point |
longitude | number <double> Example: longitude=3.615071953647924 Used to filter devices within a distance from a point |
distance | integer Example: distance=1000 Used to filter devices within a distance from a point. The distance is given in meters. |
cursor | string The cursor for the current page |
limit | integer The maximum amount of items per page. Not applicable if |
id | Array of integers <int64> Filter by Device IDs |
sensor_group | Array of integers <int64> Filter by device group |
{- "links": {
- "previous": "string",
- "next": "string"
}, - "page_size": 0,
- "total_count": 0,
- "data": [
- {
- "id": 1,
- "code": "mfm1000",
- "state": 0,
- "description": "Grasfield pipe 24",
- "organisation": "provincie_zeeland",
- "properties": {
- "eui": "060708090A0B0C0D"
}, - "altitude": 1.2345,
- "latitude": 1.2345,
- "longitude": 1.2345,
- "location_description": "Description of location",
- "sensors": [
- {
- "id": 1,
- "device_id": 1,
- "code": "S123",
- "description": "Pressure sensor at 5 meters depth",
- "external_id": "5",
- "brand": "SensorCompany LTD. SCL115",
- "archive_time": 7,
- "properties": {
- "mount_height": "15cm"
}, - "created_at": "2023-05-17T15:00:00.000Z"
}
], - "created_at": "2019-08-24T14:15:22Z"
}
]
}
Create a new device.
Depending on the type of device and the network it is registered on. The device might need specific properties to be set.
For example: A LoRaWAN device often requires a dev_eui
property to be set. The system will match incoming traffic against that property.
code required | string |
description | string |
latitude | number <double> |
longitude | number <double> |
location_description | string |
properties | object |
{- "code": "mfm1000",
- "description": "Grasfield pipe 24",
- "latitude": 1.2345,
- "longitude": 1.2345,
- "location_description": "Description of location",
- "properties": {
- "eui": "060708090A0B0C0D"
}
}
{- "message": "created device",
- "data": {
- "id": 1,
- "code": "mfm1000",
- "state": 0,
- "description": "Grasfield pipe 24",
- "organisation": "provincie_zeeland",
- "properties": {
- "eui": "060708090A0B0C0D"
}, - "altitude": 1.2345,
- "latitude": 1.2345,
- "longitude": 1.2345,
- "location_description": "Description of location",
- "sensors": [
- {
- "id": 1,
- "device_id": 1,
- "code": "S123",
- "description": "Pressure sensor at 5 meters depth",
- "external_id": "5",
- "brand": "SensorCompany LTD. SCL115",
- "archive_time": 7,
- "properties": {
- "mount_height": "15cm"
}, - "created_at": "2023-05-17T15:00:00.000Z"
}
], - "created_at": "2019-08-24T14:15:22Z"
}
}
Get the device with the given identifier.
The returned device will also include the full model of the sensors attached to that device.
id required | integer <int64> The numeric ID of the device |
{- "message": "Fetched device",
- "data": {
- "id": 1,
- "code": "mfm1000",
- "state": 0,
- "description": "Grasfield pipe 24",
- "organisation": "provincie_zeeland",
- "properties": {
- "eui": "060708090A0B0C0D"
}, - "altitude": 1.2345,
- "latitude": 1.2345,
- "longitude": 1.2345,
- "location_description": "Description of location",
- "sensors": [
- {
- "id": 1,
- "device_id": 1,
- "code": "S123",
- "description": "Pressure sensor at 5 meters depth",
- "external_id": "5",
- "brand": "SensorCompany LTD. SCL115",
- "archive_time": 7,
- "properties": {
- "mount_height": "15cm"
}, - "created_at": "2023-05-17T15:00:00.000Z"
}
], - "created_at": "2019-08-24T14:15:22Z"
}
}
Update a some properties of the device with the given identifier.
The request body should contain one or more modifiable properties of the Device.
id required | integer <int64> The numeric ID of the device |
description | integer |
latitude | number <double> |
longitude | number <double> |
location_description | string |
properties | object |
{- "description": 1,
- "latitude": 1.2345,
- "longitude": 1.2345,
- "location_description": "Description of location",
- "properties": {
- "eui": "060708090A0B0C0D"
}
}
{- "message": "Updated device properties"
}
List all sensors related to the device with the provided identifier
device_id required | integer The identifier of the device |
cursor | string The cursor for the current page |
limit | integer The maximum amount of items per page. Not applicable if |
{- "links": {
- "previous": "string",
- "next": "string"
}, - "page_size": 0,
- "total_count": 0,
- "data": [
- {
- "id": 1,
- "device_id": 1,
- "code": "S123",
- "description": "Pressure sensor at 5 meters depth",
- "external_id": "5",
- "brand": "SensorCompany LTD. SCL115",
- "archive_time": 7,
- "properties": {
- "mount_height": "15cm"
}, - "created_at": "2023-05-17T15:00:00.000Z"
}
]
}
Create a new sensor for the device with the given identifier.
A device can not have sensors with either a duplicate code
or duplicate external_id
field.
As this would result in conflicts while matching incoming messages to devices and sensors.
device_id required | integer The identifier of the device |
code required | string |
description | string |
external_id required | string |
brand | string |
properties | object |
archive_time | integer |
{- "code": "S123",
- "description": "Pressure sensor at 5 meters depth",
- "external_id": "5",
- "brand": "sensor brand ABC",
- "properties": {
- "mount_height": "15cm"
}, - "archive_time": 7
}
{- "message": "Created new sensor for device"
}
Delete a sensor from the system.
Since a sensor can only be related to one and only one device at a time, the sensor will be deleted from the system completely
device_id required | integer The identifier of the device |
sensor_code required | string The code of the sensor |
{- "message": "Deleted sensor from device"
}
List all sensors.
cursor | string The cursor for the current page |
limit | integer The maximum amount of items per page. Not applicable if |
{- "links": {
- "previous": "string",
- "next": "string"
}, - "page_size": 0,
- "total_count": 0,
- "data": [
- {
- "id": 1,
- "device_id": 1,
- "code": "S123",
- "description": "Pressure sensor at 5 meters depth",
- "external_id": "5",
- "brand": "SensorCompany LTD. SCL115",
- "archive_time": 7,
- "properties": {
- "mount_height": "15cm"
}, - "created_at": "2023-05-17T15:00:00.000Z"
}
]
}
Fetch a list of sensor groups.
cursor | string The cursor for the current page |
limit | integer The maximum amount of items per page. Not applicable if |
{- "links": {
- "previous": "string",
- "next": "string"
}, - "page_size": 0,
- "total_count": 0,
- "data": [
- {
- "id": 0,
- "name": "string",
- "description": "string",
- "sensors": [
- 0
]
}
]
}
Create a new sensor group.
name | string |
description | string |
{- "name": "string",
- "description": "string"
}
{- "message": "created sensor group",
- "data": {
- "id": 0,
- "name": "string",
- "description": "string",
- "sensors": [
- 0
]
}
}
Get the sensor group with the given identifier.
id required | integer <int64> The numeric ID of the sensor group |
{- "message": "Fetched sensor group",
- "data": {
- "id": 0,
- "name": "string",
- "description": "string",
- "sensors": [
- 0
]
}
}
Update a some properties of the sensor group with the given identifier.
The request body should contain one or more modifiable properties of the sensor group.
id required | integer The numeric ID of the sensor group |
name | string |
description | string |
{- "name": "string",
- "description": "string"
}
{- "message": "Updated Sensor Group properties"
}
Add a sensor by its ID to a sensor group by its ID
id required | integer The identifier of the Sensor Group |
sensor_id | integer id of the sensor to add |
{- "sensor_id": 5
}
{- "message": "Added sensor to sensor group"
}
Delete a sensor from a sensor group
id required | integer The identifier of the sensor group |
sensor_id required | integer The id of the sensor |
{- "message": "Deleted sensor from sensor group"
}
List pipelines. By default only state=active
pipelines are returned.
By providing the query parameter inactive
only the inactive pipelines will be returned.
Pipelines can be filtered by providing one or more step
s. This query parameter can be repeated to include more steps.
When multiple steps are given, pipelines containing one of the given steps will be returned.
inactive | boolean Only show inactive pipelines |
step | Array of strings Example: step=thethingsnetwork&step=multiflexmeter Only show pipelines that include at least one of these steps |
cursor | string The cursor for the current page |
limit | integer The maximum amount of items per page. Not applicable if |
{- "links": {
- "previous": "string",
- "next": "string"
}, - "page_size": 0,
- "total_count": 0,
- "data": [
- {
- "id": "9d4a0944-c11d-42ef-880f-a97c9619c5c0",
- "description": "Pipeline for Multiflexmeter Groundwater devices",
- "steps": [
- "TTN@1.0.0",
- "MFMGroundwater@1.0.0"
], - "status": "active",
- "last_status_change": "2022-01-01T00:00:00.000Z",
- "created_at": "2022-01-01T00:00:00.000Z"
}
]
}
Create a new pipeline.
A pipeline determines which workers, in which order the incoming data will be processed by.
A pipeline step is used as routing key in the Message Queue. This might be changed in future releases.
Note: currently there are no validations in place on whether a worker for the provided step actually exists.
description | string |
steps | Array of strings |
{- "description": "Pipeline for Multiflexmeter Groundwater devices",
- "steps": [
- "TTN@1.0.0",
- "MFMGroundwater@1.0.0"
]
}
{- "message": "Created pipeline",
- "data": {
- "id": "9d4a0944-c11d-42ef-880f-a97c9619c5c0",
- "description": "Pipeline for Multiflexmeter Groundwater devices",
- "steps": [
- "TTN@1.0.0",
- "MFMGroundwater@1.0.0"
], - "status": "active",
- "last_status_change": "2022-01-01T00:00:00.000Z",
- "created_at": "2022-01-01T00:00:00.000Z"
}
}
Get the pipeline with the given identifier.
This endpoint by default returns a 404 Not Found for inactive pipelines.
To get an inactive pipeline, provide the status=inactive
query parameter.
id required | string <uuid> The UUID of the pipeline |
status | Array of strings Example: status=active&status=inactive The status of the pipeline. Use |
{- "message": "Fetched pipeline",
- "data": {
- "id": "9d4a0944-c11d-42ef-880f-a97c9619c5c0",
- "description": "Pipeline for Multiflexmeter Groundwater devices",
- "steps": [
- "TTN@1.0.0",
- "MFMGroundwater@1.0.0"
], - "status": "active",
- "last_status_change": "2022-01-01T00:00:00.000Z",
- "created_at": "2022-01-01T00:00:00.000Z"
}
}
Update some properties of the pipeline with the given identifier.
Setting an invalid state or making an invalid state transition will result in an error.
id required | string <uuid> The UUID of the pipeline |
description | string |
steps | Array of strings |
status | string Used to change a pipeline from inactive to active or vice-versa.
Moving from active to inactive can also be achieve by |
{- "description": "Pipeline for Multiflexmeter Groundwater devices",
- "steps": [
- "TTN@1.0.0",
- "MFMGroundwater@1.0.0"
], - "status": "active"
}
{- "message": "Updated pipeline",
- "data": {
- "id": "9d4a0944-c11d-42ef-880f-a97c9619c5c0",
- "description": "Pipeline for Multiflexmeter Groundwater devices",
- "steps": [
- "TTN@1.0.0",
- "MFMGroundwater@1.0.0"
], - "status": "active",
- "last_status_change": "2022-01-01T00:00:00.000Z",
- "created_at": "2022-01-01T00:00:00.000Z"
}
}
Disables a pipeline by setting its status to inactive.
Inactive pipelines will - by default - not appear in the ListPipelines
and GetPipeline
endpoints,
unless the status=inactive
query parameter is given on that endpoint.
id required | string <uuid> The UUID of the pipeline |
{- "message": "Disabled pipeline"
}
Query a list of measurements.
This endpoint is used to get all measurements that correspond with the given filters.
It is commonly required to get a single stream of measurements from a single sensor. This can be accomplished by
finding the corresponding datastream ID and using that in the datastream
filter.
Most query parameters can be repeated to get an OR combination of filters. For example, providing the datastream
parameter twice will return measurements for either datastreams.
start required | string <date-time> Example: start=2022-01-01T00:00:00Z |
end required | string <date-time> Example: end=2022-12-31T23:59:59Z |
device_id | string |
datastream | string |
sensor_code | string |
cursor | string The cursor for the current page |
limit | integer The maximum amount of items per page. Not applicable if |
{- "links": {
- "previous": "string",
- "next": "string"
}, - "page_size": 0,
- "total_count": 0,
- "data": [
- {
- "uplink_message_id": "ca29e28e-eeb6-4662-922c-6cf6a36ccb6e",
- "device_id": 5,
- "device_code": "mfm1000",
- "device_description": "Particulate matter device",
- "device_latitude": 5.131313,
- "device_longitude": 5.131313,
- "device_altitude": 5.131313,
- "device_location_description": "Grasfield pipe 24",
- "device_properties": {
- "eui": "060708090A0B0C0D"
}, - "device_state": 0,
- "sensor_id": 3,
- "sensor_code": "S123",
- "sensor_description": "Pressure sensor at 5 meters depth",
- "sensor_external_id": "5",
- "sensor_properties": { },
- "sensor_brand": "SensorCompany Inc. SC123",
- "sensor_archive_time": 7,
- "datastream_id": "153205d7-bdfc-4a0b-9de5-c6fa04c665f6",
- "datastream_description": "Concentration of particles smaller than 2.5 micrometer",
- "datastream_observed_property": "pm2.5",
- "datastream_unit_of_measurement": "ug/cm3",
- "measurement_timestamp": "2022-01-01T00:00:00Z",
- "measurement_value": 3.44,
- "measurement_latitude": 3.44,
- "measurement_longitude": 3.44,
- "measurement_altitude": 3.44,
- "measurement_properties": { },
- "measurement_expiration": "2022-01-01T00:00:00Z",
- "created_at": "2022-01-01T00:00:00.000Z"
}
]
}
List all datastreams.
A sensor can produce one or more timeseries of measurements. Such a unique timeserie is called a datastream.
For example: A Particulate Matter sensor might return count the number of particles smaller than 2.5 μg/cm2, 5 μg/cm2 and 10 μg/cm2. this is one sensor producing three datastreams.
Another example would be a worker which processes raw incoming values into meaningful data. An underwater pressure sensor might supply its measurement in milli Amperes, but the worker converts it to watercolumn in meters. The sensor now has two datastreams. Presusre in millivolt and watercolumn in meters.
sensor | Array of integers <int64> only return datastreams that are produced by the given sensor identifier |
cursor | string The cursor for the current page |
limit | integer <int64> The maximum amount of items per page. Not applicable if |
{- "links": {
- "previous": "string",
- "next": "string"
}, - "page_size": 0,
- "total_count": 0,
- "data": [
- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "description": "string",
- "sensor_id": 0,
- "observed_property": "string",
- "unit_of_measurement": "string",
- "created_at": "2022-01-01T00:00:00Z"
}
]
}
Get the datastream with the given identifier.
The returned datastream will also include the full model of the sensors attached to that datastream.
id required | string <uuid> The UUID of the datastream |
{- "message": "Fetched datastream",
- "data": {
- "datastream": {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "description": "string",
- "sensor_id": 0,
- "observed_property": "string",
- "unit_of_measurement": "string",
- "created_at": "2022-01-01T00:00:00Z"
}, - "device": {
- "id": 1,
- "code": "mfm1000",
- "state": 0,
- "description": "Grasfield pipe 24",
- "organisation": "provincie_zeeland",
- "properties": {
- "eui": "060708090A0B0C0D"
}, - "altitude": 1.2345,
- "latitude": 1.2345,
- "longitude": 1.2345,
- "location_description": "Description of location",
- "sensors": [
- {
- "id": 1,
- "device_id": 1,
- "code": "S123",
- "description": "Pressure sensor at 5 meters depth",
- "external_id": "5",
- "brand": "SensorCompany LTD. SCL115",
- "archive_time": 7,
- "properties": {
- "mount_height": "15cm"
}, - "created_at": "2023-05-17T15:00:00.000Z"
}
], - "created_at": "2019-08-24T14:15:22Z"
}, - "sensor": {
- "id": 1,
- "device_id": 1,
- "code": "S123",
- "description": "Pressure sensor at 5 meters depth",
- "external_id": "5",
- "brand": "SensorCompany LTD. SCL115",
- "archive_time": 7,
- "properties": {
- "mount_height": "15cm"
}, - "created_at": "2023-05-17T15:00:00.000Z"
}, - "latest_measurement_value": 0,
- "latest_measurement_timestamp": "2019-08-24T14:15:22Z"
}
}
Push an uplink message to the HTTP Importer for processing.
The request body and content-type can be anything the workers (defined by the pipeline steps) in the pipeline expect.
As this process is asynchronuous, any processing error will not be returned in the response. Only if the HTTP Importer is unable to push the message to the Message Queue, will an error be returned.
pipeline_id required | string <uuid> Example: c4d4fabd-9109-40cd-88b0-be40ca1745f7 The UUID of the pipeline |
{ }
Lists traces that match the provided filter.
cursor | string The cursor for the current page |
limit | integer The maximum amount of items per page. Not applicable if |
tracing_id | Array of strings <uuid> Example: tracing_id=a59d28c8-2a0f-4e89-9f49-6942f1c04342 |
device_id | integer <int64> Example: device_id=5 |
status | integer Example: status=2 |
duration_greater_than | integer Example: duration_greater_than=5 |
duration_smaller_than | integer Example: duration_smaller_than=10 |
{- "links": {
- "previous": "string",
- "next": "string"
}, - "page_size": 0,
- "total_count": 0,
- "data": [
- {
- "tracing_id": "a59d28c8-2a0f-4e89-9f49-6942f1c04342",
- "device_id": 37,
- "start_time": "2019-08-24T14:15:22Z",
- "status": 2,
- "status_string": "succes",
- "steps": [
- {
- "start_time": "2019-08-24T14:15:22Z",
- "status": 2,
- "status_string": "succes",
- "duration": 5.321,
- "error": "string"
}
]
}
]
}
Lists ingresses that match the provided filter.
cursor | string The cursor for the current page |
limit | integer The maximum amount of items per page. Not applicable if |
{- "links": {
- "previous": "string",
- "next": "string"
}, - "page_size": 0,
- "total_count": 0,
- "data": [
- {
- "tracing_id": "6bc181f1-1512-493f-9c1c-81f66e479193",
- "raw_message": "string",
- "archived_at": "2019-08-24T14:15:22Z",
- "expires_at": "2019-08-24T14:15:22Z",
- "ingress_dto": {
- "tracing_id": "6bc181f1-1512-493f-9c1c-81f66e479193",
- "pipeline_id": "ec036e81-7903-4e4d-bbfa-ac8516341cf0",
- "owner_id": 0,
- "payload": "string",
- "created_at": "2019-08-24T14:15:22Z"
}
}
]
}
Lists Tenants
name | integer <int64> Filter on specific name of a tenant |
state | integer <int64> Example: state=1 Filter on soecific state of a tenant |
is_member | boolean Only show tenants that this user is a member of |
cursor | string The cursor for the current page |
limit | integer The maximum amount of items per page. Not applicable if |
{- "links": {
- "previous": "string",
- "next": "string"
}, - "page_size": 0,
- "total_count": 0,
- "data": [
- {
- "id": 1,
- "name": "Provincie Zeeland",
- "address": "Zeeland",
- "zip_code": "4331 ZE",
- "city": "Vlissingen",
- "chamber_of_commerce_id": "string",
- "headquarter_id": "string"
}
]
}
Adds a user with the specific ID to the given Tenant as a member with the given permissions
tenant_id required | integer The identifier of the tenant |
user_id required | string |
permissions required | Array of strings |
{- "user_id": "string",
- "permissions": [
- "string"
]
}
{- "message": "User added to Tenant"
}
Removes a member by the given user id from a tenant
tenant_id required | integer <int64> The identifier of the tenant |
user_id required | string The identifier of the user |
{- "message": "Member removed from tenant"
}
Update a tenant member's permissions
tenant_id required | integer <int64> The identifier of the tenant |
user_id required | string The identifier of the user |
permissions required | Array of strings |
{- "permissions": [
- "string"
]
}
{- "message": "Member removed from tenant"
}
Lists traces that match the provided filter.
cursor | string The cursor for the current page |
limit | integer The maximum amount of items per page. Not applicable if |
id | Array of strings Filter by Pipeline IDs |
{- "links": {
- "previous": "string",
- "next": "string"
}, - "page_size": 0,
- "total_count": 0,
- "data": [
- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "name": "string",
- "description": "string",
- "state": "enabled",
- "language": "python",
- "tenant_id": 0,
- "revision": 0,
- "status": "unknown"
}
]
}
Create a new worker
name required | string |
description | string |
user_code required | string <base64> base64 encoded user code |
state | string Enum: "enabled" "disabled" |
{- "name": "string",
- "description": "string",
- "user_code": "string",
- "state": "enabled"
}
{- "message": "created user worker",
- "data": {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "name": "string",
- "description": "string",
- "state": "enabled",
- "language": "python",
- "tenant_id": 0,
- "revision": 0,
- "status": "unknown"
}
}
Get the worker with the given identifier.
id required | string <uuid> The UUID of the worker |
{- "message": "Fetched worker",
- "data": {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "name": "string",
- "description": "string",
- "state": "enabled",
- "language": "python",
- "tenant_id": 0,
- "revision": 0,
- "status": "unknown"
}
}
Update a some properties of the worker with the given identifier.
The request body should contain one or more modifiable properties of the Worker.
id required | string <uuid> The UUID of the worker |
name | string |
description | string |
state | string Enum: "enabled" "disabled" |
user_code | string <base64> base64 encoded user code |
{- "name": "string",
- "description": "string",
- "state": "enabled",
- "user_code": "string"
}
{- "message": "Updated worker properties"
}
Lists API Keys
tenant_id | integer <int64> The id of the tenant from which to retrieve API keys |
cursor | string The cursor for the current page |
limit | integer The maximum amount of items per page. Not applicable if |
{- "links": {
- "previous": "string",
- "next": "string"
}, - "page_size": 0,
- "total_count": 0,
- "data": [
- {
- "id": 1,
- "name": "Provincie Zeeland",
- "tenant_id": 19,
- "tenant_name": "Provincie Zeeland",
- "expiration_date": "2023-05-17T15:00:00.000Z",
- "created": "2022-05-17T15:00:00.000Z"
}
]
}
Create an API key for a tenant with an expiration date. Permissions for the API key within that organisation must be set
name required | string |
tenant_id required | integer <int64> |
permissions | Array of strings |
expiration_date | string <date-time> |
{- "name": "Device Beheerder",
- "tenant_id": 19,
- "permissions": [
- "string"
], - "expiration_date": "2023-05-17T15:00:00.000Z"
}
{- "api_key": "MjU5MzE1NDgwMjE2NTMwMTEyODo2MjY2MDdkMGViY2Q5MGRhMTRkZWE4NGY4MjEzYjRiNw"
}
Get an API Key by ID
api_key_id required | integer <int64> The identifier of the API key |
{- "id": 1,
- "name": "Provincie Zeeland",
- "tenant_id": 19,
- "tenant_name": "Provincie Zeeland",
- "expiration_date": "2023-05-17T15:00:00.000Z",
- "created": "2022-05-17T15:00:00.000Z"
}