Engaging with Things – Node.js SDK implementation guide
The Thing is one of the most important elements in the Arduino IoT Cloud, and acts as defined container holding all of its ingredients such as cloud variables, the device, a sketch for the device, and the device’s network configuration. In this section, we will try a range of different coding exercises to get a feel for Thing CRUD operations.
Creating a Thing
Firstly, we will start with Thing creation. The relevant documentation can be found at https://www.arduino.cc/reference/en/iot/api/#api-ThingsV2-thingsV2Createe. Open the create-thing.js
file under the thing
folder in VSCode.
There are two methods in this code: one is getToken()
, which is the same method as in all our coding exercises and helps us to fetch an authentication token for our requests. The second method is CreateThing()
, which is responsible for Thing creation. Referring to the documentation, we can see that we need to initiate the api
variable...