README
SMSLIVE247API
A Node Interface for SMSLive247 API
You will need to create an account with smslive247.com before you can use this module. Please check their api documentation here.
Pre Step
- Create an account on smslive247.com
- Create a subaccount under the original account Read more here
Install
$ npm install smslive247api --save
Usage Example Using sendMsgQuick cmd
Using sendMsgQuick is probably the fastest way to use SMSLive247 API
const SMSLive247API = require('smslive247api');
const SMSLiveAPI = new SMSLive247API('accountEmail@mail.com', 'subAccountUserName', 'subAccountPassword');
SMSLiveAPI.sendQuickMessage('SMS Body text', ['09***', '081***'], 'SenderName').then((res) => {
console.log(res)
})
.catch((err) => {
console.log(err);
})
sendQuickMessage
method accept three parameters
- SMS body
- Receipients phone numbers array
- Sender's Name
Usage Example Using sendMsg cmd
This command requires a user sessionId gotten after login. It is advisable to use this if you're planning to send SMS multiple times.
const SMSLive247API = require('smslive247api');
const SMSLiveAPI = new SMSLive247API('accountEmail@mail.com', 'subAccountUserName', 'subAccountPassword');
SMSLiveAPI.login().then((res) => {
const sessionId = res.sessionId
SMSLiveAPI.sendMessage(sessionId, 'TEST MEssage from class', ['090***', '081***'], 'TEST').then((res) => {
console.log(res)
})
})
.catch((err) => {
console.log(err);
})
This module exposes a login
method needed to login into smslive247, this method returns a session Id which you can use for any subsequent request to the server.
sendMessage
method accept 4 parameters
- sessionId - gotten from login
- SMS body
- Receipients phone numbers array
- Sender's Name