Hi, we are facing a similar problem, did you find any solution to this yet?
We want to send same message from some person's account to multiple users as personal chat. We proposed using GraphAPI to solve the problem, authentication isn't our concern right now.
But now we are at a dead-end due to throttle limits of the api.
Throttling at 2rps will be very bad. Can anyone help us to get around this problem, is it possible to increase this limit (or use a paid plan), if i use json batching, will this limit apply.
If the Graph api limit still applies, then we will have to look at solution using bots.
WebApp that sends messages to MS Teams channel; Channel picker at WebApp side
We would like to implement a simple integration so that our webapp can send messages to specified team+channel of our users.
- After the user authorizes, he can choose/change the target team+channel through our app
- even non-admin user can install it
- (nice-to-have) Displayed sender of the messages should be our FooApp, not the authorized user.
See below for UI workflow.
What is your recommended way of implementing the simple use-case above?
We've tried multiple solutions but always ended up in a dead end. Any help would be really appreciated...
Just for reference, here's what we've tried:
- Auth code flow and user delegated permissions
- result is an ACCESS_TOKEN with 1 hour expiration (not worth storing) or, if we replace the node-msal library with manual implementation, we get REFRESH_TOKEN... We're not sure about its validity, but some of your Doc pages sources suggest it should be 14 days?
- We don't want to refresh the token for all our registrations every 14 days... or is it really necessary?
- CON (low priority): Sender of the messages is the registered user
- Authorize with application permissions (client_credentials)
- don't store ACCESS_TOKEN nor REFRESH_TOKEN on our app's side but rather only store tenantId.
- we were able to fetch teams and channels thus
- messages cannot be sent with application permissions
- CON: only admin can install these
- CON: for some reason, normal user cannot login even if the Admin has already granted permissions to our app
- we need the normal user login because we need to find out the tenantId of the user
- Webhooks or MS Teams connector that simply shows webhook URL our app Name + Logo
- bad UX
- user cannot select the team+channel directly in our app
- manual copying of URL
- you need to install it for each channel separately
- Create a bot
- we don't know how to fetch the list of teams/channels in our app - we run into the issues mentioned in variants 1 and 2 above
- 1 - requires refresh token refreshing and reimplementation of node-msal
- 2 - cannot be installed by a non-admin user
- we're currently investigating this option
- CON: It is paid for the amount of messages we need
- CON: Seems like an overkill for simple non-interactive messages.
- we don't know how to fetch the list of teams/channels in our app - we run into the issues mentioned in variants 1 and 2 above
2 answers
Sort by: Most helpful
-
Harshit Kedia 6 Reputation points
2021-06-09T11:58:11.987+00:00 -
Mamatha-MSFT 161 Reputation points
2021-06-04T04:48:53.64+00:00 Hi @Jan Hrdina - You can fetch list of joined teams using graph API.
GET https://graph.microsoft.com/v1.0/me/joinedTeams
request and you can get list of channels in teams using
GET https://graph.microsoft.com/v1.0/teams/{team-id}/channels
requestTo send messages to a channel using graph for multi tenant, you need to register the application as a multi tenant,
Or if you want to use it for personal account users then choose the option accordingly while registering the application.
Please go through the documentation of register an application with the Microsoft identity platform.