【问题标题】:Twilio + Airtable / Collecting data from a chatbotTwilio + Airtable / 从聊天机器人收集数据
【发布时间】:2020-05-10 22:03:31
【问题描述】:

我正在使用 Twilio Studio 开发一个聊天机器人,在某些时候,我需要从与我的机器人交谈的客户那里收集数据输入,然后将其发布到一个 airtable 库中。 我没有太多的编码技能,所以我的指南是这个 Dabble Lab 教程: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

知道如何解决这个问题吗?

【问题讨论】:

    标签: twilio twilio-api airtable twilio-studio


    【解决方案1】:

    最近发布了几个不错的 Twilio/Airtable 博客。看起来您收到了一个错误,但您的错误条件没有调用回调,因此没有调用超时。

    可能是一些问题是 Airtable 字段类型不喜欢您发布的数据类型,尤其是日期。

    也许你需要这样的东西?

    const today = new Date();
    const date = `${(today.getMonth()+1)}/${today.getDate()}/${today.getFullYear()}`;
    

    Writing to Airtable from your Twilio app

    Using Airtable as a database for your Twilio app

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-08-31
      • 2023-01-15
      • 2020-08-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多