10-20-2021 10:47 AM
I am looking into the Microsoft Graph API to send notification messages via a Microsoft Teams Channel to notify users that some action has taken place, send a warning, etc. instead of using email to send those messages or to get away from the Notification Bubble (think Outlook message notifications in the lower right hand corner) to make the notifications more real-time and users/supervisors/interested parties can take action quicker.
Before I dig too deep into the API, I was wondering if anyone has information to share. If not, I'll share my findings here.
10-21-2021 04:42 AM
Nice Eric,
Waiting to see your findings
10-21-2021 07:30 AM - edited 10-21-2021 07:33 AM
Glad to see someone is awaiting my findings. 🤣
With that said, on the VERY little research I have done so far, it looks like you'll have to register the app but that's about as far as I have gotten. There was something about a AccessToken but I haven't dug into that yet. I am not sure if it is just limited to Microsoft apps (VB.NET, C#.NET, .NET Core or Framework, etc) or external ones like ours.
Oh, I almost forgot - I also read that developers can use the REST APIs to interact with 365 aps (HTTP VIs come to mind to interact with that are supplied with LabVIEW) but it reads like it has it's own interface which MS recommends.
That's it for now. Hopefully, I'll be able to dedicate some more time to this and give a much more detailed answer.
Eric
10-21-2021 07:36 AM
I have done similar kind of approach in Accessing Google Sheets, If something similar i can support as much as possible.
I can able to access Google Sheets for Writing and reading data same as excel
10-22-2021 03:12 PM - edited 10-22-2021 03:15 PM
I found some more information. Based on what I have read, you need to register your app via the Azure Acitve Directory in the Azure Portal. It looks like it's any app and not limited to MS products like I had eluded to before. Unfortunately for my company, we haven't made that jump yet even though we are heavily ingrained in the Microsoft 365 products and services. Either that, or I have not been granted access yet to the Azure AD.
I have not found a way to programmatically work directly with Teams yet or even if you can.
10-26-2021 02:44 PM - edited 10-26-2021 02:48 PM
I believe I have a solution on how to send notifications to Teams...and it doesn't even involve Microsoft Graph.
In each team channel, you should be able to get the email address for the channel you want to send notifications to. If I wanted to send one to my Water Cooler Team - General Channel, all I need to do is single-click on the ellipsis and then click Get Email Address.
This should reveal the email address that should look something like this...
Channel - Team Name <TheToAddress@amer.teams.ms>
Then, just use the provided SMTP VIs to send what notification you'd need to send and it should appear like this.
That's it!
I'll admit, I was pretty dumbfounded how easy this was. I didn't even think about this until I was discussing this with my coworker about not having access to the Azure AD portion of the Azure Portal and he just casually mentions "Why don't you just send an email to the Teams address?" 😫
Hope this helps someone else.
10-26-2021 06:01 PM
@Eric1977 wrote:
I believe I have a solution on how to send notifications to Teams...and it doesn't even involve Microsoft Graph.
In each team channel, you should be able to get the email address for the channel you want to send notifications to. If I wanted to send one to my Water Cooler Team - General Channel, all I need to do is single-click on the ellipsis and then click Get Email Address.
This should reveal the email address that should look something like this...
Channel - Team Name <TheToAddress@amer.teams.ms>
Then, just use the provided SMTP VIs to send what notification you'd need to send and it should appear like this.
That's it!
I'll admit, I was pretty dumbfounded how easy this was. I didn't even think about this until I was discussing this with my coworker about not having access to the Azure AD portion of the Azure Portal and he just casually mentions "Why don't you just send an email to the Teams address?" 😫
Hope this helps someone else.
Sometimes it's like that. You open and close your mouth a few times, then just sputter, "Great idea! Why didn't I think of that?"