Nexmo.sendTextMessage()

Send a text message using the Nexmo SMS API

Usage

Hover over inputs/exits for more info.

var Nexmo = require('machinepack-nexmo');


// Send a text message using the Nexmo SMS API

Nexmo.sendTextMessage({

apiKey: 'n3xm0rocks',

apiSecret: '12ab34cd',

from: '18479121345',

to: '447525856424',

text: 'D%c3%a9j%c3%a0+vu',

protocol: 'http',

}).exec({

// An unexpected error occurred.

error: function (err) {

 

},

// Fail to send the text message.

requestError: function () {

 

},

// OK.

success: function () {

 

},

});

Inputs

apiKey required

Your NEXMO API Key.

'n3xm0rocks'
apiSecret required

Your NEXMO API Secret.

'12ab34cd'
from required

Sender SMS number.

'18479121345'
to required

Recipient SMS number.

'447525856424'
text required

Body of the text message.

'D%c3%a9j%c3%a0+vu'
protocol

Default protocol for the request is https. User can switch to http.

'http'

Exits

error

An unexpected error occurred.

requestError

Fail to send the text message.

success

OK.