Skip to content

Latest commit

 

History

History
62 lines (44 loc) · 1.24 KB

File metadata and controls

62 lines (44 loc) · 1.24 KB

chatwork-api

This package just wraps the chatwork API.

Requirements

  • Node.js v20 or later

Usage

Install

With npm:

npm install chatwork-api-wrap

With yarn:

yarn add chatwork-api-wrap

SourceCode

// CommonJS
const chatwork = require('chatwork-api-wrap');

// ES Modules
// import * as chatwork from 'chatwork-api-wrap';

// Using async/await
async function getChatworkInfo() {
  try {
    const info = await chatwork.me.get('YourChatworkToken');
    console.log(info);
  } catch (error) {
    console.error(error);
  }
}

// Using Promise chain
chatwork.me.get('YourChatworkToken')
    .then((body) => console.log(body))
    .catch((error) => console.error(error));

Properties

property description
me Your own account information.
my Your own relation data.
contacts Your own contact data.
rooms Chat room operation.
incomingRequests Contact approval request data operation.

Reference

chatwork API Document