简体   繁体   中英

Send SMS using Nextel API with sender number visible Express

I am using Vonage API for sending SMS through Node JS application. 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? 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.

 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']}`); } } })

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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