LoginSignup
3
0

More than 5 years have passed since last update.

【KARTE】Webhookを利用してchatworkに通知を送る

Last updated at Posted at 2018-06-29

KARTEのWebhook機能を利用すると、ユーザーの行動イベントをトリガーにChatworkに通知やタスク付けを行うことができます。

設定方法

チャットワークAPIを使えるようにしておき、X-ChatWorkTokenを用意します。

各エンドポイントやその他APIに関する情報はこちら
チャットワークAPIドキュメント

Webhookテンプレート(サポート対象外)のカスタマイズ画面から以下を変数として設定してください。

通知のみ

変数名
target_url https://api.chatwork.com/v2/rooms/ルームID/messages
method POST
body body=メッセージ内容
headers.Content-Type application/x-www-form-urlencoded
headers.X-ChatWorkToken ******

タスク付け

変数名
target_url https://api.chatwork.com/v2/rooms/ルームID/tasks
method POST
body body=メッセージ内容&to_ids=[ユーザーID]&limit=[タスク期限日]
headers.Content-Type application/x-www-form-urlencoded
headers.X-ChatWorkToken ******

※タスク期限日はUnix timeで入力してください

3
0
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
0