sms-gateway-nodejs
A library to interact with SMS Gateway API.
Installation
npm install --save sms-gateway-nodejs
Documentation
Initialization
Arguments
emailAddress
(String): Your smsgateway usernamepassword
(String): Your smsgateway password
Example
smsGateway = 'ntrinquier@provider.com' 'p4ssw0rd'
Contact
Device
Messages
listOfMessages
fetchSingleMessage
sendMessageToNumber
sendMessageToNumbers
sendMessageToContact
sendMessageToContacts
sendMessagesToRecipients
“Contacts” Methods
createContact(page)
Create a contact.
Arguments
name
(String): The contact's namenumber
(String): The contact's number
Example
smsGatewaycontact
listOfContacts(page)
Get a list of the contacts.
Arguments
page
(String): The page number
Example
smsGatewaycontact
fetchSingleContact(id)
Get a specific contact.
Arguments
id
(String): The contact ID
Example
smsGatewaycontact
“Devices” Methods
listOfDevices(page)
Get a list of the devices.
Arguments
page
(String): The page number
Example
smsGatewaydevice
fetchSingleDevice(id)
Get a specific device.
Arguments
id
(String): The device ID
Example
smsGatewaydevice
“Messages” Methods
listOfMessages(page)
Get a list of the messages.
Arguments
page
(String): The page number
Example
smsGatewaymessage
fetchSingleMessage(id)
Get a specific message.
Arguments
id
(String): The message ID
Example
smsGatewaymessage
sendMessageToNumber(device, number, message, [sendAt], [expiresAt])
Send a message to a number.
Arguments
device
(String): The ID of device you wish to send the message fromnumber
(String): The number to send the message tomessage
(String): The content of the message to be sent[sendAt=undefined]
(String): Time to send the message in Unix Time format[expiresAt=undefined]
(String): Time to give up trying to send the message at in Unix Time format
Example
smsGatewaymessage
sendMessageToNumbers(device, numbers, message, [sendAt], [expiresAt])
Send a message to numbers.
Arguments
device
(String): The ID of device you wish to send the message fromnumbers
(Array): The numbers to send the message tomessage
(String): The content of the message to be sent[sendAt=undefined]
(String): Time to send the message in Unix Time format[expiresAt=undefined]
(String): Time to give up trying to send the message at in Unix Time format
Example
smsGatewaymessage
sendMessageToContact(device, contact, message, [sendAt], [expiresAt])
Send a message to a contact.
Arguments
device
(String): The ID of device you wish to send the message fromcontact
(String): The contact to send the message tomessage
(String): The content of the message to be sent[sendAt=undefined]
(String): Time to send the message in Unix Time format[expiresAt=undefined]
(String): Time to give up trying to send the message at in Unix Time format
Example
smsGatewaymessage
sendMessageToContacts(device, contacts, message, [sendAt], [expiresAt])
Send a message to contacts.
Arguments
device
(String): The ID of device you wish to send the message fromcontacts
(Array): The contacts to send the message tomessage
(String): The content of the message to be sent[sendAt=undefined]
(String): Time to send the message in Unix Time format[expiresAt=undefined]
(String): Time to give up trying to send the message at in Unix Time format
Example
smsGatewaymessage
sendMessagesToRecipients(data)
Send messages to numbers or contacts.
Arguments
data
(Array): Objects containing the messages to send, at the following format:device
(String): The ID of device you wish to send the message fromcontact|number
(String): The contact or number to send the message tomessage
(String): The content of the message to be sent[sendAt=undefined]
(String): Time to send the message in Unix Time format[expiresAt=undefined]
(String): Time to give up trying to send the message at in Unix Time format
Example
smsGatewaymessage