1.0.0 • Published 9 years ago

nexmofy v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
9 years ago

nexmofy

NPM version NPM downloads Dependencies status MIT license

Nexmo callback receiver which based on Node's EventEmiiter. Nexmofy provides extensible APis.

Getting Started

Create new HTTP Server which handle Callback Requests.

var nexmofy = require('nexmofy');
nexmofy.listen(9000);

... or you can register routes on your own Express Application.

var express = require('express'),
    nexmofy = require('nexmofy');

var myApp = express();
...
nexmofy.registerRoutes(myApp);

Register Event Listeners

nexmofy.channel.on('onSMSReceived', function (message) {
    console.log('got new message: ', message);
});

Register Callback URL on Nexmo Dashboard

NOTE: nexmofy`s API Endpoint is: /api/nexmo/sms/callback.

Enjoy! :)

Events

onSMSReceived(payload)

Payload Information

NameTypeDescriptionOriginal Key
idStringMessage IDmessageId
fromStringPhone Number which Message was sent from.msisdn
toStringPhone Number which Message was sent to.to
textStringMessage Bodytext
typeStringTypetype
keywordStringKeywordkeyword
timestampDateMessage timestampmessage-timestamp

Milestone

  • Changeable API Endpoint path

Author

MooYeol, Lee (Prescott)

License

MIT