GithubHelp home page GithubHelp logo

ubidots's Introduction

Unofficial Ubidots NodeJS API Client

Node.js API Client for Ubidots

Prerequisites

  • Node.JS >=v8

Installation

npm install ubidots-node

Usage

Initializing Library:

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/data

console.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/data

console.log('API Token', token);

Available APIs:

Official API Documentation: https://ubidots.com/docs/sw/

For usage examples see test/ folder

Testing

UBIDOTS_API_KEY='xxxx' UBIDOTS_TOKEN='xxxx' npm test

Debugging

For debugging purpose the debug npm module is used.

Example of using the debug feature:

DEBUG='ubidots-node:*' npm test

Roadmap

  • Complete API definition
  • Add missing tests
  • Add payload validation
  • Find missing docs (Ubidots support?)

ubidots's People

Contributors

alexanderc avatar ascripnic avatar thewingedshake avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.