LoginSignup
3
1

More than 3 years have passed since last update.

Twitter のエゴサ結果を LINE WORKS のトークルームにチャットで通知する Bot

Last updated at Posted at 2019-12-01

Twitter のエゴサ結果を LINE WORKS のトークルームにチャットで通知する Bot を作ってみましょう。

Microsoft Power Automate でコーディングなしで、サクッと作っちゃいます。

Microsoft Power Automate のフロー作成

トリガーに "Twitter" の "新しいツイートが投稿されたら" を選択。

image.png

image.png

エゴサ用のキーワードを設定します。
image.png

チャットでトークルームに通知するアクションを追加。
アクションに "HTTP" の "HTTP" を選択。
image.png

image.png

LINE WORKS のトーク Bot API のメッセージ送信のドキュメントを参考に、以下のとおり HTTP アクションのパラメーターを設定します。

TITLE: メッセージ送信 (text)
URL: https://developers.worksmobile.com/jp/document/100500801?lang=ja

方法: POST
URI: https://apis.worksmobile.com/r/{API ID}/message/v1/bot/{botNo}/message/push
API ID と botNo は Developer コンソールで設定可能な値を確認します。

ヘッダー:
Content-Type application/json; charset=UTF-8
consumerKey Developer コンソールの値
Authorization Bearer <トークンの文字列>

本文:
{
"accountId": "user@example",
"content": {
"type": "text",
"text": "@{triggerBody()?['TweetText']}\n by@{triggerBody()?['UserDetails']?['Id']}@{triggerBody()?['UserDetails']?['UserName']}"
}
}
image.png
image.png

動作確認

設定したキーワードに関連したツイートの内容が LINE WORKS のトークルームに送信されるのを確認します。

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