【问题标题】:Conversation Service Resource API returns undefined对话服务资源 API 返回未定义
【发布时间】:2022-01-04 00:36:39
【问题描述】:

我按照此处描述的教程进行操作:https://www.twilio.com/docs/conversations/api/service-resource

以下代码返回“TypeError: Cannot read property 'create' of undefined”

const twilioClient = twilio(twilioAccountSid, twilioAuthToken);
twilioClient.conversations.services
                .create({friendlyName: 'friendly_name'})
                .then(service => console.log(service.sid));

我能够使用对话资源 API,所以我知道我的 twilioClient 是正确的。仅当我使用“.services”时才会出现问题

非常感谢任何帮助。

【问题讨论】:

    标签: twilio twilio-conversations twilio-node


    【解决方案1】:

    原来答案是升级 Twilio 版本。我在文档中找不到它指定对话/服务 API 调用需要比 3.39.1 更新的位置。但是,升级到 3.72.0 解决了我的问题。

    希望这对遇到类似问题的人有所帮助。

    【讨论】:

      猜你喜欢
      • 2021-10-15
      • 2017-07-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-03-20
      相关资源
      最近更新 更多