The Arduino IoT Cloud has different sets of APIs that provide different functionalities. This article serves as an introduction to how to work and what you can achieve with them.
The main goal of Configuration API is to allow you to create and manage IoT resources like dashboards, devices, things, and variables, along with the retrieval and handling of historical data coming from your IoT Devices. The core of those APIs is organized around REST. Our API has predictable resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs. You can use those APIs, both directly calling our HTTP endpoints or using our clients that wrap those calls into easy-to-use abstractions like objects and functions. We have Applications API clients available in
javascript
, golang
, and python
.To use the Configuration API, you need to create an API Key in the API Keys section.
Examples
You can find the full list of available resources and actions in the Arduino IoT Cloud Configuration API Technical Reference.
Data API allows sending and receiving any kind of data (sensors' values, commands for actuators, configuration changes...) from and to IoT Devices and the Cloud. Under the hood, they
Inside this set of API, we have:
ArduinoIoTCloud.h
arduino-iot-js
Arduino IoT Cloud Sketch library As described above, is the Arduino library that allows your Arduino devices to connect and exchange data with the IoT Cloud. If you edit your sketch directly inside IoT Cloud or Cloud Editor, you don't need to install it: it comes out of the box.
You can find more details at:
Arduino IoT JS The
arduino-iot-js
NPM module is designed for communicating with the Arduino IoT Cloud broker using the MQTT over Websocket protocol. It is primarily used to send and receive variable values.Example:
1const { ArduinoIoTCloud } = require('@arduino/arduino-iot-js');2
3ArduinoIoTCloud.connect(options)4 .then(() => {5 console.log("Connected to Arduino IoT Cloud");6 return ArduinoIoTCloud.onPropertyValue(thingId, variableName, showUpdates = value => console.log(value));7 })8 .then(() => console.log("Callback registered"))9 .catch(error => console.log(error));
Full examples and documentation can be found at:
Public Arduino IoT Cloud APIs are exposing versioned endpoints and are committed to preserving compatibility with the following policies in place: