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

exotel

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

exotel

Exotel API helper

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
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

Package last updated on 30 Jul 2014

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