A set of examples for using the akenza
API.
Also refer to the product documentation and the documentation of the REST API.
examples/
├── data
│ ├── data-stream-with-tag.mjs Subscribe to the akenza data stream API with a tag.
│ ├── data-stream.mjs Subscribe to the akenza data stream API for a device/set of devices.
│ └── query-data.mjs Query historical data for a device.
├── management
│ ├── get-device.mjs Retrieve a device by akenza id and device id.
│ ├── get-devices.mjs Retrieve a set of devices.
│ └── get-tags.mjs Retrieve a set of tags.
├── uplink
│ ├── coap-send-data.mjs Send an COAP uplink.
│ ├── http-send-data.mjs Send an HTTP uplink.
│ ├── mqtt-send-data-tls.mjs Send an MQTT uplink using TLS.
│ └── mqtt-send-data.mjs Send an MQTT uplink.
- Create an api key for your organization
- Retrieve the id of the workspace you want to use
- Retrieve the akenza device id and device id of an existing device in the platform from that workspace (required for getting a device and querying data)
- Create a
.env
file
cp .env.template .env
- Fill in the information
- (optional) Create a new HTTP device (required for sending data via HTTP)
- (optional) Create a new MQTT device (required for sending data via MQTT)
- Run
npm install
node examples/<example.mjs>