我正在使用Twilio Studio开发一个聊天机器人,在某个时候,我需要从与我的机器人对话的客户那里收集数据输入,然后将其发布到一个飞机场基地。我没有太多的编程技能,所以我的指南是这个涉猎的实验教程:https://www.youtube.com/watch?v=xjt9YhNFrno
然而,视频中提出的Twilio功能并不起作用。代码如下:
exports.handler = function(context, event, callback) {
let member = {
name : event.name,
email : event.email,
date : Date.now()
};
var Airtable = require('airtable');
var base = new Airtable({apiKey: context.AIRTABLE_API_KEY}).base('appISrkMnNdL65Lzj');
base('Members').create(member, function(err, record) {
if (err) { console.error(err); return; }
console.log(record.getId());
callback(null, member);
});};
When I try to make a POST request via Postman, this is what happens in my Twilio Console And this is the capture of Postman response As I´m using Twilio Studio Flow for developing the chatbot, I guess I could use the HTTP Request Widget but I really don´t know how to configure it. The columns in my base are: Id - name - email - date
你知道我该怎么解决这个问题吗?
发布于 2020-05-11 07:19:02
最近发布了几个不错的Twilio/Airtable博客。看起来你得到了一个错误,但是你的错误条件没有调用回调,因此没有超时。
可能是Airtable字段类型不喜欢您正在发布的数据的类型,特别是日期。
也许你需要这样的东西来代替?
const today = new Date();
const date = `${(today.getMonth()+1)}/${today.getDate()}/${today.getFullYear()}`;https://stackoverflow.com/questions/61719321
复制相似问题