AleChelli / smart-citizen-node-api

Node API for smart citizen

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Node.js Smart Citizen API

This is a Node.js client for the Smart Citizen API.

Installation

$ npm install smart-citizen-node-api

Usage

First, you need to call the module and set your API key. You can obtain your API key from your SmartCitizen Profile.

var smartCitizen = require("smart-citizen-node-api");
var client = smartCitizen(your_api_key);

Then you can start using the SmartCitizen API.

For example, to get all the devices associated to your account, you can use:

client.devices.listAll(function(err, result){
    if (err) return;
    // do something with your data
});

Implemented Methods

Devices: Get All Devices

API Reference

client.devices.listAll( function(err, result) {...} )

Sensors: Get All Sensors

API Reference

client.sensors.listAll( function(err, result) {...} )

Users: Get All Users

API Reference

client.users.listAll( function(err, result) {...} )

Users: Get Current User

API Reference

client.users.me( function(err, result) {...} )

Measurements: Get All Measurements

API Reference

client.measurements.listAll( function(err, result) {...} )

Kits: Get All Kits

API Reference

client.kits.listAll( function(err, result) {...} )

Components: Get All Components

API Reference

client.components.listAll( function(err, result) {...} )

Dependencies

This project depends on request to make HTTP requests.

Development

See something you think can be improved? Open an issue or clone the project and send a pull request with your changes.

Project Members

About

Node API for smart citizen

License:MIT License


Languages

Language:JavaScript 100.0%