skip to Main Content

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

2

Answers


  1. Chosen as BEST ANSWER

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


  2. Initially, I created one Partner configuration for Sri resource group by authorizing Microsoft Graph API to create resources like this:

    enter image description here

    In my case, I ran below API request in Graph Explorer to create subscription for capturing all chat messages of user on Teams:

    POST https://graph.microsoft.com/v1.0/subscriptions
    
    {
        "changeType": "created",
        "notificationUrl": "EventGrid:?azuresubscriptionid=subId&resourcegroup=rgname&partnertopic=TeamsTopic&location=eastus",
        "lifecycleNotificationUrl": "EventGrid:?azuresubscriptionid=subId&resourcegroup=rgname&partnertopic=TeamsTopic&location=eastus",
        "resource": "/me/chats",
        "expirationDateTime": "2024-12-02T22:00:00Z",
        "clientState": "secretClientState",
        "latestSupportedTlsVersion": "v1_2"
    }
    

    Response:

    enter image description here

    Make sure to grant consent to Chat.Read permission for signed-in user in Graph Explorer before running the Graph API query:

    enter image description here

    To confirm that, I checked the same in Portal where Partner Topic created successfully as below:

    enter image description here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search