Testing Webhook - domain does not matter

Hai Gatenyo 20 Reputation points
2024-06-05T15:16:41.7433333+00:00

Hi,

I am testing a connection to a Webhook I have connected to a Teams channel I have created.

I get the URL with my domain and send a message and get it. All is well.

My question is why when I write anything in my domain, it still works. Shouldn't the domain matter?

If I change even one letter in the generated paths it does not work, as expected, but in the part "icanwriteanything", I can literally write anything and it will still work.

I hope someone can shed some light on this matter, because I think it should not work. Maybe I missed something in the documentation.

Thank you.

https://icanwriteanything.webhook.office.com/webhookb2/generatedPath/IncomingWebhook/moreGeneratedPath/evenMoreGeneratedPath

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

Accepted answer
  1. Prasad-MSFT 5,896 Reputation points Microsoft Vendor
    2024-06-06T11:07:00.4566667+00:00

    The behavior you are experiencing with the webhook URL is due to the wildcard domain feature that Microsoft Teams supports for webhook URLs. This feature allows you to have flexibility in the subdomain part of the URL while ensuring that the main domain remains the same.

    When you mention that you can write anything in the subdomain part of the URL (e.g., "icanwriteanything"), and it still works, it is because Microsoft Teams validates the main domain (in this case, "webhook.office.com") and allows flexibility in the subdomain part. This behavior is intentional and designed to provide developers with some level of flexibility while maintaining security standards.

    Thanks, 

    Prasad Das

    ************************************************************************* 

    If the response is helpful, please click "Accept Answer" and upvote it. You can share your feedback via Microsoft Teams Developer Feedback link. Click here to escalate.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful