Share via

chat subscription/notification not working

Tsai Yunda 0 Reputation points
2025-01-26T22:30:41.9433333+00:00

Describe the bug

I followed this document https://learn.microsoft.com/en-us/graph/teams-changenotifications-chatmessage#subscribe-to-changes-at-the-user-level

and created a subscription with '/users/{user-id}/chats/getAllMessages' as resource. The subscription is created successfully and and can see it with a running status and a valid expiration date. However, i cannot recieve notification when new chat message arrives. I can recieve one message once in a while (several hours) but most of the notification did not send to me.

Expected behavior

I can receive all message notifications that are send to a user.

How to reproduce

I followed this document https://learn.microsoft.com/en-us/graph/teams-changenotifications-chatmessage#subscribe-to-changes-at-the-user-level

and created a subscription with '/users/{user-id}/chats/getAllMessages' as resource. The subscription is created successfully and and can see it with a running status and a valid expiration date. However, i cannot recieve notification when new chat message arrives. I can recieve one message once in a while (several hours) but most of the notification did not send to me.

Microsoft Security | Microsoft Graph
0 comments No comments

2 answers

Sort by: Most helpful
  1. Ward Wilmsen 0 Reputation points
    2025-02-17T22:18:02.69+00:00

    I'm facing the exact same issue here, I worked with Graph subscriptions quite a lot for Exchange resources (tasks, mails, ...). They all work fine.

    But the /users/{user-id}/chats/getAllMessages endpoint via a subscription doesn't return me any notification events when sending or receiving messages via a Teams chat on a subscribed user.

    Was this answer helpful?

    0 comments No comments

  2. Saranya Madhu-MSFT 2,375 Reputation points Microsoft External Staff
    2025-01-27T06:35:47.5433333+00:00

    Hi Tsai Yunda ,

    Thanks for reaching out to Microsoft!

    As per Microsoft documentation, verify the authenticity of each change notification before running business logic based on resource data included in change notifications.

    A change notification with resource data contains an extra property, validationTokens, which contains an array of JSON Web Tokens (JWT) generated by Microsoft Graph. Therefore, the validationTokens  need to be validated.

    Reference on service limits:

    https://learn.microsoft.com/en-us/graph/throttling-limits#microsoft-teams-service-limits

    Note: APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.

    Hope this helps.

    If the answer is helpful, please click Accept Answer and kindly upvote. If you have any further questions about this answer, please click Comment.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.