Closing a teams messaging extension modal from an external service

Viewed 212

I'm opening (using OpenUrl) an external webpage I control. During loading of this web page, from the server I wish to close the teams modal either directly, or by invoking the teams client to resend message with a parameter, so the bot can respond with a close response (which I have working).

I'm able to do other tasks from an external service, like posting messages to existing or new chats. But when I try to set the activity type to invoke, I get BadRequest response.

1 Answers

Task Module modal dialog can be closed using microsoftTeams.tasks.submitTask() which is part of Microsoft Teams JavaScript client SDK. This will closed the Task Module and submit the data back to Bot.

Please take a look at Task Module sample to see how it's called from client code.

Related