Messaging extension bot example getting 501 Error
See original GitHub issueVersions
botbuilder version: 4.9.0 nodejs version: 14.0.5 os: mac
Describe the bug
I am trying to create a messaging extension action command feature with the following tutorial: https://docs.microsoft.com/en-us/microsoftteams/platform/task-modules-and-cards/task-modules/task-modules-bots
However, I am keep getting the following bug when invoking from Microsoft teams
(node:65410) UnhandledPromiseRejectionWarning: Error: BotFrameworkAdapter.processActivity(): 501 ERROR
at BotFrameworkAdapter.<anonymous> (/Users/kevin/Desktop/Github/jibee/node_modules/botbuilder/lib/botFrameworkAdapter.js:677:27)
at Generator.next (<anonymous>)
at fulfilled (/Users/kevin/Desktop/Github/jibee/node_modules/botbuilder/lib/botFrameworkAdapter.js:11:58)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
(Use `node --trace-warnings ...` to show where the warning was created)
The code example I am using
bot.js
import { BotFrameworkAdapter } from 'botbuilder';
import { TeamsMessagingExtensionsActionBot } from './teamsMessagingExtensionsActionBot';
const taskModuleController = new BotFrameworkAdapter({
appId: process.env.APP_ID,
appPassword: process.env.APP_PASSWORD
});
const bot = new TeamsMessagingExtensionsActionBot();
controller.webserver.post('/task_endpoint/', (req, res) => {
taskModuleController.processActivity(req, res, async (context) => {
console.log(context);
await bot.run(context);
});
});
teamsMessagingExtensionsActionBot.js
const { TeamsActivityHandler, CardFactory } = require('botbuilder');
export class TeamsMessagingExtensionsActionBot extends TeamsActivityHandler {
handleTeamsMessagingExtensionSubmitAction(context, action) {
return {
task: {
type: 'continue',
value: {
width: 500,
height: 450,
title: 'Task Module Fetch Example',
url: 'https://contoso.com/msteams/taskmodules/newcustomer',
fallbackUrl: 'https://contoso.com/msteams/taskmodules/newcustomer'
}
}
};
}
}
[bug]
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
MS Teams Task task modules from bots failing with 501 error
When user invoke task module using task/fetch , Bot calls handleTeamsTaskModuleFetch handler and respond with 501 because invokeResponse is ...
Read more >Error 501 Not Implemented: how to fix it and main causes
Error 501 is a HyperText Transfer Protocol (HTTP) status code that stands for Not Implemented. This server error response code means that ...
Read more >Messaging Extension SSO Config Bot - Code Samples
Bot Framework v4 sample for Teams to include a configuration page and Bot Service SSO authentication. Interaction with app. Prerequisites.
Read more >Add a Message Extension - Teams app camp
Exercise 1: Bot registration. Message extensions allow users to bring the application into a conversation in Teams. You can search data in your...
Read more >Mattermost API Reference
Use the error logs to help track down any remaining uses of API v3. ... For example, getting a channel by ID no...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I realized there was an error in my manifest where I misdefined the dynamic parameters input to be static which caused the resource error. Thank you for all the help!
I see almost no conversations on that bot in the last 6 days except for two 404 errors.
createCard
andshareMessage
commands, so that may cause an issue with using the sample code in your bot.handleTeamsMessagingExtensionSubmitAction
isn’t even being reached, it leads me to believe something is off with your code. Can you get sample 51 to work, but itself? If so, there’s an issue with your code and you’ll need to link me to it so I can help debug it.