Share via

Subscribe to chatMessage using onlineMeeting.chatInfo.threadId

Tiana Lemesle 11 Reputation points
2022-03-16T15:13:42.763+00:00

Hello,

The following request : GET https://graph.microsoft.com/v1.0/me/onlineMeetings/ {id}

Returns an onlineMeeting object that provides a chatInfo.threadId property, which value looks like 19:meeting_ {id} @thread.v2.

Could it be used to subscribe a webhook on chatMessage objects creation ?

I'm wondering if I could use POST https://graph.microsoft.com/v1.0/subscriptions with /teams/ {???} /channels/ {threadId} /messages as resource value but I can't figure out what value to use at {???}, I tried participants.organizer.identity.tenantId but I get the "No team found with Group Id" error so I guess that's not the right value.

Thanks

Community Center | Not monitored
0 comments No comments

1 answer

Sort by: Most helpful
  1. ShivaniRai-MSFT-7217 2,751 Reputation points
    2022-03-16T16:11:26.507+00:00

    Hi @Tiana Lemesle ,

    If you use this resource (/teams/{team-id}/channels/{channel-id}/messages) for subscription creation then it will notify for a particular teams channel messages. You can get the team-id by using this Graph API Endpoint https://graph.microsoft.com/v1.0/me/joinedTeams. Refer below example screenshot from Graph Explorer on how to get team-id:

    183788-image.png

    Similarly, to get the channel-Id use this Graph API Endpoint https://graph.microsoft.com/v1.0/teams/{team-Id}/channels

    In addition to that if you want to subscribe to chat messages which is not associated with any particular team please use this as resource (/chats/{id}/messages). Here {id} is chatInfo.threadId

    For more details refer this MS Documentation: https://learn.microsoft.com/en-us/graph/api/subscription-post-subscriptions?view=graph-rest-1.0&tabs=http#permissions

    Hope this helps.

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

    Was this answer helpful?

    1 person found this answer helpful.

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.