Exploring properties – Node.js SDK interaction techniques
Properties, also called cloud variables, are one of the most important ingredients for Things in the Arduino IoT Cloud, responsible for storage of sensor data from the device to the cloud or vice versa. In this section, we will explore how to create, update, delete, and list cloud variables using the Node.js SDK.
Creating a property
Firstly, we will start with property creation. The property creation documentation can be found at https://www.arduino.cc/reference/en/iot/api/#api-PropertiesV2-propertiesV2Create. Open the create-property.js
file under the properties
folder in VSCode.
There are two methods in the code: one is getToken()
, which is the same method used in all our coding exercises to fetch the authentication token for our requests. The second method is CreateProperty()
, which handles cloud variable creation. Consulting the documentation, we can see that we need to initiate the api
variable with AiotApi...