Skip to content

peakys-org/chatwork-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

chatwork-api

Chatwork API をパッケージ化したものです。

インストール

npm install @peakys/chatwork-api
import chatwork from '@peakys/chatwork-api'

使い方

例えば、エンドポイントhttps://api.chatwork.com/v2/rooms/{room_id}/messages/{message_id}に対し、getメソッドを実行したい場合は次のようにする。

await chatwork(APIKEY).rooms(roomId).messages(messageId).get()

get()メソッドの引数にはクエリパラメータを渡すことができ、URI の?の後に続く式を文字列として渡す。

例えば、エンドポイントhttps://api.chatwork.com/v2/rooms/{room_id}/messagesに対し、postメソッドを実行したい場合は次のようにする。

await chatwork(APIKEY).rooms(roomId).messages().post(body)

post(), put(), delete() メソッドには、普通 body が引数として渡される。

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published