Giter VIP home page Giter VIP logo

telapi-nodejs's Introduction

telapi-nodejs

This node.js library is an open source tool built to simplify interaction with the TelAPI telephony platform. TelAPI makes adding voice and SMS to applications fun and easy.

For more information about TelAPI, please visit: telapi.com/features or telapi.com/docs


Installation

Via npm

npm install telapi

Via GitHub clone

Access terminal and run the following code:

	$ cd ~
	$ git clone https://github.com/TelAPI/telapi-nodejs.git telapi-nodejs
    $ npm install ./telapi-nodejs

Usage

REST

TelAPI REST API documenatation

Send SMS Example
var util = require("util");
var Client = require('telapi').client;
 
var client = new Client(
    '{AccountSid}', 
    '{AuthToken}'
);
 
var options = {
    "From": "(XXX) XXX-XXXX", // This should be a number setup through your TelAPI account
    "To": "(XXX) XXX-XXXX",
    "Body": "SMS message sent from the TelAPI Node.JS helper!"
};

client.create("sms_messages", options, function (response) {
        util.log(
            "SmsMessage SID: " +  response.sid
        );
    },
    function (error) {
        util.log("Error: " + error)
    }
); 

InboundXML

InboundXML is an XML dialect which enables you to control phone call flow. For more information please visit the TelAPI InboundXML documenatation

Example
var util = require("util");
 
// Get TelAPI InboundXML helper
var InboundXML = require('telapi').inboundxml;
 
// Initialize TelAPI response element. This is A MUST!
var response = new InboundXML.Response();
 
response.append(
    new InboundXML.Say(
        'Welcome to TelAPI. This is a sample InboundXML document.',
        { voice : 'man'}
    )
);
 
util.log("\n\nInboundXML Say Element: \n\n" + response.toString()) 

will render

<?xml version="1.0" encoding="UTF-8"?>
<Response>
  <Say voice="man">Welcome to TelAPI. This is a sample InboundXML document.</Say>
</Response>

telapi-nodejs's People

Contributors

0x19 avatar paul-english avatar taterbase avatar mattwilliamson avatar natekap avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.