Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a channel message, then reply to the message #40

Open
LarsFosdal opened this issue Jun 29, 2021 · 2 comments
Open

Create a channel message, then reply to the message #40

LarsFosdal opened this issue Jun 29, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@LarsFosdal
Copy link

Creating channel messages is awesome, but I find myself wishing that I would be able to reply to the initial message.

Scenario
I am running a time-consuming script that updates several sites.

I'd like to first publish a message saying that "Update so and so is has started."
Then, for each site that is processed, I'd like to reply to that message with a summary for that site.
Finally, I'd finish off with a Upgrade completed message.

How do I identify a message?
How to I reply to a message?

@PrzemyslawKlys
Copy link
Member

Short answer: You can't do that with incoming webhooks
Long answer: Probably can be done with Teams Graph Api as mentioned here: #17

I have plans on exploring Teams Graph API and potentially supporting it in 3.0 but I have so many projects right now that are a priority for me - so can't promise any timelines.

@PrzemyslawKlys PrzemyslawKlys added the enhancement New feature or request label Jun 29, 2021
@codaamok
Copy link

codaamok commented Aug 29, 2023

Replying to an existing message in Teams using Microsoft Graph API is possible but not really available using non-interactive authentication flows.

The application permission to use the API endpoint requires Teamwork.Migrate.All and has the following caveat:

Note: Application permissions are only supported for migration. In the future, Microsoft may require you or your customers to pay additional fees based on the amount of data imported.

First, the permission Teamwork.Migrate.All has so much reach, here is its description from the Azure portal:

Allows the app to create chat and channel messages, without a signed in user. The app specifies which user appears as the sender, and can backdate the message to appear as if it was sent long ago. The messages can be sent to any chat or channel in the organization.

Secondly, even if you were bat shit crazy enough to permit this, it's actually only operable on a Team set in migration mode (see the link above.)

Place the new team in migration mode, a special state that restricts users from most activities within the team until the migration process is complete.

I believe this endpoint and permission only really exists for non-interactive flows for products/services which let you migrate from e.g. Slack to Teams, to preserve/migrate chat history etc. Microsoft don't really provide a way via Graph API to expose this type of functionality in Teams. However, it seems to be possible relatively painlessly using delegated permissions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants