Ubidots class
Ubidots JavaScripy Library's main class.
Last updated
Ubidots JavaScripy Library's main class.
Last updated
The Ubidots
class is the entrypoint of the library, providing sub-classes for interacting with each particular supported entity from the API. For example, to use the devices API you can do:
Here, the methods exposed by the devices
sub-class allow you to consume the whole devices API.
Ubidots
class propertiesProperty | Description |
---|---|
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 devices API.
Ubidots
class methodsMethod | Arguments | Description |
---|---|---|
Authentication using a valid Ubidots token is mandatory to use the library:
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:
As stated before, the Ubidots class exposes its methods through entities
for a particular part of the API such as devices or variables, thus providing the following syntax:
Field filtering is available for each entity
through the following syntax:
Here:
<entity>
is any of the valid entities.
<filterMethod>
is either of these 2 methods:
<getMethod>
Either of the below methods to retrieve entities
:
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 <getMethods>
after the filter statements.
devices
Provides access to devices API.
variables
Provides access to variables API.
dashboards
Provides access to dashboards API.
users
Provides access to users API.
organizations
Provides access to organizations API.
authenticate
A valid Ubidots token.
Authenticates with the Ubidots API.