Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

movile-messaging

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

movile-messaging

Simple node.js wrapper for Movile's Messaging API

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

movile-messaging

Node.js wrapper for Movile's SMS Messaging API.

You will need your own UserName and AuthenticationToken to make API calls.

Note that most optional parameters are missing in this module, I'm working on it. PR's are welcome as well 😉

Usage example:

const Movile = require('movile-messaging');
const sms = new Movile('YOUR_USER_NAME', 'YOUR_AUTH_TOKEN');

sms.getStatus('9cb87d36-79af-11e5-89f3-1b0591cdf807')
.then(response => console.log(response.data))   // do something with this data
.catch(err => console.error(err));              // your error handling
res.render('index', { title: 'Movile Messaging Example' });

Methods:

send(destination, messageText)

Send SMS message to a single endpoint.

  • destination: Phone number with country code and area code. Example: '5519998765432'
  • messageText: The message string to be sent. If it's too long, it will be split into multiple messages.

Example:

sms.send('5519998765432', 'Your text here');

Expected response body:

{
  "id":"9cb87d36-79af-11e5-89f3-1b0591cdf807"
}

sendBulk(numbers, messageText)

Send the same SMS message to many endpoints at once.

  • numbers: Array of phone numbers, just like destination in the send method.
  • messageText: The message string to be sent. If it's too long, it will be split into multiple messages.

Example:

sms.sendBulk(['5519988887777', '5535989890000'], 'Your text here');

Expected response body:

{
  "id":"317b925a-79b0-11e5-82d3-9fb06ba220b3",
  "messages":[
    {
      "id":"715773da-79b0-11e5-afc8-dfdd0dedf87a"
    },
    {
      "id":"717fb4bc-79b0-11e5-819e-57198aac792e"
    }
  ]
}

getStatus(id)

Check the delivery status of a single message.

  • id: ID of a message, obtained when it is sent.

Example:

sms.getStatus('8f5af680-973e-11e4-ad43-4ee58e9a13a6');

Expected response body:

{
  "id":"8f5af680-973e-11e4-ad43-4ee58e9a13a6",
  "carrierId":5,
  "carrierName":"TIM",
  "destination":"5519900001111",
  "sentStatusCode":2,
  "sentStatus":"SENT_SUCCESS",
  "sentStatusAt":1420732929252,
  "sentStatusDate":"2015-01-08T16:02:09Z",
  "deliveredStatusCode":4,
  "deliveredStatus":"DELIVERED_SUCCESS",
  "deliveredAt":1420732954000,
  "deliveredDate":"2015-01-08T16:02:34Z",
  "campaignId":1234
}
  • Note that phone numbers from OI carrier will not return DELIVERED_SUCCESS status even if the SMS was successfully received.
  • Delivery status data is only retained in Movile's backend for a few days, so you may want to store this data somewhere else.

Special thanks to @mCodex

Keywords

FAQs

Package last updated on 25 Feb 2017

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc