avengers-chatwork

1.0.4 • Public • Published

Avengers Chatwork

A simple ChatWork API client for Node.js

Installation

$ npm install avengers-chatwork

Dependencies

API Document

Official API Document

RAML

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

Author

Readme

Keywords

Package Sidebar

Install

npm i avengers-chatwork

Weekly Downloads

1

Version

1.0.4

License

ISC

Unpacked Size

5.24 kB

Total Files

4

Last publish

Collaborators

  • hieudt