The example given there does not work.
curl -H 'Content-Type: application/json' -d '{\"text\": \"Hello World\"}' <YOUR WEBHOOK URL>
It should be update to something like this:
curl -H 'Content-Type: application/json' -d '{"@context": "http://schema.org/extensions","@type": "MessageCard", "text": "Hello World"}' <YOUR WEBHOOK URL>
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
Hi camil-o! Thank you for bringing this issue to our attention. We will investigate and if we require further information we will reach out. Best regards, Teams Platform
Same issues observed by trying out ths example.
Try formatting the json without the slashes and it works! I have also put the payload with -d at the end.
Please feel free to reopen if you have further query
The documentation needs to be changed to remove the escaping slashes from the payload.
In this documentation: https://docs.microsoft.com/en-us/microsoftteams/platform/webhooks-and-connectors/how-to/connectors-using#post-a-message-to-the-webhook-using-curl
// on macOS or Linux
curl -H 'Content-Type: application/json' -d '{\"text\": \"Hello World\"}' <YOUR WEBHOOK URL>
This returns:
Bad payload received by generic incoming webhook.
The correct command is:
curl -H 'Content-Type: application/json' -d '{"text": "Hello World"}' <YOUR WEBHOOK URL>
without the backslashes \
This returns:
1
Most helpful comment
This fixes the issue: https://github.com/MicrosoftDocs/msteams-docs/issues/1649
In this documentation: https://docs.microsoft.com/en-us/microsoftteams/platform/webhooks-and-connectors/how-to/connectors-using#post-a-message-to-the-webhook-using-curl
// on macOS or Linux
curl -H 'Content-Type: application/json' -d '{\"text\": \"Hello World\"}' <YOUR WEBHOOK URL>This returns:
Bad payload received by generic incoming webhook.
The correct command is:
curl -H 'Content-Type: application/json' -d '{"text": "Hello World"}' <YOUR WEBHOOK URL>without the backslashes
\This returns:
1