New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

messente

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

messente

Node.js client library for Messente group messaging platform

  • 0.4.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
increased by100%
Maintainers
1
Weekly downloads
 
Created
Source

messente

NPM version

Node.js client library (unofficial) for Messente (https://messente.com) group messaging platform, based on Messente API v2. For more information and how to use and setup Messente API, read Messente API documentation.

Setup

npm install messente

Usage

Although Messente API v2 doesn't seem to support multiple recipients per message anymore, but there is a workaround. The message will be sent for every recipient separately.

var messente = require('messente');

// Create a new Messente API
var opts = {
  username: '<api-user>',
  password: '<api-secret>',
  secure: true
};

var client = messente.createClient(opts);

// Compose message
var message = {
  to: [ '+372500000000' ], // You can specify multiple recipients here
  text: 'Hello!'
};

client.sendMessage(message, function(err, result, ids) {
  /**
   * result: [ { error: null,
   *             code: 'b3258850cef53cd8b904a8185d6375c9f7d96369',
   *             phone: '+372500000000' } ]
   *
   *
   *  ids: [ 'b3258850cef53cd8b904a8185d6375c9f7d96369' ]
   *
   */

  if (err) {
    console.log('Error: ' + err.message);
    return;
  }

  console.log('Result: ');
  console.log(result);
});

sendMessage callback will return an array of the delivered messages id's, which can be use to track delivery status.

client.getReport([ 'b3258850cef53cd8b904a8185d6375c9f7d96369' ], function(err, result) {
  /**
    * result: [ { error: null,
    *             code: 'DELIVERED',
    *             report: 'b3258850cef53cd8b904a8185d6375c9f7d96369' } ]
    */

  if (err) {
    console.log('Error: ' + err.message);
    return;
  }

  console.log('Result: ');
  console.log(result);
});

Account balance call.

client.getAccountBalance(function(err, result) {
  if (err) {
    console.log('Error: ' + err.message);
    return;
  }

  console.log('Result: ');
  console.log(result);
});

Running tests

MSNTE_USER=<api user> MSNTE_PWD=<api password> MSNTE_SECURE=true MSNTE_NUMBERS="<comma separated list of numbers>" npm test

Keywords

FAQs

Package last updated on 25 Nov 2016

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