web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Minimal example to sen...
Power Automate
Suggested Answer

Minimal example to send text with CURL via webhook and display it as a card in Teams?

(0) ShareShare
ReportReport
Posted on by 2
Hi experts
 
I need help with creating a flow to display simple texts sent via CURL from bash script on linux machine in a form of (adaptive) card in my Teams channel.
 
The command on linux look like this
 
teams-workflow.sh -t "TITLE" -x "MESSAGE"
 
and I expect to receive a simple message like this
 
TITLE
MESSAGE
 
I have a webook (with new URL), it works. I am sending a preformatted JSON payload in form of adaptive card. However, I fail to display it properly. Either I get an error like this
 
The execution of template action 'Send_each_adaptive_card' failed: the result of the evaluation of 'foreach' expression '@triggerOutputs()?['body']?['attachments']' is of type 'Null'. The result must be a valid array.
 
or I see a notification but with some default texts from the card template (defined by me in the flow). I also tried a step in between with the JSON Parse block. The left path in the flow is just to make sure I see some notification when the trigger works. I could not find a way to either "inject" the JSON data directly to the Card using the "Post card in a chat or channel" and its "Adaptive card" attribute, or by recreating the structure of the JSON card in the flow and using the dynamic variables (content, attachment, body, Body, text...) to get the TITTLE and MESSAGE data somehow.
 
Thanks for any help.
 
2025-10-13 14_32_17-Double Commander 1.1.26~764.png
2025-10-13 14_31_44-Double Commander 1.1.26~764.png
Categories:
I have the same question (0)
  • developerAJ Profile Picture
    4,763 on at
    use when an http request received instead of teams webhook trigger [personal choice]
     
    in this case if you can share the triggerbody it will be helpful
    ideally you should be posting this body
    {
           "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)"
                        }
                    ]
                 }
              }
           ]
        }
     

    If this solution helped you resolve your issue, kindly mark it as accepted — it makes it easier for others to find and also closes the discussion. If you found it useful, a Like ❤️ would be greatly appreciated!

    🤝 Let’s connect on LinkedIn 

    📘 Explore more on my articles

     🐱‍💻 Github Link

  • Suggested answer
    Tomac Profile Picture
    4,048 Moderator on at
    The preformatted Adaptive Card you're building in your bash script is bad.
     
    Please use the Adaptive Card Builder provided by Microsoft to ensure your Adaptive Card is using the correct schema and formatting.
     
    Once you pass a properly built Adaptive Card, your flow should no longer have this error.
  • RZ-13101014-0 Profile Picture
    2 on at
    Hi developer AJ
     
    I tried to send your data (saved into input.txt) using this command
     
    curl.exe -H "Content-Type:application/json" -d @input.txt "https://defaulted0........."
     
    In the workflow details I see the data was obtained correctly (probably) and I can see the body parameters (see screenshots):
     
    {"poster":"Flow bot","location":"Channel","body/recipient/groupId":"f7a1c41a-1943-4830-a93a-caef0c421595","body/recipient/channelId":"19:4fd0caf024004b0b8922df64f94da47c@thread.tacv2","body/messageBody":{"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)"}]}}]}}
     
    However, the card was not generated. Its setting has to be corrected somehow, right?
     
    This is its code view:
     
    {
      "type": "OpenApiConnection",
      "inputs": {
        "parameters": {
          "poster": "Flow bot",
          "location": "Channel",
          "body/recipient/groupId": "f7a1c41a-1943-4830-a93a-caef0c421595",
          "body/recipient/channelId": "19:4fd0caf024004b0b8922df64f94da47c@thread.tacv2",
          "body/messageBody": "@triggerBody()"
        },
        "host": {
          "apiId": "/providers/Microsoft.PowerApps/apis/shared_teams",
          "connection": "shared_teams",
          "operationId": "PostCardToConversation"
        }
      },
      "runAfter": {},
      "metadata": {
        "operationMetadataId": "39f90149-5c21-44c3-9647-f6944215ff93"
      }
    }
     
    Thanks a lot
    Robert
     
     
    2025-10-14 11_46_22-Double Commander 1.1.26~764.png
    2025-10-14 11_46_12-Double Commander 1.1.26~764.png
    2025-10-14 11_45_32-.png

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 605

#2
Valantis Profile Picture

Valantis 340

#3
11manish Profile Picture

11manish 284

Last 30 days Overall leaderboard