You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
const from = 'num'
const to = 'num'
const text = 'A text message sent using the Nexmo SMS API'
nexmo.message.sendSms(from, to, text, (error, response) => {
if(error) {
throw error;
} else if(response.messages[0].status != '0') {
console.error(response);
throw 'Nexmo returned back a non-zero status';
} else {
console.log(response);
}
});
{ 'message-count': '1',
messages:
[ { to: 'num',
'message-id': '0C000000B7BAC3CE',
status: '0',
'remaining-balance': '11.90490000',
'message-price': '0.03330000',
network: '23420' } ] }
/srv/node_modules/nexmo/lib/index.js:142
if (!err && apiResponse.status && apiResponse.messages[0].status > 0) {
^
TypeError: Cannot read property 'status' of undefined
As you can see the message successfully sends (verified on my phone) however this error is thrown from the library immediately after. Why is this happening?
The text was updated successfully, but these errors were encountered:
GoEagles999
changed the title
Node library - message.sendSms - TypeError: Cannot read property 'status' of undefined
message.sendSms - TypeError: Cannot read property 'status' of undefined
May 27, 2018
I am trying to send an SMS message like this:
As you can see the message successfully sends (verified on my phone) however this error is thrown from the library immediately after. Why is this happening?
The text was updated successfully, but these errors were encountered: