Middleware error API.ai
Working on a facebook bot for few days now, and just wanted to try the api.ai middleware, but no luck so far. Anyone else getting this error using https://github.com/abeai/botkit-middleware-apiai ?
ERROR IN RECEIVE MIDDLEWARE: [TypeError: The header content contains invalid characters]
Here's my code:
var apiai = require('botkit-middleware-apiai')({
token: <my_apiai_token>
});
controller.middleware.receive.use(apiai.receive);
controller.hears(['test middleware'],'mesage_received',apiai.hears,function(bot, message) {
console.log(JSON.stringify(message));
console.log('test middleware');
bot.reply(message, 'middleware test passed!');
});
Thanks, Raz.
It seems the error ERROR IN RECEIVE MIDDLEWARE: [TypeError: The header content contains invalid characters] went away. Still i don't get a reply from Api.ai. Any ideas why?
Still trying to get the api.ai middleware work with my facebook bot but haven't had much success. I can connect fine with api.ai , messages are being delivered to the api.ai console but i can't find out how to reply back to the user via bot.reply. Any suggestions/ideas? I'm really stuck with this one...
You may want to try asking the question on dev4slack as well!
Done! Cheers for that.
You might not be able to reply because you didn't give a valid intent name to controller.hears. See https://github.com/abeai/botkit-middleware-apiai/issues/4.