Skip to content

TelAPI/telapi-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 

Repository files navigation

PLEASE NOTE THAT THIS LIBRARY IS NOT ACTIVELY MAINTAINED BY TELAPI

telapi-java

This java 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

See http://telapi.github.com/telapi-java/apidocs/ for documentation on all methods available with this library.


Installation

To use this library, include the following dependency:

<dependency>
  <groupId>com.telapi.api</groupId>
  <artifactId>telapi-java</artifactId>
  <version>0.0.1</version>
</dependency>

Or clone the repo, and install via maven:

$ git clone [email protected]:TelAPI/telapi-java.git
$ cd telapi-java
$ mvn install

Usage

REST

TelAPI REST API documenatation

Send SMS Example
package com.telapi.api.example;
 
import com.telapi.api.TelapiConnector;
import com.telapi.api.configuration.BasicTelapiConfiguration;
import com.telapi.api.domain.SmsMessage;
import com.telapi.api.exceptions.TelapiException;
 
public class SendSmsExample {
    public static void main(String[] args) {
        BasicTelapiConfiguration conf = new BasicTelapiConfiguration();
        conf.setSid("********************************");
        conf.setAuthToken("********************************");
        TelapiConnector conn = new TelapiConnector(conf);
 
        try {
            SmsMessage smsMessage = conn.sendSmsMessage(
                "(XXX) XXX-XXXX",
                "(XXX) XXX-XXXX",
                "This is an SMS message sent from the TelAPI Java helper! Easy as 1, 2, 3!",
                null
            );
            System.out.println(smsMessage.getSid());
        } catch (TelapiException e) {
            e.printStackTrace();
        }
    }
}         

InboundXML

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

Example
package com.telapi.api.inboundxml.example;
 
import com.telapi.api.inboundxml.elements.Response;
import com.telapi.api.inboundxml.elements.enums.Voice;
 
public class SayExample {
 
public static void main(String[] args) {
 
    Response.create()
        .say("Welcome to TelAPI. This is a sample InboundXML document.", Voice.MAN)
        .createXml();
 
    }
 
}   

will render

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages