I'm using MS Teams bot and Webex teams bot, I have some Adaptive-Card buttons on my bot message and I want to know which Adaptive Card button is pressed, by wrting it as a user message.
In MS Teams I can do that:
{
"type": "Action.Submit",
"title": "Click me for imBack",
"data": {
"msteams": {
"type": "imBack",
"value": "Text to reply in chat"
}
}
}
How can I do it in webex? I cannot find any documentaion talking about it
You can make use of the Bot Builder Community Webex Adapter. There is also a sample that shows how to use it (C# linked).
Related
We have a Teams bot installed for internal company use and it is capable of sending files to our users. Our application that handles the bot does not receive the file consent allow activity but decline activity is working fine , as said in the documentation we have implemented it .
will you pls help me out with the issue .
I'm using the proper documentation of Microsoft teams passing these values but not getting the result.
attachments": [{
"contentType": "application/vnd.microsoft.teams.card.file.consent",
"name": "result.txt",
"content": {
"description": "Text recognized from image",
"sizeInBytes": 4348,
"acceptContext": {
"resultId": "1a1e318d-8496-471b-9612-720ee4b1b592"
},
"declineContext": {
"resultId": "1a1e318d-8496-471b-9612-720ee4b1b592"
}
}
}]
This morning we started getting the standard bot error message in MS teams desktop client when using a card with toggleVisbility actions. Selecting the button to toggle visbility on part of the card results in the below error, even though the toggle works as expected!
bot error message
The adaptive card code looks something like this:
{
"type": "ActionSet",
"actions": [
{
"type": "Action.ToggleVisibility",
"title": "Alerts",
"targetElements": [
"Incidents",
{
"elementId": "Metrics",
"isVisible": false
},
{
"elementId": "Admin",
"isVisible": false
}
]
},
{
"type": "Action.ToggleVisibility",
"title": "Actions",
"targetElements": [
"ActionButton"
]
}
]
}
This message would be expected if the bot app doesn't respond to a message/action, however the toggle action shouldn't be sending any data to the bot applicaiton. I confirmed this in the teams web client using the network tracing dev tool. When selecting the toggle action no new network calls are made.
We are not seeing this error in either the web client or the mobile client, only in Teams Desktop app.
This bot has been running for months without this issue and we didn't change the code, which makes me believe this is a MS teams side bug that was recently introduced.
Also: This same issue was independently identified in the Adaptive Cards Project.
https://github.com/microsoft/AdaptiveCards/issues/8145
We are trying out messaging extensions capability in our Microsoft Teams App that has a command which fetch dynamic set of parameters from the bot when invoked from the compose box.
When the user clicks the messaging extension our app receives payload type 'invoke' and name as 'composeExtension/fetchTask'
Our app process the data and in return it responds with a Adaptive card in task with 'type':'continue' and the Adaptive card is having a link to open URL as below
"task": {
"type": "continue",
"value": {
"card": {
"contentType": "application/vnd.microsoft.card.adaptive",
"content": {
"type": "AdaptiveCard",
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.2",
"body": [{
"type": "ActionSet",
"actions": [{
"type": "Action.OpenUrl",
"title": "Open Facebook",
"url": <URL to open Facebook>
}],
}
]
}
}
}
}
MSTeams shows this card in a task module popup window. When the User click the Action button it open the Facebook page in a new browser tab but the task module popup window is not closed.
Is there anyway to close the task module popup window when the user clicks the Action button ?
Note : We are not using Bot Framework SDK and Microsoft Teams Javascript client SDK.
The only way I know of to do two things on one user action is by using a web based task module.
Do some simple layout with a button. In the click handler use window.open(, "_blank") and when that completes call the microsoftTeams.tasks.submitTask(...) method of the javascript SDK.
this might be late.
But the documentation is wrong try to call the submitTask(data) twice once with data and once without any params submitTask() to close the taskmodule.
I have a web app where if a user signs up, a notification is sent to the slack channel. I want to achieve the same thing in Microsoft team but I cant find any good resources. When a new user signs up, a message will be posted into the microsoft team group.Will it be possible to do this?
This can be easily achieved in Microsoft Teams using Connectors.
Here are the steps to post data to any channel:
In Microsoft Teams, choose the More options (⋯) button next to the
channel name in the list of channels and then choose Connectors.
Add an Incoming webhook and copy the webhook URL.
You can post Message Card given below to this URL using
Postman/Fiddler/Code.
{
"summary": "Alert!",
"themeColor": "0078D7",
"sections": [
{
"activityTitle": "Web app event",
"text": "Something happened in the web app!"
}],
"potentialAction": [
{
"#type": "OpenUri",
"name": "View event",
"targets": [
{ "os": "default", "uri": "http://mywebapp.com/path/to/event" }]
}]
}
You can also Build your own Connector with custom configurations.
We want to build a BoT and want to target 3 channels Webchat, Teams and Email. For these channels can we capture the logged in user.
Don’t think we can do in Web Chat channel.
In teams -- can we capture the email id of the logged in user chatting with BoT?
in email channel -- can we capture the sender email id who has emailed to our BoT?
any sample code?
The IDs are included in the JSON sent to your bot when it receives a message (see "From"). Here is an example (from an email received by a bot):
{
"type": "message",
"id": "AAMkAD....",
"timestamp": "2017-01-09T21:18:06.113698Z",
"serviceUrl": "https://email.azurewebsites.net/",
"channelId": "email",
"from": {
"id": "**EMAIL HERE**",
"name": "**USER NAME HERE**"
},