Comments (14)
Appreciate if any update on this.
from botbuilder-v3.
Hi @rrc2k4
How are you loading and sending this card?
I removed the first level of json from what you've posted above:
{
"@type": "MessageCard",
"@context": "http://schema.org/extensions",
"title": "Incident Updated - INC0010010",
"summary": "Incident Updated - INC0010010",
"themeColor": "D1222B",
"sections": [
{
"title": "",
"text": "",
"activityTitle": "",
"activitySubtitle": "",
"activityText": "",
"facts": [
{
"name": "Category",
"value": "Software"
},
{
"name": "State",
"value": "New"
},
{
"name": "Priority",
"value": "5 - Planning"
},
{
"name": "Assignment group",
"value": "Software"
}
]
},
{
"text": "Please check the details"
}
],
"potentialAction": [
{
"@type": "OpenUri",
"name": "View Incident in ServiceNow",
"targets": [
{
"os": "default",
"uri": "https://dev62584.service-now.com/incident.do?sys_id=XXXXXXX&sysparm_stack=incident_list.do?sysparm_query=active=true"
},
{
"os": "iOS",
"uri": "https://dev62584.service-now.com/incident.do?sys_id=XXXXXXX&sysparm_stack=incident_list.do?sysparm_query=active=true"
},
{
"os": "android",
"uri": "https://dev62584.service-now.com/incident.do?sys_id=XXXXXXX&sysparm_stack=incident_list.do?sysparm_query=active=true"
},
{
"os": "windows",
"uri": "https://dev62584.service-now.com/incident.do?sys_id=XXXXXXX&sysparm_stack=incident_list.do?sysparm_query=active=true"
}
]
}
]
}
And load/send the card with this code:
var sPath = System.Web.Hosting.HostingEnvironment.MapPath("/Resources/o365Card.json");
var adaptiveCardJson = File.ReadAllText(sPath);
var cardAttachment = new Attachment()
{
ContentType = "application/vnd.microsoft.teams.card.o365connector",
Content = JsonConvert.DeserializeObject(adaptiveCardJson),
};
var reply = activity.CreateReply();
reply.Attachments.Add(cardAttachment);
await context.PostAsync(reply);
Using the following packages:
<package id="Microsoft.Bot.Builder" version="3.30.0" targetFramework="net46" />
<package id="Microsoft.Bot.Builder.Azure" version="3.16.3.40383" targetFramework="net46" />
<package id="Microsoft.Bot.Builder.History" version="3.30.0" targetFramework="net46" />
<package id="Microsoft.Bot.Connector" version="3.30.0" targetFramework="net46" />
<package id="Microsoft.Bot.Connector.Teams" version="0.10.0" targetFramework="net46" />
from botbuilder-v3.
Hi Eric,
Apologies for mislead on payload content.
I tried with the above code and mentioned packages but unable to see any button in the card,
<package id="Microsoft.Bot.Builder" version="3.30.0" targetFramework="net46" /> <package id="Microsoft.Bot.Builder.Azure" version="3.16.3.40383" targetFramework="net46" /> <package id="Microsoft.Bot.Builder.History" version="3.30.0" targetFramework="net46" /> <package id="Microsoft.Bot.Connector" version="3.30.0" targetFramework="net46" /> <package id="Microsoft.Bot.Connector.Teams" version="0.10.0" targetFramework="net46" />
from botbuilder-v3.
Which teams client are you using?
Can you share your teams manifest?
from botbuilder-v3.
Microsoft Teams Version 1.3.00.13565 (64-bit). It was last updated on 5/29/20.
Hope you are referring bot manifest file. We haven't published our bot yet on MSTeams. We are still in development phase and below is the manifest file for that bot(altered company specific & bot identity information).
{ "$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.7/MicrosoftTeams.schema.json", "manifestVersion": "1.7", "version": "1.0.0", "showLoadingIndicator": true, "id": "XXXXX", "packageName": "XXX.teams.com", "developer": { "name": "XXXX", "websiteUrl": "XXXXXX", "privacyUrl": "XXXXX", "termsOfUseUrl": "XXXXXXXX" }, "icons": { "color": "color.png", "outline": "outline.png" }, "name": { "short": "XXXX Chatbot", "full": " XXXX Chatbot" }, "description": { "short": "sample chat bot ", "full": "test chat bot for msteams integration" }, "accentColor": "#FFFFFF", "staticTabs": [ { "entityId": "XXX", "name": "XXXX", "contentUrl": "https://bing.com", "websiteUrl": "https://bing.com", "scopes": [ "personal" ] } ], "bots": [ { "botId": "XXXXXXXXXXX", "scopes": [ "personal" ], "supportsFiles": true, "isNotificationOnly": false } ], "permissions": [ "identity", "messageTeamMembers" ], "validDomains": [ "bing.com", "token.botframework.com", "*.service-now.com", "technology.genpact.com" ], "devicePermissions": [ "openExternal" ] }
from botbuilder-v3.
Is this a windows os? Does this happen for all users of the bot?
Sorry, but nothing stands out and i cannot repeat this issue. It must be something specific to your environment or bot. Can you share more of the code?
from botbuilder-v3.
Yes, everything is on Windows OS, clients and server/webservices. And it happens to all the users( we currently have 3 users in development). We checked the same functionality in MSTeams web & windows clients both doesn't display "button".
Suspecting environment issue, we even tried in our lab network where we dont have any company proxy policies but still same issue. Suspecting domain permissions in MSTeams app, we even added our source url (www.dev62584.service-now.com) in valid domains and tested but no luck.
Source Code is same what you had shared, no changes in code and payload. Even degraded/upgraded required packages as per your suggestions but no success.
Let me build a sample echo bot from scratch and with mentioned packages and let you know the results.
from botbuilder-v3.
Hi Eric,
I had built a sample echo bot with mentioned packages and code but still dont see buttons in the card. Same JSON payload when triggered through MSTeams incoming webhooks works fine. able to see buttons in the card thru webhooks but not from bot messages.
.net framework: 4.6
Bot SDK:V3
EchoDialog.CS code:
`using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Microsoft.Bot.Builder.Dialogs;
using Microsoft.Bot.Connector;
using Microsoft.Bot.Connector.Teams;
using System.Threading.Tasks;
using System.Threading;
using System.Net.Http;
using System.Net.Http.Headers;
using AdaptiveCards;
using Microsoft.Bot.Connector.Teams.Models;
using System.IO;
using Newtonsoft.Json;
[Serializable]
public class EchoDialog : IDialog<object>
{
protected int count = 1;
public async Task StartAsync(IDialogContext context)
{
await context.PostAsync("Hello User, I am bot. Your virtual assistant.");
context.Wait(MessageReceivedAsync);
}
public virtual async Task MessageReceivedAsync(IDialogContext context, IAwaitable<IMessageActivity> argument)
{
var message = await argument;
if (message.Text == "reset")
{
PromptOptions<string> objPrompt = new PromptOptions<string>("Are you sure you want to reset the count?",
"Didn't get that!", "Sorry, you had exceeded max. attempts", null,
1, promptStyler: new PromptStyler(PromptStyle.Inline));
PromptDialog.Confirm(context, AfterResetAsync, objPrompt);
return;
}
else if (message.Text == "messagecard")
{
var sPath = System.Web.Hosting.HostingEnvironment.ApplicationPhysicalPath + @"App_Data\SNOWCard.json";
var adaptiveCardJson = File.ReadAllText(sPath);
var cardAttachment = new Attachment()
{
ContentType = "application/vnd.microsoft.teams.card.o365connector",
Content = JsonConvert.DeserializeObject(adaptiveCardJson),
};
var reply = context.MakeMessage();
reply.Attachments.Add(cardAttachment);
await context.PostAsync(reply);
}
else
{
if (!string.IsNullOrEmpty(message.Text))
await context.PostAsync($"{this.count++}: **You said** {message.Text}");
else if (!string.IsNullOrEmpty(ClsGeneric.GetObjectValue(message.Value)))
{
await context.PostAsync("Received this JSON:" + ClsGeneric.GetObjectValue(message.Value));
}
if (message.Attachments != null && message.Attachments.Any())
{
var attachment = message.Attachments.First();
await context.PostAsync($"Attachment of {attachment.ContentType} type and size of bytes received.");
}
context.Wait(MessageReceivedAsync);
}
}
public async Task AfterResetAsync(IDialogContext context, IAwaitable<bool> argument)
{
try
{
var confirm = await argument;
if (confirm)
{
this.count = 1;
await context.PostAsync("Reset count.");
}
else
{
await context.PostAsync("Did not reset count.");
}
}
catch (TooManyAttemptsException)
{
await context.PostAsync("you had exceeded max. attempts, please try again..");
}
context.Wait(MessageReceivedAsync);
}
}
`
JSON Payload is same as the one which you had mentioned above.
from botbuilder-v3.
Packages Info:
<packages>
<package id="AdaptiveCards" version="1.2.4" targetFramework="net46" />
<package id="Autofac" version="3.5.2" targetFramework="net46" />
<package id="Chronic.Signed" version="0.3.2" targetFramework="net46" />
<package id="EntityFramework" version="6.1.3" targetFramework="net46" />
<package id="Microsoft.AspNet.WebApi" version="5.2.7" targetFramework="net46" />
<package id="Microsoft.AspNet.WebApi.Client" version="5.2.7" targetFramework="net46" />
<package id="Microsoft.AspNet.WebApi.Core" version="5.2.7" targetFramework="net46" />
<package id="Microsoft.AspNet.WebApi.WebHost" version="5.2.7" targetFramework="net46" />
<package id="Microsoft.Azure.DocumentDB" version="2.4.1" targetFramework="net46" />
<package id="Microsoft.Azure.KeyVault.Core" version="1.0.0" targetFramework="net46" />
<package id="Microsoft.Bot.Builder" version="3.30.0" targetFramework="net46" />
<package id="Microsoft.Bot.Builder.Azure" version="3.16.3.40383" targetFramework="net46" />
<package id="Microsoft.Bot.Builder.History" version="3.16.1.38846" targetFramework="net46" />
<package id="Microsoft.Bot.Connector" version="3.30.0" targetFramework="net46" />
<package id="Microsoft.Bot.Connector.Teams" version="0.10.0" targetFramework="net46" />
<package id="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" version="3.6.0" targetFramework="net46" />
<package id="Microsoft.CSharp" version="4.5.0" targetFramework="net46" />
<package id="Microsoft.Data.Edm" version="5.7.0" targetFramework="net46" />
<package id="Microsoft.Data.OData" version="5.7.0" targetFramework="net46" />
<package id="Microsoft.Data.Services.Client" version="5.7.0" targetFramework="net46" />
<package id="Microsoft.IdentityModel.Clients.ActiveDirectory" version="4.4.0" targetFramework="net46" />
<package id="Microsoft.IdentityModel.Logging" version="1.1.4" targetFramework="net46" />
<package id="Microsoft.IdentityModel.Protocol.Extensions" version="1.0.4.403061554" targetFramework="net46" />
<package id="Microsoft.IdentityModel.Protocols" version="2.1.4" targetFramework="net46" />
<package id="Microsoft.IdentityModel.Protocols.OpenIdConnect" version="2.1.4" targetFramework="net46" />
<package id="Microsoft.IdentityModel.Tokens" version="5.1.4" targetFramework="net46" />
<package id="Microsoft.Rest.ClientRuntime" version="2.3.2" targetFramework="net46" />
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="net46" />
<package id="Polly-Signed" version="5.3.1" targetFramework="net46" />
<package id="System.IdentityModel.Tokens.Jwt" version="5.1.4" targetFramework="net46" />
<package id="System.Net.Http" version="4.3.4" targetFramework="net46" />
<package id="System.Security.Cryptography.Algorithms" version="4.3.0" targetFramework="net46" />
<package id="System.Security.Cryptography.Encoding" version="4.3.0" targetFramework="net46" />
<package id="System.Security.Cryptography.Primitives" version="4.3.0" targetFramework="net46" />
<package id="System.Security.Cryptography.X509Certificates" version="4.3.0" targetFramework="net46" />
<package id="System.Spatial" version="5.7.0" targetFramework="net46" />
<package id="WindowsAzure.Storage" version="7.2.1" targetFramework="net46" />
</packages>
kindly suggest, as mentioned above same json payload when triggered through incoming webhooks of msteams works fine.
from botbuilder-v3.
Myself, Eric, Sid, and Tatiana looked at this. @tacri is going to try to duplicate.
from botbuilder-v3.
@rrc2k4 , we were finally able to repro this issue. It is a bug in the teams scope and doesn't repro in the personal scope. An easy way to unblock you would be to add in the potentialAction section an @id field like so:
"potentialAction": [
{
"@id":"1",
"@type": "OpenUri",
from botbuilder-v3.
@tacri ,
Sure, will add that id and get back to u. Just wanted to check y the same payload is working fine when sent through incoming web hooks, if it is a teams issue?
from botbuilder-v3.
@rrc2k4 , internally we treat slightly different the webhook and bot messages which leads to this behavior. Ideally we would make a fix, but since these type of cards are legacy and there is a work around we would prefer not to if you are unblocked.
from botbuilder-v3.
Hi! I'm going to go ahead and close this, please reopen if this issue is persisting.
from botbuilder-v3.
Related Issues (20)
- Link to BotBuilder example is not available anymore HOT 1
- POST to 'https://facebook.botframework.com/v3/conversations/9838851111469094-906008411166152/activities/lOdKu9yrLed5iyVk3vbBaQJ5mCJPyp12345678fd2Ta0xQ3R_I12345678pmlNxrQ' failed: [400] Bad Request HOT 9
- Hostname/IP does not match certificate's altnames HOT 34
- Question: Will bot services (written with NodeJS SDK v3.14, using DirectLine v3 APIs) stop working after Dec 31, 2019? HOT 2
- Error: Refresh access token failed with status code: 400 HOT 3
- problem when try to call an another Rest-api at Botframework-V3+C#.net HOT 2
- MessageReceivedAsync will not get called sometimes HOT 7
- Extend v3 SDK to support Skills (DotNet) HOT 3
- Extend v3 SDK to support Skills (JS) HOT 1
- Enable SignIn from a Skill HOT 1
- IDialog method execution finished with multiple resume handlers specified through IDialogStack. invalid need: expected Call, have Wait (Microsoft.Bot.Builder.Internals.Fibers.InvalidNeedExceptio) HOT 18
- Microsoft.Bot.Builder - "Object reference not set to an instance of an object" HOT 5
- [Question, bug] Bot framework fails to save state to Doc DB in Teams 1:1 conversation (and errors dialogue) HOT 8
- Port: "Enable multiple scopes for single serviceUrl host" to javascript v3 sdk HOT 1
- Can we send adaptive card to particular group instead of channel HOT 1
- How can get Activity after user submit action in adaptive card using java HOT 1
- System.ArgumentNullException: Value cannot be null. (Parameter 'clientId') in bot V 3.30.0 HOT 1
- Data breach observed when two concurrent send message requests are made to different tenants HOT 8
- This repo is missing important files
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from botbuilder-v3.