[Solved] Teams Incoming Webhook: Bad payload received by generic incoming webhook

Jenkins 55 Reputation points
2023-07-10T14:22:58.4466667+00:00

Hello,

We use the MessageCard Reference (https://learn.microsoft.com/en-us/outlook/actionable-messages/message-card-reference) to send messages to Teams via incoming webhooks (https://learn.microsoft.com/en-us/outlook/actionable-messages/send-via-connectors#send-the-message). Here is an example of a payload:

{
    "@type": "MessageCard",
    "@context": "http:\/\/schema.org\/extensions",
    "themeColor": "d58200",
    "title": "title",
    "text": "text",
    "potentialAction": [
        {
            "@type": "OpenUri",
            "name": "Name",
            "targets": [
                {
                    "os": "default",
                    "uri": "https:\/\/www.example.com\/"
                }
            ]
        }
    ]
}

We've been sending this for years, but since around 7th July we started getting the error message:

{"message":"Bad payload received by generic incoming webhook.","http_code":400}

I can also see the following response when making a request to the webhook endpoint:

System.ArgumentNullException: Value cannot be null. (Parameter 'jtoken')

This doesn't happen when I make the call (using the same endpoint and payload) using Postman. This only happens when we make the call from inside our code.

Does anyone know if anything has changed or why we would be getting this? I can't find any reference for the jtoken parameter. Our code hasn't changed.

Thanks.

Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
9,629 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,065 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Jenkins 55 Reputation points
    2023-07-11T16:33:43.4066667+00:00

    Our code makes a curl request. It's worked for years and then suddenly stopped. I added the following header to the request and it started working again:

    Content-Type: application/json

    11 people found this answer helpful.

  2. Ran Hou-MSFT 7,495 Reputation points Microsoft Vendor
    2023-07-11T06:05:13.89+00:00

    @Jenkins

    Based on your description, this problem is related to Teams script development, which we do not support. So we will add Microsoft Teams development tag to your thread.

    Thanks for your understanding and patience!


    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.


    0 comments No comments