0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Workflowsを使って、Teamsにメッセージを投稿すーる

Posted at

はじめに

TeamsのIncoming Webhook がリタイアするみたいです。

今後はWorkflowsに移行する必要があります。今日はWorkflowsを使ってメッセージを投稿してみましょう。

導入

Teamsの「アプリ」からWorkflowsを開きます
20251210-020501-64bbe8e6.png

チャネルを検索して移動します
20251210-020733-0d892e0e.png

保存します
20251210-020802-bcab8918.png

Power Automateタブから新しいフローを選択、テンプレートから開始します
20251210-021123-aa05cee1.png

Webhook 要求を受信するとチャネルに投稿するを選択します
20251210-021222-77503a06.png

続行します
20251210-021456-4ff33d23.png

チームとチャネルを選択します
20251210-021643-b64cc5ac.png

編集を選択します
20251210-021840-dd3a699a.png

When a Teams webhook request is received の HTTP POST の URL をコピーします
20251210-025350-1ae9f58f.png

REST Clientを用いて、テスト投稿してみましょう。

test.http
### Workflowsにメッセージを送信するAPI
POST {{url}}
Content-Type: application/json

{
  "type": "message",
  "attachments": [
    {
      "contentType": "application/vnd.microsoft.card.adaptive",
      "contentUrl": null,
      "content": {
        "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
        "type": "AdaptiveCard",
        "version": "1.4",
        "body": [
          {
            "type": "TextBlock",
            "text": "テスト"
          }
        ]
      }
    }
  ]
}

投稿できました!
20251210-025057-0f984937.png

お疲れ様でした。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?