Microsoft Teams
チャット、ビデオ会議、ファイル共有、アプリ統合を統合したコラボレーションおよびコミュニケーション プラットフォームにより、チームはどこからでもリアルタイムで効果的に共同作業を行うことができます。
このブラウザーはサポートされなくなりました。
Microsoft Edge にアップグレードすると、最新の機能、セキュリティ更新プログラム、およびテクニカル サポートを利用できます。
Microsoft Teams Bot の開発で、Bot Framework Connector APIを通じてメッセージを送信しようとすると、継続的に401認証エラーが発生します。
RestError: Authorization has been denied for this request.
{
"statusCode": 401,
"details": {"message": "Authorization has been denied for this request."},
"request": {
"url": "https://smba.trafficmanager.net/jp/.../v3/conversations/..
./activities",
"method": "POST"
}
}
const restify = require('restify');
const { BotFrameworkAdapter, ActivityHandler, MessageFactory } = require('botbuilder');
require('dotenv').config();
const server = restify.createServer();
server.use(restify.plugins.bodyParser());
const adapter = new BotFrameworkAdapter({
appId: process.env.MicrosoftAppId,
appPassword: process.env.MicrosoftAppPassword
});
adapter.onTurnError = async (context, error) => {
console.error(`\n [onTurnError] unhandled error: ${ error }`);
console.error(error);
await context.sendActivity('Sorry, it looks like something went wrong.');
};
class EchoBot extends ActivityHandler {
constructor() {
super();
this.onMessage(async (context, next) => {
const replyText = `Echo: ${ context.activity.text }`;
await context.sendActivity(MessageFactory.text(replyText, replyText));
await next();
});
this.onMembersAdded(async (context, next) => {
const membersAdded = context.activity.membersAdded;
const welcomeText = 'Hello and welcome!';
for (let cnt = 0; cnt < membersAdded.length; ++cnt) {
if (membersAdded[cnt].id !== context.activity.recipient.id) {
await context.sendActivity(MessageFactory.text(welcomeText, welcomeText));
}
}
await next();
});
}
}
const myBot = new EchoBot();
server.post('/api/messages', async (req, res) => {
await adapter.process(req, res, (context) => myBot.run(context));
});
const port = process.env.Port || 3978;
server.listen(port, () => {
console.log(`\n${ server.name } listening to ${ server.url }`);
console.log('\nGet Bot Framework Emulator: https://aka.ms/botframework-emulator');
console.log('\nTo test your bot, see: https://aka.ms/debug-with-emulator');
});
この Bot Framework Connector API の認証問題を解決するために、追加で必要な設定や対処法はありますか?
<モデレーター注>
本スレッドは、スパムフィルターの誤認識により削除されていましたがスレッドを復元しました。
又、同様に削除されたスレッドには重複マークを付与しました。
本スレッドにて、質問を継続してください。
チャット、ビデオ会議、ファイル共有、アプリ統合を統合したコラボレーションおよびコミュニケーション プラットフォームにより、チームはどこからでもリアルタイムで効果的に共同作業を行うことができます。