Socket
Socket
Sign inDemoInstall

exotel

Package Overview
Dependencies
50
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    exotel

Exotel API helper


Version published
Weekly downloads
2
decreased by-83.33%
Maintainers
1
Install size
3.94 MB
Created
Weekly downloads
 

Readme

Source

Exotel API helper for node

NPM version

Currently supports:

  • Sending SMS
  • Checking SMS status

More features are coming in. Contributions welcome.

Installation

npm install exotel

Usage

var exotel = require('exotel')({
    id   : // exotel id,
    token: // exotel token
});

exotel.sendSMS('9999999999', 'Hi', function (err, res) {
    // ...
});

Documentation

###sendSMS(mobile, msg, [statusCallback], callback) Sends an SMS

####Arguments

  • mobile (String): 10-digit mobile number
  • msg (String): Message body
  • [statusCallback] (String): An optional URL to call when the message reaches a terminal state (delivered or failed)
  • callback (Function): Called as callback(err, result) - where result is a JSON version of the Exotel xml response:
{
    Sid        : '<sms_id>',
    DateUpdated: '2014-07-30 09:44:56',
    DateCreated: '2014-07-30 09:44:56',
    DateSent   : '1970-01-01 05:30:00',
    AccountSid : '<account_id>',
    To         : '<recipient_mobile>',
    From       : '/<account_id>',
    Body       : 'Hi!',
    BodyIndex  : '',
    Status     : '<status>', // "queued", "sending", "sent" .. etc.
    Direction  : 'outbound-api',
    Price      : '',
    ApiVersion : '',
    Uri        : '/v1/Accounts/<account_id>/Sms/Messages/<sms_id>'
}

###checkSMS(sid, callback) Check SMS status

####Arguments

  • sid (String): Sid in sendSMS result
  • callback (Function): Called as callback(err, result) - where result is the same SMS data as above

Testing

Install dev dependencies and run:

EXOTEL_ID=<id> EXOTEL_TOKEN=<token> MOBILE=<recipient> npm test

License

MIT

Keywords

FAQs

Last updated on 30 Jul 2014

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc