【问题标题】:Using Twilio, unable to recieve real sms on phone using Trial Account in Node.js使用 Twilio,无法在 Node.js 中使用试用帐户在手机上接收真实短信
【发布时间】:2017-08-16 13:50:21
【问题描述】:

我在 Node.js

中发送短信的代码
var accountSid = ''; // Your Account SID from www.twilio.com/console
var authToken = '';   // Your Auth Token from www.twilio.com/console


// Load the twilio module
var twilio = require('twilio');

// Create a new REST API client to make authenticated requests against the
// twilio back end
var client = new twilio(accountSid, authToken);

// Pass in parameters to the REST API using an object literal notation. The
// REST client will handle authentication and response serialzation for you.
client.messages.create({
    to: 'my_number',  // verified
    from: '+15005550006', // From a valid Twilio number
    body:'ahoy hoy! Testing Twilio and node.js'
}, function(error, message) {
    // The HTTP request to Twilio will run asynchronously. This callback
    // function will be called when a response is received from Twilio
    // The "error" variable will contain error information, if any.
    // If the request was successful, this value will be "falsy"
    if (!error) {
        // The second argument to the callback will contain the information
        // sent back by Twilio for the request. In this case, it is the
        // information about the text messsage you just sent:
        console.log('Success! The SID for this SMS message is:');
        console.log(message.sid);

        console.log('Message sent on:');
        console.log(message.dateCreated);
    } else {
        console.log('Oops! There was an error.');
         console.log(error)
    }
});

一切正常,但我没有收到 Actual/Real SMS 那么我如何通过仅在控制台上看到成功结果来确认。这就是为什么我想获得 Actual/真正的短信不仅仅是控制台中的成功消息?

因此没有规定使用试用帐户获取实际消息。

任何建议、建议或答案都会对我更有帮助 提前致谢!

【问题讨论】:

  • 您使用的是实时凭据还是测试凭据?

标签: node.js sms twilio sms-gateway twilio-api


【解决方案1】:

您使用的是试用帐户吗?

如果是这样,您需要将要拨打的电话号码添加为已验证号码。你可以这样做Here

【讨论】:

  • 我的号码已经添加到他们的了。但无法发送真正的短信,我不尝试语音通话。发送短信后,我也会尝试这样做
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-08-11
相关资源
最近更新 更多