javascript - Microsoft Bot Framework - how to send responses from a 3rd party API -
using microsoft bot framework, how can proxy api between incoming , outgoing bot messages? i've replaced: server.post('/api/messages', connector.listen()); with own implementation takes req.body.text , sends separate endpoint. how can send endpoints response chat? server.post('/api/messages', (req, res, next) => { request.post('endpoint', { json: {"text": req.body.text}, }, (error, response, body) => { // how send body outgoing chat message? }) }) update: to point out why ezequiel jadib's answer won't work, i've added complete code. req not defined within bot's callback function. const restify = require('restify') const builder = require('botbuilder') const request = require('request') // setup restify server const server = restify.createserver() server.use(restify.plugins.bodyparser()) server.listen(process.env.port || process.env.port || 3978, function () { cons