Error Encountered with Teams Incoming Webhook: Missing CreatedByObjectId

Tianen Xiang (Wicresoft North America Ltd) 20 Reputation points Microsoft Vendor
2024-12-27T07:16:21.0266667+00:00

While testing a Teams incoming webhook URL, the following error occurs despite receiving a status code of 200:

System.ArgumentNullException: Value cannot be null. (Parameter 'CreatedByObjectId cannot be null or empty')

This parameter was not an issue last week. Is there documentation available that explains this API?

import requests
import json

url = "Webhook URL" 

data = {
    "message": "Hello, this is a test message!",
    "summary": "test summary",
    "text": "test text from example_post.py",
}

headers = {
    "Content-Type": "application/json"  # Ensure it is set to send JSON data
}

response = requests.post(url, data=json.dumps(data), headers=headers)

if response.status_code == 200:
    print("Response status code:", response.status_code)
    print("Response text:", response.text)
else:
    print("Response status code:", response.status_code)
Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
10,678 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,483 questions
{count} votes

Accepted answer
  1. Robin Sheng-MSFT 5,525 Reputation points Microsoft Vendor
    2024-12-30T02:44:22.91+00:00

    Hi @Tianen Xiang (Wicresoft North America Ltd)

    We are glad to know that the issue has been resolved.

    • Recreate the webhook: It looks like recreating a new webhook URL fixed the issue.
    • Use the Teams web app: If you encounter the issue in the desktop app, you can try using the Teams web app to configure the webhook.

    If you wish, you can mark the summary for your reference in case you encounter the same issue in the future. In addition, this will also benefit other community members.

    In the meantime, are you willing to monitor the issue for another week in case the issue occurs again?

    Of course, if there is anything else we can do for you, please feel free to contact us.


    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.


    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

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.