LoginSignup
3
1

More than 5 years have passed since last update.

kintoneからChatworkにメッセージを送る

Posted at

すでにkintoneとChatworkの連携は紹介されておりましたが、公開されていたサイトがデータベース接続確立エラーということだったんで残しときます。

参考

前提

チャットワークAPIは限定公開されているので使用するには事前申し込みが必要です。

サンプル

sample
var url = 'https://api.chatwork.com/v1/rooms/' + '(ルームID)' + '/messages';
var headers = {
    'X-ChatWorkToken': '(トークン)',
    'Content-Type': 'application/x-www-form-urlencoded'
};
var data = 'body=' + '(メッセージ)';

kintone.proxy(url, 'POST', headers, data,
    function(body, status, headers) {
        console.log(status, JSON.parse(body), headers);
    },
    function(error) {
        console.log(error);
    });

dataをJSONでPOSTしようとしたがうまくいかなかったのでとりあえずこちらで。わかり次第追記します。

3
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
1