Send & Recieve SMS messages in Node.JS using Nexmo
SiDarthVader
11.3K views
Send an SMS using Nexmo
Enter your apiKey, apiSecret, the Nexmo number, and the destination number below. Press run my code and send the SMS message.
Send an SMS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
const Nexmo = require('nexmo');
const nexmo = new Nexmo({
apiKey: 'apiKey',
apiSecret: 'apiSecret'
});
nexmo.message.sendSms('VIRTUALNUMBER', 'TONUMBER', 'TEXT', (err, responseData) => {
if (err) {
console.log(err);
} else {
console.log(JSON.stringify(responseData, null, 2));
}
});
Create your playground on Tech.io
This playground was created on Tech.io, our hands-on, knowledge-sharing platform for developers.