Ubidots class
Ubidots JavaScript library's main class.
Last updated
Was this helpful?
Ubidots JavaScript library's main class.
Last updated
Was this helpful?
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:
Here, the methods exposed by the devices
sub-class allow you to consume the whole .
Ubidots
class propertiesdevices
variables
dashboards
users
organizations
Ubidots
class methodsauthenticate
A valid Ubidots token.
Authenticates with the Ubidots API.
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:
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.