Need help with configuring Webhook to MS teams

mallesh.ps

New Member
Nov 4, 2024
4
0
1
Hi,

I'm attempting to configure a webhook to deliver notifications to Microsoft Teams, but it's not working as planned for a variety of reasons. The configuration is described below, and when I do the test, it does not throw any errors, however, in teams, it shows as



1733799781143.png

1733799725759.png

Please help me to resolve this issue.
 

Attachments

  • 1733799718507.png
    1733799718507.png
    7.6 KB · Views: 5
Are you sure that the data and the template are valid? The error sounds a lot like there is something wrong with the JSON.
 
Are you sure that the data and the template are valid? The error sounds a lot like there is something wrong with the JSON.
To be honest, I'm new to this, and there are no examples for MS teams on the Proxmox site either. Could you help me with the configuration?
 
I was able to get it to flow by using the sample json for the adaptive card provided in the video link description.

Code:
{
    "type": "message",
    "attachments": [
      {
        "contentType": "application/vnd.microsoft.card.adaptive",
        "content": {
          "type": "AdaptiveCard",
          "body": [
            {
              "type": "TextBlock",
              "text": "{{ message }}"
            }
          ],
          "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
          "version": "1.0"
        }
      }
    ]
  }
 
Last edited:
I was able to get it to flow by using the sample json for the adaptive card provided in the video link description.

Code:
{
    "type": "message",
    "attachments": [
      {
        "contentType": "application/vnd.microsoft.card.adaptive",
        "content": {
          "type": "AdaptiveCard",
          "body": [
            {
              "type": "TextBlock",
              "text": "{{ message }}"
            }
          ],
          "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
          "version": "1.0"
        }
      }
    ]
  }
This works with the incoming webhook Office 365 connector which will be deprecated shortly but not with the workflow created using Power Automate.
 
Last edited:
Hi, i'm experiencing the same issue when using the Webhook-Workflow from Power-Automate (Created via right-click on channel name -> workflows). Using the now deprecated O365 Connector everything works fine.
From my testing the issue is caused by proxmox (or the http handler) not setting the "Content-Length" header correctly.

Example:

1736169116472.png

Does not work with the same error in power automate as OP posted.
1736168814601.png


But if I include "Content-Length" as a header with the correct amount of bytes in the body
1736168967945.png
the message gets send to the Teams-channel as intended.
1736169063015.png


Another possible source of this issue could be that the Content-Length is apparently included in the request-body as hex representation ("280"(16) in this case):
1736169377919.png
If I include a Content-Length header as shown in the second attempt (above) these "280" at the top and "0" at the bottom of the body do not show up

I hope this helps tracking the issue.
 

Attachments

  • 1736168705844.png
    1736168705844.png
    49.3 KB · Views: 2

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!