代码之家  ›  专栏  ›  技术社区  ›  Majid Ahmadi

Twilio返回自我_qs。unescape错误

  •  0
  • Majid Ahmadi  · 技术社区  · 6 年前

    当我使用Twilio发送短信时,它会返回 类型错误:self_qs。unescape不是一个函数 帕卡杰。json:

    "dependencies": {
    
        "twilio": "^2.11.1",
        "typescript": "^2.8.3",
    
      },
      "devDependencies": {
        "@types/lodash": "^4.14.108",
        "@types/node": "^9.6.6",
        "@types/twilio": "0.0.9"
      }
    

    和我的代码:

     var twilio = require('twilio');
    
     var ACCOUNT_SID = "***";
     var AUTH_TOKEN = "***";
      TwilioClient.messages.create({
           body: 'Welcome  ',
           to:  '+*****'
           from: '+****' // From a valid Twilio number
       }).then((message) => console.log(message.sid));
    

    并返回: 传递调用“Register”的结果时发生异常:TypeError:self_qs。unescape不是一个函数

    2 回复  |  直到 6 年前
        1
  •  1
  •   philnash    6 年前

    您需要启动twilio客户端,然后使用它:

    var client = new twilio(ACCOUNT_SID, AUTH_TOKEN);
    
    client.messages.create({
           body: 'Welcome  ',
           to:  '+*****'
           from: '+****' // From a valid Twilio number
    }).then((message) => console.log(message.sid));
    
        2
  •  0
  •   Grant Miller    6 年前

    在Meteor中,我应该从服务器连接到Twilio API。

    当我向客户请求时,我得到了错误。