azuremicrosoft-graph-apimicrosoft-graph-teamsazure-subscription

How create a subscription for teams chat messages?


I'm trying to create a subscription to receive notifications about user messages, but I'm receiving an ExtensionError. I'm basing myself on Team chats

I've tried to create a subscription with the sample code I've found on Microsoft but I received an error. My expectation is to create a subscription to capture all chat messages on Teams.

Permissions Granted: Permissions

My body:

{
    "changeType": "created",
    "notificationUrl": "https://teams.execute-api.us-east-1.amazonaws.com/dev/notification-listener",
    "lifecycleNotificationUrl": "https://teams.execute-api.us-east-1.amazonaws.com/dev/lifecycle-notification-listener",
    "resource": "/me/chats",
    "expirationDateTime": "2024-12-05T22:00:00Z",
    "clientState": "secretClientState",
    "latestSupportedTlsVersion": "v1_2"
}

The error I'm receiving:

Internal Server Error - 500 - 5157 ms

{
    "error": {
        "code": "ExtensionError",
        "message": "Operation: Create; Exception: [Specified method is not supported.]",
        "innerError": {
            "date": "2024-12-02T18:44:12",
            "request-id": "7f6ebfd6-dad6-41ec-8c88-1c48478f230d",
            "client-request-id": "a3497e47-55a0-dae8-1bc6-0500c1dc4df1"
        }
    }
}

Request

My Lambda


Solution

  • To make the subscription, your account must be a tenant other than 'Personal'.