MS Teams message extension is working in bot personal chats and default team of tenant but not working in others team's channels.
I'm getting error:
Error
This is manifest file for my app:
{
"$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.5/MicrosoftTeams.schema.json",
"manifestVersion": "1.5",
"version": "1.0",
"id": "<<id>>",
"packageName": "com.microsoft.teams.samples",
"developer": {
"name": "Microsoft",
"websiteUrl": "https://dev.botframework.com",
"privacyUrl": "https://privacy.microsoft.com",
"termsOfUseUrl": "https://www.microsoft.com/en-us/legal/intellectualproperty/copyright/default.aspx"
},
"icons": {
"color": "icon-color.png",
"outline": "icon-outline.png"
},
"name": {
"short": "Demo",
"full": "Demo Demo"
},
"description": {
"short": "Sample demonstrating an Action Based Messaging Extension with Preview",
"full": "Sample Action Messaging Extension built with the Bot Builder SDK demonstrating Preview"
},
"accentColor": "#FFFFFF",
"bots": [
{
"botId": "<<botId>>",
"scopes": [
"personal",
"team",
"groupchat"
]
}
],
"composeExtensions": [
{
"botId": "<<botId>>",
"canUpdateConfiguration": false,
"commands": [
{
"id": "create",
"type": "action",
"title": "Create",
"description": "Create new card",
"initialRun": false,
"fetchTask": false,
"context": [
"compose"
],
"parameters": [
{
"name": "description",
"title": "Title",
"description": "Enter Title...",
"inputType": "textarea"
}
]
}
]
}
],
"validDomains": []
}
I have seen others apps are able to send message from message extension without installing it to particular teams.
Related
Hi guys I have been trying to enable my bot on default, the bot needs to be installed directly to the Microsoft team's channel.
Below is the schema of my app manifest in teams
{
"$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.11/MicrosoftTeams.schema.json",
"manifestVersion": "1.11",
"version": "1.6",
"id": "xxxx-xxxxxx-xxxxxx-xxxxx",
"packageName": "com.xxxxx.microsoftteams.jira",
"developer": {
"name": "xxxxxxx",
"websiteUrl": "https://www.xxxxx.com",
"privacyUrl": "https://www.xxxxx.com/privacy",
"termsOfUseUrl": "https://www.xxxxx.com/license",
"mpnId": "xxxxx"
},
"icons": {
"color": "color.png",
"outline": "outline.png"
},
"name": {
"short": "xxxx",
"full": "xxxx"
},
"description": {
"short": "xxxxx",
"full": "xxxxxx"
},
"accentColor": "#FFFFFF",
"configurableTabs": [],
"staticTabs": [
{
"entityId": "conversations",
"scopes": [
"personal"
]
},
{
"entityId": "about",
"scopes": [
"personal"
]
},
{
"entityId": "xx",
"name": "xx",
"scopes": [
"personal"
]
}
],
"bots": [
{
"botId": "xxx-xxxx-xxxx-xxxx",
"scopes": [
"personal",
"team",
"groupchat"
],
"supportsFiles": false,
"isNotificationOnly": false
}
],
"composeExtensions": [
{
"botId": "xxx-xxxx-xxxx-xxxx",
"canUpdateConfiguration": false,
"commands": [
{
"id": "search",
"type": "query",
"title": "Search",
"description": "Search for issues in xxx",
"initialRun": true,
"fetchTask": false,
"context": [
"commandBox",
"compose"
],
"parameters": [
{
"name": "search",
"title": "Search",
"description": "Search",
"inputType": "text"
}
]
}
]
}
],
"permissions": [
"identity",
"messageTeamMembers"
],
"defaultInstallScope": "team",
"defaultGroupCapability": {
"meetings": "bot",
"team": "bot",
"groupchat": "bot"
},
"validDomains": [
"xxx",
],
"webApplicationInfo": {
"id": "xxx-xxxx-xxxx",
"resource": "http://"
}
}
So if you look carefully you will find out that I have added defaultInstallScope to route the installation to teams and defaultGroupCapability has teams specifying that it should install the bot to the teams. But it's not working. Please does anybody know anything about this?
defaultGroupCapability provides the default capability that will be added to the team, groupchat, or meeting. Select a tab, bot, or connector as the default capability for your app, but you must ensure that you have provided the selected capability in your app definition .Could you just check it once? or share the error log?
Ref Doc:-Configure default install options for your Microsoft Teams app
I have a messaging extension bot in my Teams app, which is sending the following response when it receives a composeExtension/submitAction POST request:
{
"composeExtension": {
"attachments": [
{
"content": {
"type": "AdaptiveCard",
"body": [
{
"items": [
{
"color": null,
"horizontalAlignment": null,
"isSubtle": false,
"maxLines": 0,
"size": "large",
"text": "Solution: DoorDash",
"weight": "bolder",
"wrap": false,
"separator": false,
"type": "TextBlock"
},
{
"color": null,
"horizontalAlignment": null,
"isSubtle": true,
"maxLines": 0,
"size": "small",
"text": "No Needs • No Comments • No Upvotes",
"weight": null,
"wrap": true,
"separator": false,
"type": "TextBlock"
}
],
"separator": false,
"type": "Container"
},
{
"items": [
{
"horizontalAlignment": null,
"style": null,
"url": "https://urlp.asm.skype.com/v1/url/content?url=https%3a%2f%2fs3.us-east-1.amazonaws.com%2fstartgrid-v2-test-crunchbase-images%2forganizations%2fb%2f2%2fb2cximlauocyxfs2lkfh",
"width": "100px",
"height": "100px",
"separator": false,
"type": "Image"
},
{
"color": null,
"horizontalAlignment": null,
"isSubtle": false,
"maxLines": 0,
"size": null,
"text": "",
"weight": null,
"wrap": false,
"separator": false,
"type": "TextBlock"
},
{
"color": null,
"horizontalAlignment": null,
"isSubtle": false,
"maxLines": 0,
"size": null,
"text": "DoorDash enables delivery in areas where it was not previously available. The company's mission is to empower small business owners to offer delivery in an affordable and convenient way. We are achieving this mission first by enabling restaurant food delivery. DoorDash was founded in February 2013 by four Stanford students with experiences from Facebook, Square, Vevo, and eBay.",
"weight": null,
"wrap": false,
"separator": false,
"type": "TextBlock"
}
],
"separator": false,
"type": "Container"
}
],
"actions": [
{
"url": "xxxxxxxxxx",
"title": "View Solution",
"type": "Action.OpenUrl"
},
{
"url": "https://teams.microsoft.com/l/task/60864eb3-18fc-4710-9029-412157bce86b?height=600&url=xxxxxxxxxxx",
"title": "Add Comment",
"type": "Action.OpenUrl"
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.0"
},
"contentType": "application/vnd.microsoft.card.adaptive"
}
],
"type": "result",
"attachmentLayout": "list"
},
"responseType": "composeExtension"
}
The POST request has a 200 status code but the adaptive card fails to render and the following error message is displayed in the console: BotCardService: Error while resolving MRI from appAttribution. Error msg: {}
Please could you provide further information on what this error relates to?
Thanks.
Here are the steps you can follow:
We should add the commands in compose extension section in manifest file like below:
"composeExtensions": [
{
"botId": "xxxxxx-59e6-49b8-8b94-xxxxxxxxxx",
"commands": [
{
"id": "createAdaptiveCard",
"type": "action",
"context": [ "compose" ],
"description": "Command to run action to create a Card from Compose Box",
"title": "Adaptive Card",
"parameters": [
{
"name": "title",
"title": "Name",
"description": "Name of the User",
"inputType": "text"
},
{
"name": "subTitle",
"title": "Designation",
"description": "Designation of the User",
"inputType": "text"
},
{
"name": "text",
"title": "Description",
"description": "Description",
"inputType": "textarea"
}
]
},
{
"id": "webView",
"description": "Fetch the Web View",
"title": "Web View",
"type": "action",
"fetchTask": true,
"context": [ "compose" ]
},
{
"id": "HTML",
"description": "Fetch the HTML",
"title": "HTML",
"type": "action",
"fetchTask": true,
"context": [ "compose" ]
},
{
"id": "razorView",
"description": "Fetch the Razor View",
"title": "Razor View",
"type": "action",
"fetchTask": true,
"context": [ "compose" ]
}
]
}
],
You need to invoke the "createAdaptiveCard" action from the Messaging Extension action.
It will open a AdaptiveCard popup which is configured in your manifest.
Once you submit the card, it will handle the request at server side in below method:
protected override async Task OnTeamsMessagingExtensionSubmitActionAsync(ITurnContext turnContext, MessagingExtensionAction action, CancellationToken cancellationToken)
As a return response, you can return the Adaptive Card as attachment.
We have tried it at our end and it is working fine.
Please find below screenshot of it.
Please find below sample link for your reference:
https://github.com/microsoft/BotBuilder-Samples/tree/main/samples/csharp_dotnetcore/51.teams-messaging-extensions-action
I have an MS Teams app that just does link unfurling. I do not want to provide any actions.
I use to be able to do this by just leaving the "commands" section in the manifest empty but now if I do that you get the oh so helpful message "Something went wrong".
So now the only way to get Teams to load my app is if I add a dummy command.
Is there some way to do this without providing commands or some way to provide a command that the user will never see?
This is an actual manifest that fails:
{
"$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.5/MicrosoftTeams.schema.json",
"manifestVersion": "1.5",
"version": "1.1",
"id": "fe8ad7e8-7679-40d7-9435-0ef4488d74ce",
"packageName": "com.foobar.teams.1",
"developer": {
"name": "foobar",
"websiteUrl": "https://www.foobar.com",
"privacyUrl": "https://foobar.com/en/privacy-policy/",
"termsOfUseUrl": "https://foobar.com/en/terms-and-conditions/"
},
"name": {
"short": "foobar test",
"full": "foobar test"
},
"description": {
"short": "foobar test",
"full": "foobar test."
},
"icons": {
"outline": "foobar-outline.png",
"color": "foobar-color.png"
},
"accentColor": "#FFFFFF",
"composeExtensions": [
{
"botId": "fe8ad7e8-7679-40d7-9435-0ef4488d74ce",
"canUpdateConfiguration": false,
"commands": [
],
"messageHandlers": [
{
"type": "link",
"value": {
"domains": [
"*.foobar.net"
]
}
}
]
}
],
"permissions": [
],
"devicePermissions": [
],
"validDomains": [
"*.foobar.net"
]
}
This is a manifest that works:
The only difference is that it contains commands.
{
"$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.5/MicrosoftTeams.schema.json",
"manifestVersion": "1.5",
"version": "1.1",
"id": "fe8ad7e8-7679-40d7-9435-0ef4488d74ce",
"packageName": "com.foobar.teams.1",
"developer": {
"name": "foobar",
"websiteUrl": "https://www.foobar.com",
"privacyUrl": "https://foobar.com/en/privacy-policy/",
"termsOfUseUrl": "https://foobar.com/en/terms-and-conditions/"
},
"name": {
"short": "foobar test",
"full": "foobar test"
},
"description": {
"short": "foobar test",
"full": "foobar test."
},
"icons": {
"outline": "foobar-outline.png",
"color": "foobar-color.png"
},
"accentColor": "#FFFFFF",
"composeExtensions": [
{
"botId": "fe8ad7e8-7679-40d7-9435-0ef4488d74ce",
"canUpdateConfiguration": false,
"commands": [
{
"id": "shareMessage",
"type": "action",
"title": "Share Message",
"description": "Test command to run action on message context (message sharing)",
"initialRun": false,
"fetchTask": false,
"context": [
"message"
],
"parameters": [
{
"name": "includeImage",
"title": "Include Image",
"description": "Include image in Hero Card",
"inputType": "toggle"
}
]
}
],
"messageHandlers": [
{
"type": "link",
"value": {
"domains": [
"*.foobar.net"
]
}
}
]
}
],
"permissions": [
],
"devicePermissions": [
],
"validDomains": [
"*.foobar.net"
]
}
Leslie, Thanks for bringing it to our notice, we have reproved this from our end, you can pass empty command array inside the manifest. It is working for us. could you please check the below code snippet.
I'm developing a one-on-one Bot App (Azure Bot Framework) for MS Teams. A use case is simple: a user installs the Bot and Bot sends him with a welcome message plus a bunch of available functions (a menu).
My questions:
What is the best practice to display the main menu for the Bot if we speak about MS Teams?
Is it possible to have the main menu for Bot with buttons? And how to create it?
As I found Microsoft suggests using a dropdown menu (https://learn.microsoft.com/en-us/microsoftteams/platform/resources/bot-v3/bots-menus) for this purpose. But it doesn't work on mobile devices and a user has to write the command to the Bot manually - it is not the best option from UX point of view.
When I try to use buttons then I struggle with another problem: in the Adaptive Card buttons show in one line. If I separate buttons in the different column sets then:
In the desktop app everything is fine (but anyway buttons have different width).
In the iOS app everything is fine (but anyway buttons have different width).
In the Android app buttons are displayed glued to each other (without any vertical margin between them)
JSON for main menu that I used:
{
"type": "AdaptiveCard",
"version": "1.2",
"id": "main_menu",
"body": [
{
"type": "TextBlock",
"wrap": true,
"text": "%%0"
},
{
"type": "ActionSet",
"actions": [
{
"type": "Action.Submit",
"title": "Use enhanced password policy",
"style": "positive",
"data": {
"id": "services/pw_policy"
}
}
],
"spacing" : "Medium"
},
{
"type": "ActionSet",
"actions": [
{
"type": "Action.Submit",
"title": "Reset HPA password",
"style": "positive",
"data": {
"id": "services/hpa_reset_pswd"
}
}
],
"spacing" : "Medium"
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json"
}
Use Colmn Set
{
"type": "AdaptiveCard",
"version": "1.2",
"id": "main_menu",
"body": [
{
"type": "TextBlock",
"wrap": true,
"text": "%%0"
},
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"width": "stretch",
"items": [
{
"type": "ActionSet",
"actions": [
{
"type": "Action.Submit",
"title": "Use enhanced password policy",
"style": "positive",
"data": {
"id": "services/pw_policy"
}
}
],
"spacing": "Medium"
}
]
},
{
"type": "Column",
"width": "stretch",
"items": [
{
"type": "ActionSet",
"actions": [
{
"type": "Action.Submit",
"title": "Reset HPA password",
"style": "positive",
"data": {
"id": "services/hpa_reset_pswd"
}
}
],
"spacing": "Medium"
}
]
}
]
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json"
}
I added a skill to the virtual assistant and uploaded it as an app on MS teams for dev testing. I get the prompt from the VA but it doesn't hand off to the skill. However, when I add the bot to MS teams from the channel section in Web App Bot > MS Teams, it works as intended. The manifest.json file:
"$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.5/MicrosoftTeams.schema.json",
"manifestVersion": "1.5",
"version": "1.0.0",
"id": "MICROSOFT APP ID",
"packageName": "com.xyz.bot",
"developer": {
"name": "xyz",
"websiteUrl": "xyz",
"privacyUrl": "xyz",
"termsOfUseUrl": "xyz"
},
"icons": {
"color": "color.png",
"outline": "outline.png"
},
"name": {
"short": "Test Bot",
"full": "Test Bot"
},
"description": {
"short": "Test Bot",
"full": "Test Bot"
},
"accentColor": "#F9F9FA",
"bots": [
{
"botId": "MICROSOFT APP ID (same as above)",
"scopes": [
"personal",
"team",
"groupchat"
],
"supportsFiles": false,
"isNotificationOnly": false
}
],
"permissions": [
"identity",
"messageTeamMembers"
],
"validDomains": ["token.botframework.com"]
}
Would appreciate some help in this matter.. Thanks!