Ubidots Developer Guides
Help CenterAPI ReferenceData APICommunity
  • Welcome to our Dev Guides
  • ⚡️ Getting Started
    • What is Ubidots?
    • Devices, Variables, and Dots
    • Technical FAQs
    • Business FAQs
  • 🧩Integration Guides
    • Industrial IoT
      • Advantech
      • Amplified Engineering
      • AWS
      • Azimut
      • Balena
      • Bivocom
      • CESVA
      • Controllino
      • Digital Communications Technologies (DCT)
      • Everactive
      • Golioth
      • Kepware
      • Kunbus
      • Monnit
      • MultiTech
      • NCD.io
      • Node-RED
      • Omicron IoT
      • Red Lion
      • Robustel
      • Senquip
      • Sielco
      • Siemens
      • Strega
      • vNode
      • WAGO
      • Weintek
      • YuDash
    • Cellular
      • Blues Wireless
      • Digi International
      • Hologram
      • Monogoto
      • Particle
      • Quectel
      • Soracom
    • LoRaWAN
      • AonChip
      • Chirpstack
      • Decentlab
      • Helium
      • ioThings
      • LORIOT
      • Milesight
      • MOKOSmart
      • RAKwireless
      • Sagemcom
      • Seeed Studio
      • Senet
      • The Things Industries
        • The Things Stack
        • The Things Network
    • Sigfox
      • Digital Matter
      • McThings
      • Sigfox
      • Suntech
      • Thinxtra
      • UnaBiz
    • Satellite
      • Swarm
    • Dev Kits
      • Adafruit
      • Advantech
      • AloriumTech
      • Arduino
      • Blues Wireless
      • DFRobot
      • Dragino
      • Electric Imp
      • Espressif Systems
      • McThings
      • Microchip Technology
      • Onion
      • Particle
      • Pycom
      • RAKwireless
      • Raspberry Pi
      • Seeed Studio
      • Sodaq
      • STMicroelectronics
      • Texas Instruments
      • Thinxtra
      • Verse Technology
    • Weather
      • Weather Plugins
      • Ambient Weather
    • Tools
      • Gambit Communications
      • PubNub
  • 📊Dashboards & Widgets
    • HTML Canvas
      • 3rd party packages
      • Preload Dashboard data
      • Built-in library
        • Properties
        • Methods
        • Listening events
        • API
      • Examples
        • Basics
        • Create an LCD screen with the HTML Canvas
        • Interacting with dashboard data
        • Change header's custom style
        • Adding real time using Socket.IO
        • Delete Variable data from a Device
        • Delete Variable data from Groups or Types of Devices
        • Navigation through Dashboard
        • Using a React library
      • Code editor
        • HTML Tab
        • CSS Tab
        • JavaScript Tab
    • Custom UI
      • Paragraph
      • Input combo
        • Text
        • Numeric
        • Numeric with buttons
        • Date
        • Time
        • Toggle
        • Dropdown
        • Multiple selection dropdown
      • Button
    • Custom Style
      • Dashboards
      • Widgets
    • Line chart
    • Pages
      • Getting started
      • Development
      • API
        • Page creation
        • Publish
  • 🤖UbiFunctions
    • Getting Started
      • Creating an UbiFunction
      • Coding an UbiFunction
      • Testing an UbiFunction
      • Authentication
      • Execution Time
      • Logs
    • Runtimes
      • Python
      • NodeJS
      • Custom Runtimes
    • Invocation
      • Time-based Trigger
      • HTTPS
      • MQTT Publish
      • Ubidots Event
    • Advanced
      • Account Token
      • Execution time
      • Raw Functions
      • CORS Policy
      • Async Execution
      • DaaS (Decoder as a Service)
      • Developing and Managing UbiFunctions with Ubidots CLI
    • Examples
    • Specs and Limits
    • Storage
      • File Storage API
      • Mutiple files
  • 🧩Plugins
    • What is a plugin?
    • Public vs. Private
    • Public plugins
      • Cron
      • Webhook
    • Private Plugins
      • Cron
      • Webhook
      • Widget
      • Device
    • Plugins development
      • Getting started
      • Cron
      • Webhook
      • Widget
      • Device
      • view.xml
      • view_widget.xml
    • Plugins deployment
      • Cron and Webhook
      • Widget
      • Device
    • Using the plugins
      • Cron and Webhook
      • Widget
      • Device
  • 📈SYNTHETIC VARIABLES
    • Getting started
      • Creating synthetic variables
      • Synthetic Variables' editor
    • Expressions
      • Mathematical
      • Date range
      • Rolling
      • Special functions
    • Specs and limits
    • Examples
      • Mathematical
      • Date range
      • Rolling
      • Special functions
  • ⌨️Developer tools
    • Javascript SDK
      • Overview
      • Getting started
      • Ubidots class
        • Get methods
        • Filter methods
        • Ubidots objects
          • Entity object
          • Paginator
      • Examples
    • CLI
      • Overview
      • Installing
      • Usage
      • SDK for UbiFunctions
  • 🏗️Apps
    • App builder
      • Custom sidebar
Powered by GitBook
On this page
  • Definition
  • Ubidots class properties
  • Ubidots class methods
  • Usage
  • Authentication
  • Instantiation
  • General syntax
  • Filters syntax

Was this helpful?

Export as PDF
  1. Developer tools
  2. Javascript SDK

Ubidots class

Ubidots JavaScript library's main class.

PreviousGetting startedNextGet methods

Last updated 6 months ago

Was this helpful?

Definition

The Ubidots class is the entrypoint of the library, providing sub-classes for interacting with each particular from the API. For example, to use the you can do:

Ubidots.devices.<methods>

Here, the methods exposed by the devices sub-class allow you to consume the whole .

Ubidots class properties

Property
Description

devices

variables

dashboards

users

organizations

From now on, these properties will be addressed as entity or entities to reflect the fact that they enable interacting with that part (entity) of the API. With this in mind, device entity refers to the property of the Ubidots class that allows interacting with the API.

Ubidots class methods

Method
Arguments
Description

authenticate

A valid Ubidots token.

Authenticates with the Ubidots API.

Usage

Authentication

Ubidots.authenticate('BBFF-ubidots-token');

Instantiation

This class is implemented as a singleton which is instantiated when it is exported, thus, there is no need for creating an instance of it. Instead, you must use it directly:

// Import the class
const { Ubidots } = require('@ubidots/ubidots-javascript-library');
// Call 'authenticate' method with no prior instantation of 'Ubidots'
Ubidots.authenticate('ubidots-valid-token');

General syntax

Ubidots.<entity>.<getMethod>(, [args]);

Filters syntax

Ubidots.<entity>.<filterMethod>(args).<getMethod>(, [args]);

Here:

  • <filterMethod> is either of these 2 methods:

Provides access to API.

Provides access to API.

Provides access to API.

Provides access to API.

Provides access to API.

Authentication using a valid is mandatory to use the library:

As stated before, the Ubidots class exposes its through for a particular part of the API such as devices or variables, thus providing the following syntax:

is available for each through the following syntax:

<entity> is any of the valid .

<getMethod> Either of the below methods to retrieve :

Neither where nor addRawParams methods perform the request to the API, they just build the URL with the corresponding query params. In order to actually perform the request, it is required to concatenate a calling to any of the after the filter statements.

⌨️
Ubidots token
where()
addRawParams()
all()
get()
first()
paginate()
<getMethods>
methods
entities
Field filtering
entity
entities
entities
devices
variables
dashboards
users
organizations
devices API
devices API
devices
supported entity