A simple ChatWork API client for Node.js. ( UNOFFICIAL )
$ npm install simple-cw-node
The minimal you'll need to have is:
var CW = require('simple-cw-node'),
client = CW();
// initialize.
client.init({
token: 'YOUR_LEGACY_TOKEN'
});
// in the case of OAuth
client.init({
type: 'oauth',
token: 'YOUR_OAUTH_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.');
});
var CW = require('simple-cw-node'),
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);
});