简体   繁体   中英

How to Create SMS API using Node.js

I need to send notifications and special messages to my app users as an SMS. so I want to make SMS API . how can I create it using node.js?

You can use the nexmo communication API ; Run

npm install nexmo

for the package

const Nexmo = require('nexmo')

const nexmo = new Nexmo({
    apiKey: '*****',
    apiSecret: '*****',
});
var to = 'numberTo';
var from = 'brandName';
var text = 'someText';
nexmo.message.sendSms(from, to, 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