easynexmo
Advanced tools
Comparing version 0.3.1 to 0.3.2
@@ -77,7 +77,11 @@ /* | ||
exports.sendTextMessage = function(sender,recipient,message, callback) { | ||
exports.sendTextMessage = function(sender,recipient,message,opts,callback) { | ||
if (!message) { | ||
sendError(callback,new Error(ERROR_MESSAGES.msg)); | ||
} else { | ||
sendMessage({from:sender,to:recipient,text:message},callback); | ||
if (!opts) { opts = {}; } | ||
opts['from'] = sender; | ||
opts['to'] = recipient; | ||
opts['text'] = message; | ||
sendMessage(opts,callback); | ||
} | ||
@@ -84,0 +88,0 @@ } |
{ | ||
"name" : "easynexmo", | ||
"author" : "Prabhu Velayutham", | ||
"version" : "0.3.1", | ||
"version" : "0.3.2", | ||
"main" : "lib/nexmo", | ||
"keywords" : ["sms", "nexmo"], | ||
@@ -6,0 +7,0 @@ "homepage" : "https://github.com/pvela/nexmo", |
@@ -1,2 +0,3 @@ | ||
A nodejs wrapper for nexmo API to send SMS | ||
[![build status](https://secure.travis-ci.org/pvela/nexmo.png)](http://travis-ci.org/pvela/nexmo) | ||
A nodejs wrapper for nexmo (http://nexmo.com/) API to send SMS | ||
@@ -17,7 +18,10 @@ Installation Instructions : | ||
nexmo.initialize(<KEY>,<SECRET>,<API_PROTOCOL>,<DEBUG>); | ||
nexmo.initialize(KEY,SECRET,API_PROTOCOL,DEBUG); | ||
KEY - API Key from Nexmo | ||
SECRET - API SECRET from Nexmo | ||
API_PROTOCOL - http or https | ||
DEBUG - set this to true to debug library calls | ||
@@ -77,2 +81,19 @@ | ||
Callback | ||
======== | ||
Callback from all API calls returns 2 parameters - error and a json object. | ||
An example callback function : | ||
function consolelog (err,messageResponse) { | ||
if (err) { | ||
console.log(err); | ||
} else { | ||
console.dir(messageResponse); | ||
} | ||
} | ||
Refer here http://nexmo.com/documentation/ to get the schema for the returned message response object. | ||
The MIT License (MIT) | ||
@@ -79,0 +100,0 @@ ===================== |
107
12788
5
255