简体   繁体   English

使用 Nextel API 发送短信,发件人号码可见 Express

[英]Send SMS using Nextel API with sender number visible Express

I am using Vonage API for sending SMS through Node JS application.我正在使用 Vonage API 通过 Node JS 应用程序发送 SMS。 The receiver receives the message but from an anonymous number.接收者接收消息,但来自匿名号码。 Is there a way to show some text in From field so that the receiver will recognise the sender?有没有办法在 From 字段中显示一些文本,以便接收者识别发送者? I am using Indian numbers for sending and receiving messages.我正在使用印度号码发送和接收消息。 Thank you in advance.先感谢您。

You can add a sender identity .您可以添加发件人身份

For instance in the code below the variable from is that name which will be shown to have sent the message, visible on the receiver's phone.例如,在下面的代码中,变量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']}`); } } })

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM