Cannot POST message to Teams channel using a Workflow

Abubakr Shoaliev 0 Reputation points
2024-08-01T09:41:35.8233333+00:00

Hello dear community,

General Description:

I am using a new feature introduced to Teams - Workflows
And in Workflows app I selected the "Post to a chat when a webhook request is received" template in order to send messages to Teams Channel.

What I did:

I copied the request WebHook URL, which is something like:
https://prod-221.westeurope.logic.azure.com:443/workflows/...

Then I send a POST request in a following way:

curl --location '<WebHook URL>' \
--data '{
       "type":"message",
       "attachments":[
          {
             "contentType":"application/vnd.microsoft.card.adaptive",
             "contentUrl":null,
             "content":{
                "$schema":"http://adaptivecards.io/schemas/adaptive-card.json",
                "type":"AdaptiveCard",
                "version":"1.2",
                "body":[
                    {
                    "type": "TextBlock",
                    "text": "For Samples and Templates, see [[https://adaptivecards.io/samples](https://adaptivecards.io/samples)](https://adaptivecards.io/samples%5d(https:/adaptivecards.io/samples))"
                    }
                ]
             }
          }
       ]
    }'

The request returned a status code "202 Accepted" - which didn't do anything at all, the message was not posted to a teams channel.

Any help will be greatly appreciated!

Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
10,894 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.