Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alexanderc/ubidots
Unofficial Ubidots NodeJS API Client
https://github.com/alexanderc/ubidots
api iot sdk ubidots
Last synced: 5 days ago
JSON representation
Unofficial Ubidots NodeJS API Client
- Host: GitHub
- URL: https://github.com/alexanderc/ubidots
- Owner: AlexanderC
- License: mit
- Created: 2018-12-12T07:32:27.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2021-04-27T08:53:25.000Z (over 3 years ago)
- Last Synced: 2024-10-11T07:52:32.852Z (about 1 month ago)
- Topics: api, iot, sdk, ubidots
- Language: JavaScript
- Size: 43 KB
- Stars: 3
- Watchers: 4
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Unofficial Ubidots NodeJS API Client
Node.js API Client for [Ubidots](https://ubidots.com)
## Prerequisites
- [ ] `Node.JS` >=v8
## Installation
```bash
npm install ubidots-node
```## Usage
Initializing Library:
```javascript
const Ubidots = require('ubidots-node');
const client = Ubidots.create(Ubidots.ApiBase.Educational);// Authorize API with an API Key
await client.authorize(API_KEY);
// or alternatively using a pre-generated API Token
client.token = API_TOKEN;// Obtain UTC timestamp
const { data: now } = await ubitods
.api('utils') // API namespace
.endpoint('utc-timestamp') // API endpoint
.call(); // Pass parameters/options/dataconsole.log('UTC Timestamp', now);
// Generate API token using API Key
const { data: token } = await ubitods
.api('auth') // API namespace
.endpoint('obtainToken') // API endpoint
.call(apiKey = 'your-api-key'); // Pass parameters/options/dataconsole.log('API Token', token);
```Available APIs:
- `auth` - [Authentication](https://ubidots.com/docs/sw/#section/Authentication)
- `organization` - Missing docs
- `user` - Missing docs
- `datasource` - [Datasources](https://ubidots.com/docs/sw/#tag/Datasources)
- `dashboard` - Missing docs
- `device` - [Devices](https://ubidots.com/docs/sw/#tag/Devices)
- `variable` - [Variables](https://ubidots.com/docs/sw/#tag/Variables)
- `utils` - [Utils](https://ubidots.com/docs/sw/#tag/Utils)Official API Documentation: [https://ubidots.com/docs/sw/](https://ubidots.com/docs/sw/)
> For usage examples see `test/` folder
## Testing
```bash
UBIDOTS_API_KEY='xxxx' UBIDOTS_TOKEN='xxxx' npm test
```## Debugging
For debugging purpose the [debug](https://www.npmjs.com/package/debug) npm module is used.
Example of using the debug feature:
```bash
DEBUG='ubidots-node:*' npm test
```## Roadmap
- [ ] Complete API definition
- [ ] Add missing tests
- [ ] Add payload validation
- [ ] Find missing docs *(Ubidots support?)*