Skip to content

astronaughts/simple-cw-node

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

simple-cw-node

A simple ChatWork API client for Node.js. ( UNOFFICIAL )

Installation

$ npm install simple-cw-node

Dependencies

API Document

Official API Document

RAML

Usage

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.');
});

Deferred support

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);
    });

Author

About

A simple ChatWork API client for Node.js (UNOFFICIAL)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published