Send Notification to user using delegated permissions

Copper Contributor

Hi,

 

I am trying to find a solution here.

I am using MS 365 Graph API's to allow users trigger a group chat from a Web Application and start collaborating and i am linking this Chat ID to a transaction to show the messages if they click on that transaction in my web app.

Issue is ... it is only pulling the messages for the people that are part of the group chat. 

I would like to show the messages to the person who is not part of the group .

As of now it is throwing the error as Insufficient privileges chat with ID not found which is obvious .

Is there a way to trigger a notification via Graph API to the member of the group or auto add the person to the group via graph API so that he can be the member of the group and view the chat history.

 

Thanks,

Abhinay  

7 Replies

@Abhi1222 - Messages in group chat will be visible to the group members hence you are getting the error. Unfortunately, Microsoft Graph API does not provide a direct way to trigger a notification to a person who is not a member of the group chat. However, you can add a user to the group chat using Graph API. 

 

Please refer this example to Add a single member to a Microsoft Teams chat, sharing the whole history of the chat - https://learn.microsoft.com/en-us/graph/api/chat-post-members?view=graph-rest-1.0&tabs=http#example-....

@Meghana-MSFT 

As i mentioned in my post .. i am already adding a member to a conversation as per the link you suggested. 

But i would like to notify member/members of that chat group that someone who is not part of conversation is trying to access the chat so the member of the chat can add the person. 

I see few options like EventHubs / Webhooks etc .. should try and see how those can help .

You can use webhooks but those work in channel scope only. You can use webhook notifications if your users are part of a teams channel and not group chat.
If we know the userId can't we notify them as an activity feed or something ?
https://www.youtube.com/watch?v=8a2fZ_wCgAk&list=TLPQMTkwMjIwMjRGJO_Ek3iNwQ&index=2
I came across this for now which i am trying to first see if it fits my use case.
Hi Chetan ,
i tried lot of different options outside Microsoft solutions but looks like i have to pretty much follow what microsoft is suggesting ..
But the link you suggested ...looks like it is documented for Application level Permissions .. Do you think it will be same for delegated permissions as well ?
I am also trying to look for an option to perform live rendering of messages in a web application.
This works for application permissions only.