API
Access Ubidots Javascript SDK from the HTML canvas
Javascript SDK
ubidots.api.<JS_SDK_METHODS>Usage
// Get token from Ubidots built-in library
const TOKEN = ubidots.token;
// Authenticate the SDK with the token
ubidots.api.authenticate(TOKEN);
// Get first 100 devices from the account
ubidots.api.devices.get().then((devices) => {
// Prints an array of Device objects
console.log(devices);
// YOUR LOGIC OVER THESE 100 DEVICES
});Last updated
Was this helpful?