【问题标题】:Send SMS using Nextel API with sender number visible Express使用 Nextel API 发送短信,发件人号码可见 Express
【发布时间】:2021-05-07 12:08:01
【问题描述】:

我正在使用 Vonage API 通过 Node JS 应用程序发送 SMS。接收者接收消息,但来自匿名号码。有没有办法在 From 字段中显示一些文本,以便接收者识别发送者?我正在使用印度号码发送和接收消息。 提前谢谢你。

【问题讨论】:

    标签: javascript node.js api express vonage


    【解决方案1】:

    您可以添加sender identity

    例如,在下面的代码中,变量from 是显示已发送消息的名称,在接收者的手机上可见。

    const from = THE_SENDER_IDENTITY
    const to = TO_NUMBER
    const text = 'A text message sent using the Vonage SMS API'
    
    vonage.message.sendSms(from, to, text, (err, responseData) => {
        if (err) {
            console.log(err);
        } else {
            if(responseData.messages[0].status === "0") {
                console.log("Message sent successfully.");
            } else {
                console.log(`Message failed with error: ${responseData.messages[0]['error-text']}`);
            }
        }
    })

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-04-27
      • 1970-01-01
      • 1970-01-01
      • 2016-03-15
      • 1970-01-01
      • 1970-01-01
      • 2011-07-25
      • 1970-01-01
      相关资源
      最近更新 更多