Server not sending a response to Teams

Copper Contributor

I created a test messaging extension that's just supposed to go to a website link when clicked. I was able to get the app onto teams and install it to a channel, but when I try to use it or open it from the store, I get 'Unable to reach app. Please try again.' my ngrok server says "Waiting to receive a response from your server". My server code is below, I thought the callback(null, response, 200) at the bottom was supposed to send the response back to teams. Any ideas or advice is appreciated.


var request = require('request');
var util = require("util");
var restify = require('restify');
var builder = require('botbuilder');
var teams = require('botbuilder-teams');

var connector = new teams.TeamsChatConnector({
    appId: "myAppId",
    appPassword: "myAppPassword"

var server = restify.createServer();

server.listen(3978, function () {
    console.log('%s listening to app2 %s',, util.inspect(server.address()));
var inMemoryStorage = new builder.MemoryBotStorage();
var bot = new builder.UniversalBot(connector).set('storage', inMemoryStorage);

var stripBotAtMentions = new teams.StripBotAtMentions();

bot.dialog('/', [
    function (session) {
        builder.Prompts.text(session, 'Hi! What is your name?');
    function (session, results) {
        session.endDialog(`Hello ${results.response}!`);

// this will reset and allow to receive from any tenants

// var bot = new builder.UniversalBot(connector);'/api/composeExtension', connector.listen());'/api/messages', connector.listen());
//'/greetings', connector.listen());'/', connector.listen());

var composeExtensionHandler = function (event, query, callback) {
    // parameters should be identical to manifest
    console.log("Query Running");
    var attachments = [];
    try {
        var card = new builder.HeroCard()
            type: "openUrl",
            title: "Open Kloud",
            value: ''
    } catch (err) {
    var response = teams.ComposeExtensionResponse

    // Send the response to teams
    callback(null, response, 200);



connector.onQuery('Open', composeExtensionHandler);

var composeInvoke = function (event) {




3 Replies

@marcusyoung Could you please try the sample here for Message Extension and see if you are facing any issue?

@Gousia_Begum I'm getting a response, but now I'm getting TypeError: BotFrameworkAdapter is not a constructor. I botbuilder installed already and I've tried different versions of it.

Fixed the problem by manually installing the latest version of botbuilder. Seems like the normal npm i was installing a previous version.