Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
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(from, to, '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
The npm package flowroute-sms receives a total of 6 weekly downloads. As such, flowroute-sms popularity was classified as not popular.
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.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.