Not able to post a message in teams channel with workflow "Post to a channel when a webhook request is received"

Hudgi, Praveen 10 Reputation points
2024-09-06T09:55:23.63+00:00

Hi Team,

We have created a new workflow to Post to a channel when a webhook request is received

With the below curl command it's not posting a message in teams channel, in postman it returns 202 response.

curl --location --request POST 'webhook' \

--header 'Content-Type: application/json' \

--header 'Cookie: ARRAffinity=61f26d17217c29e7c84c9e1260094b7d4df252432dcc4e893470d253cdf658e7; ARRAffinitySameSite=61f26d17217c29e7c84c9e1260094b7d4df252432dcc4e893470d253cdf658e7' \

--data-binary '@/C:/Users/test/Downloads/report.txt.json'

Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
10,286 questions
Microsoft Teams Development
Microsoft Teams Development
Microsoft Teams: A Microsoft customizable chat-based workspace.Development: The process of researching, productizing, and refining new or existing technologies.
3,331 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. LiweiTian-MSFT 20,415 Reputation points Microsoft Vendor
    2024-09-09T01:31:34.8933333+00:00

    Hi @Hudgi, Praveen

    Teams tag is mainly focused on the general issue of Microsoft Teams troubleshooting. According to your description, your question is related to Teams Development which is not in our support scope. To better help you solve your problem, please add the Teams Development tag to your post. The following suggestions are for your reference only:

    Ensure that the JSON payload in is correctly formatted and matches the expected schema for Teams messages. Sometimes, even a small formatting error can cause issues.

    Try sending the payload directly in the command to see if it works. For example:

    curl --location --request POST 'https://prod-146.westus.logic.azure.com:443/workflows/fa3de0f58c9d4dba9604cf145ba22ab7/triggers/manual/paths/invoke?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=TmP5ZdctlcHKhExoOGqaLvnuUGe4yKEKhZRGjVgtHjE' \
    --header 'Content-Type: application/json' \
    --data-raw '{"text": "Hello, Teams!"}'
    
    

    Double-check that the webhook URL is correct and active. Sometimes, the URL might change or become inactive.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.



  2. Prasad-MSFT 6,876 Reputation points Microsoft Vendor
    2024-09-12T12:41:05.9633333+00:00

    Using cURL command, you can send Adaptive card to targeted team’s channel using below format (by replacing the webhook URL copied earlier from while creating the flow):

    curl -X POST \ -H "Content-type: application/json" \ -d "{ \"type\": \"message\", \"summary\": \"here is a new alert\", \"attachments\": [ { \"contentType\": \"application/vnd.microsoft.card.adaptive\", \"contentUrl\": \"\", \"content\": { \"type\": \"AdaptiveCard\", \"body\": [ { \"type\": \"Container\", \"verticalContentAlignment\": \"Center\", \"items\": [ { \"type\": \"ColumnSet\", \"style\": \"Good\", \"columns\": [ { \"type\": \"Column\", \"width\": \"auto\", \"verticalContentAlignment\": \"Center\", \"items\": [ { \"type\": \"Image\", \"width\": \"32px\", \"style\": \"Person\", \"url\": \"https://picsum.photos/200/200?image=110\", \"altText\": \"AC Image\" } ] }, { \"type\": \"Column\", \"width\": \"stretch\", \"items\": [ { \"type\": \"TextBlock\", \"size\": \"Medium\", \"weight\": \"Bolder\", \"text\": \"here is the detailed count\", }, { \"type\": \"TextBlock\", \"size\": \"Small\", \"weight\": \"Default\", \"text\": \"Count Alert\", \"isSubtle\": \"true\", \"spacing\": \"None\" } ] } ] } ] }, { \"type\": \"FactSet\", \"facts\": [ { \"title\": \"Test Passed:\", \"value\": \"1000\" }, { \"title\": \"Test Failed:\", \"value\": \"0\" }, { \"title\": \"Author:\", \"value\": \"SOMEBODY\" }, { \"title\": \"Commit:\", \"value\": \"45w34gretretysh\" } ] } ], \"$schema\": \"Enter Webhook URL here"
    
    
    

    User's image

    Result:
    User's image


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.