Posts Tagged ‘applications’

New Java based WebApi implementation

Thursday, February 24th, 2011

I’m happy to announce that Tropo finally has a Java based WebAPI implementation.

This implementation will allow every Java developer to create Tropo based applications with a very simple and lightweight API. This API hides all the communication and protocol details, making it much easier to deploy Tropo applications in a Java environment. It can be used with any Java program, including Application Servers like Tomcat, WebSphere or WebLogic as well as stand-alone applications.

As the other WebAPI implementations do, the Java WebAPI library offers a very simple but comprehensive DSL that can be used to create Tropo applications with syntax very close to natural language. However, in contrast to other implementations, the Java WebAPI is statically typed, which means we can catch errors at compile time. This makes it even easier for developers to create Tropo applications. Previous to this implementation, developers who wanted to use Tropo with Java had to create JSON documents by hand, inherently unfriendly and error-prone.

The sources of the Java WebAPI implementation are available from GitHub as usual, including documentation to help get you started. You can download the latest version of this library from the distribution folder, where you will also find all the required dependencies (of which there are not many). Building the Java WebAPI requires Apache Maven and is just a one line: mvn clean install.

There are plenty of examples on the project’s page at GitHub; I’ll share a couple of them now so you can see how easy it is to create Tropo applications in Java. Let’s start with a simple Java Servlet that will be the entry point to our Tropo application. Tropo sends a POST request to our application server each time a person calls a number, sends an SMS to our app, etc. – we just have to implement the doPost method from our Servlet.

protected void doPost(HttpServletRequest request,
                      HttpServletResponse response) 
                         throws ServletException, IOException {

    Tropo tropo = new Tropo();
    tropo.say("Hello from Tropo. This is our first application.");
    tropo.render(response);
}

How cool is that? No JSON, no response handling, just plain and easy Java code! Let’s look at another example – imagine you have a Tropo hosted application, which sends SMS to a number; this number is passed to Tropo as a parameter. You have a Java standalone application that you want to hook into this hosted app, in order to send an SMS based on a particular criteria (like when a file download is finished). You can simply use this Java implementation to launch your hosted application using the application’s token and pass the phone number at the same time. It would be as simple as this:

public void sendSMS(String number) {

    String token = ...
    Tropo tropo = new Tropo();
    Map params = new HashMap();
    params.put("number", number);
    tropo.launchSession(token, params);
}

Finally, the Java WebAPI also offers classes to deal with all results and incoming information from Tropo. For example, checking Tropo’s session object is very easy:

protected void doGet(HttpServletRequest request,
                     HttpServletResponse response) 
                        throws ServletException, IOException {

	Tropo tropo = new Tropo();
	TropoSession session = tropo.session(request);
	System.out.println("Call id: " + session.getCallId());
}

As you can see, writing Tropo applications in Java has never been that easy. We hope you like this new WebAPI implementation!

Get the Tropo sample applications – via git and Github

Tuesday, March 3rd, 2009

githublogo-1.jpgWould you like to easily get your hands on the Tropo sample applications? I mean, you certainly can download them from the Tropo documentation website, but we’ve also made them very easy to download from our account on Github. All you need do to is go to:

http://github.com/voxeo/tropo-samples/tree/master

If you just want to download the sample application files, simply click the “download” button and you’ll have a choice of a ZIP or tar file:

github-download.jpg

Alternatively, if you have the git version control system installed on your computer, you can simply clone our Github repository:

git clone git://github.com/voxeo/tropo-samples.git

That will pull a copy onto your local system. We will be updating the repository quite frequently over the next while, so from time to time you will want to do:

git pull origin master

in your “tropo-samples” directory. That will pull down the changes from our Github repo. If you are already a Github user and want to suggest changes for us, feel free to fork our repo and then request a pull. (And if that last sentence made no sense to you, that’s okay.)

If you would like to learn more about Git, you can watch my Emerging Tech Talk podcasts #24, Learning Git, Part 1: Intro to Version Control Systems and #25, Learning Git, Part 2: Getting Started with Git.

We hope this makes the source code more accessible to you all – please let us know what you think about making code available this way.


If you found this post interesting or helpful, please consider either subscribing via RSS or following us on Twitter.


Technorati Tags: , , , , , ,

Introducing Tropo… a new way to develop voice applications in languages you already know…

Tuesday, March 3rd, 2009

tropo.comlogo.jpgAt Voxeo, we love clouds but we don’t have our heads in them all the time. We realize not every developer wants to write applications in XML. There are lots of developers with lots of ideas, but they want to write their apps in the languages they’re already using. So we decided to do something about it – we created Tropo.

Tropo is an application platform that enables web developers to write communication applications in the languages they already use: Groovy, Ruby, PHP, Python and JavaScript. Tropo is in the cloud, so we manage the headaches of dealing with infrastructure and keeping applications up and running at enterprise-grade. Tropo is simple to deploy, requires no contracts and no up-front setup costs. With Tropo developers can build and deploy voice and telephony applications, or add voice to existing applications.

Previously developers had to write voice applications in VoiceXML. This has left out developers who either did not want to learn VoiceXML, wanted the flexibility of working in other development languages or have been working in VoiceXML for 10 years and are ready for a change.

Already, developers are having fun with the platform… take a look at the sample applications and you’ll see voice mashups that read you various news feeds (or your Google reader)… an app that gives you the ETA of trains on the BART system… location mashups using Yahoo!Local… weather examples… even a Monty Python quote server. (UPDATE: March 2, 2011 – A better place to start today is our Quickstart guide.)

With many applications still to be written and many existing applications that can be enhanced by adding voice, Tropo is unleashing the creativity of the web developer community on the communications world. We can’t wait to see what happens. Please visit www.tropo.com for more information and to sign up to get started today!


If you found this post interesting or helpful, please consider either subscribing via RSS or following us on Twitter.