Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
flowroute-sms
Advanced tools
Send SMS messages using Flowroute's v2 Messaging API.
npm install flowroute-sms
There are two ways to configure the client: environment variables, or passing credentials when the client is instantiated. The values for access key and secret key can be found in the Flowroute Manager.
FLOWROUTE_KEY
- your Flowroute Access KeyFLOWROUTE_SECRET
- your Flowroute Secret KeyIf these environment variables are set, the client can be instantiated without specifying any values (see following section).
var FlowrouteSMS = require('flowroute-sms');
var client = new FlowrouteSMS(accessKey,secretKey);
The new
keyword is optional. So, this could be shortened as:
var SMS = require('flowroute-sms')(accessKey,secretKey);
var from = '18185551234';
var to = '12135559090';
client.send(to, from, 'Hello World!')
.then(function(result){
console.log('Sent message',result.id);
});
Note that send
(and other methods) return an ES6 Promise.
Fetch information for a single message ID.
client.lookup('mdr1-a6abeaedcafe4bd79841c5477b65fcba')
.then(function(result){
console.log(result);
});
If successful, this will return an object:
{
"attributes": {
"body": "The eagle has landed.",
"direction": "outbound",
"timestamp": "2016-06-04T07:14:00.538022+00:00",
"amount_nanodollars": 4000000,
"from": "18185551234",
"message_encoding": 0,
"has_mms": false,
"to": "12135559999",
"amount_display": "$0.0040",
"callback_url": null,
"message_type": "long-code"
},
"type": "message",
"id": "mdr1-a6abeaedcafe4bd79841c5477b65fcba"
}
var start = '2016-06-03';
var end = new Date();
var limit = 10;
var offset = 0;
client.search(start,end,limit,offset)
.then(function(results){
console.log(results);
});
If successful, this method will return an array of message objects in the
format returned by the lookup
method.
Notes: As per
the documentation,
start
and end
parameters can be strings in the following formats: YYYY-MM-DD
,
an ISO8601-style date like YYYY-MM-DDTHH:mm:ss.SSZ
, or a Javascript Date
object.
limit
is optional and defaults to 250. offset
is optional and defaults to zero.
request
dependency (could be implemented with native nodejs libraries)FAQs
Send SMS messages using Flowroute's v2 Messaging API
We found that flowroute-sms 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.