This is a Node.js wrapper/client for the Smart Citizen, integrated with the Smart Citizen New API.
Project owner is AleChelli.
It includes helper functions to do the following:
- List all devices (implemented with the new API)
- Get latest Data
- Get Sensors Data
- Get User Info
The methods implemented require an api_key, you can obtain one here:
- api_key (Register and obtain one)
This project depends on request to make HTTP requests.
$ npm install smart-citizen-node-api --save
First, instantiate the wrapper.You need an Api Key obtain here
var smartCitizien = require("smart-citizen-node-api");
// You need an Api Key, you will always use your api_key
var smart = smartCitizien(your_api_key);
Lastly, use the wrapper's helper methods to make the request to Smart Citizen's API.
// List all devices
smart.devices.listAll(function(err, data){
if(err){
console.log("Error");
} else {
console.log(data);
})
- .data.getSensors(id, from, to, group_by callback);
- users.listAll(callback)
- users.me(callback)
- sensors.listAll()
- components.listAll()
- measurements.listAll()
- kits.listAll()
See something you think can be improved? Open an issue or clone the project and send a pull request with your changes.
##Enjoy IoT