avengers-chatwork
v1.0.4
Published
A Chatwork API client for Node.js Developer by Avengers Member
Downloads
6
Readme
Avengers Chatwork
A simple ChatWork API client for Node.js
Installation
$ npm install avengers-chatwork
Dependencies
API Document
Usage
The minimal you'll need to have is:
var CW = require('avengers-chatwork'),
client = CW();
// initialize.
client.init({
token: 'YOUR_API_TOKEN'
});
// get your info.
client.get('me', function (err, res) {
console.log(res.body);
});
// create room.
client.post('rooms', {
name: 'room',
members_admin_ids: '123456789,987654321',
description: 'description'
}, function (err, res) {
console.log('created.');
});
// Api function
client.me().then(function (res) {
console.log(res.data);
}).catch(function (err) {
console.log(err.response.data)
});
Deferred support
var CW = require('avengers-chatwork'),
client = CW(),
Deferred = client.Deferred;
// initialize.
client.init({ token: 'YOUR_TOKEN' });
// get your info.
client
.get('me')
.done(function (res) {
console.log(res.body)
})
.fail(function (err) {
console.error(err);
});