
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
sms-gateway-nodejs
Advanced tools
A library to interact with SMS Gateway API.
npm install --save sms-gateway-nodejs
Initialization
emailAddress
(String): Your smsgateway usernamepassword
(String): Your smsgateway passwordsmsGateway = require('sms-gateway-nodejs')('ntrinquier@provider.com', 'p4ssw0rd')
Contact
Device
Messages
listOfMessages
fetchSingleMessage
sendMessageToNumber
sendMessageToNumbers
sendMessageToContact
sendMessageToContacts
sendMessagesToRecipients
“Contacts” Methods
createContact(page)
Create a contact.
name
(String): The contact's namenumber
(String): The contact's numbersmsGateway.contact.createContact('Nicolas', '+33612121212')
.then((response) => {
// do something with response
})
.catch((error) => {
// handle error
})
listOfContacts(page)
Get a list of the contacts.
page
(String): The page numbersmsGateway.contact.listOfContacts(2)
.then((response) => {
// do something with response
})
.catch((error) => {
// handle error
})
fetchSingleContact(id)
Get a specific contact.
id
(String): The contact IDsmsGateway.contact.fetchSingleContact(2182)
.then((response) => {
// do something with response
})
.catch((error) => {
// handle error
})
“Devices” Methods
listOfDevices(page)
Get a list of the devices.
page
(String): The page numbersmsGateway.device.listOfDevices(2)
.then((response) => {
// do something with response
})
.catch((error) => {
// handle error
})
fetchSingleDevice(id)
Get a specific device.
id
(String): The device IDsmsGateway.device.fetchSingleDevice(2182)
.then((response) => {
// do something with response
})
.catch((error) => {
// handle error
})
“Messages” Methods
listOfMessages(page)
Get a list of the messages.
page
(String): The page numbersmsGateway.message.listOfMessages(2)
.then((response) => {
// do something with response
})
.catch((error) => {
// handle error
})
fetchSingleMessage(id)
Get a specific message.
id
(String): The message IDsmsGateway.message.fetchSingleMessage(2182)
.then((response) => {
// do something with response
})
.catch((error) => {
// handle error
})
sendMessageToNumber(device, number, message, [sendAt], [expiresAt])
Send a message to a number.
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 formatsmsGateway.message.sendMessageToNumber('2012', '+33123456789', 'Hello world :)')
.then((response) => {
// do something with response
})
.catch((error) => {
// handle error
})
sendMessageToNumbers(device, numbers, message, [sendAt], [expiresAt])
Send a message to numbers.
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 formatsmsGateway.message.sendMessageToNumbers('2012', ['+33123456789', '+33987654321'], 'Penguins rock!')
.then((response) => {
// do something with response
})
.catch((error) => {
// handle error
})
sendMessageToContact(device, contact, message, [sendAt], [expiresAt])
Send a message to a contact.
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 formatsmsGateway.message.sendMessageToContact('2012', '30', 'Hello world :)')
.then((response) => {
// do something with response
})
.catch((error) => {
// handle error
})
sendMessageToContacts(device, contacts, message, [sendAt], [expiresAt])
Send a message to contacts.
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 formatsmsGateway.message.sendMessageToContacts('2012', ['5', '30'], 'Penguins rock!')
.then((response) => {
// do something with response
})
.catch((error) => {
// handle error
})
sendMessagesToRecipients(data)
Send messages to numbers or contacts.
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 formatsmsGateway.message.sendMessagesToRecipients([{
device: '2190',
contact: '42',
message: 'Hi!',
}, {
device: '2109',
number: '+33123456789',
message: 'Hello!',
}])
.then((response) => {
// do something with response
})
.catch((error) => {
// handle error
})
FAQs
A library to interact with SMS Gateway API.
We found that sms-gateway-nodejs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.