0.0.2 • Published 5 years ago

flowroute-messaging-api v0.0.2

Weekly downloads
3
License
Apache-2.0
Repository
github
Last release
5 years ago

Flowroute Messaging API

Simple API for communicating with the Flowroute Messaging service (both SMS & MMS).

Other Projects

This project is only part of the entire Flowroute API. Other projects are:

ProjectDescription
flowroute-sms-apiSMS Messaging
flowroute-mms-apiMMS Messaging
flowroute-messaging-apiSMS & MMS Messaging

Installation

npm i --save flowroute-messaging-api

Variables

NameData Type / FormatRequiredDescription
fromString('nnnnnnnnnnn')YESSender DID in E.164 format
toString('nnnnnnnnnnn')YESRecipient DID in E.164 format
bodyStringYES160 ASCII characters or 70 extended ASCII characters
links[String]NOArray of URLs to hosted media items
callbackUrlStringNOURL of server receiving ack messages
accessKeyString('n*')YESProvided by Flowroute API Preferencess page.
secretKeyStringYESProvided by Flowroute API Preferencess page.

Example

const flowroute = require('flowroute-messaging-api');
const params = require('./params.json');

const { to, from, body, links, callbackUrl, accessKey, secretKey } = params;

flowroute.send(to, from, body, links, callbackUrl, accessKey, secretKey, (err, info) => {
  if (err) { throw err; }
  console.log(JSON.stringify(info, null, 2));
})

Successful Response

{
  "id": "mdr2-32889a4a82e011e78f288637582574e3"
}

Optional Variables

Two optional variables exist for the send method:

VariablePurpose
linksArray of valid URLs pointing to hosted images, media files, or other attachments.
callbackUrlURL of a service endpoint listening for Flowroute's status callback.

Author Info

This project has been created for my personal use. It is maintained. Feel free to use it at your leisure. If you need help, either open an issue or get in touch directly:

Fred Lackey
fred.lackey@gmail.com
www.fredlackey.com