WebAPI: Now with outbound and transcription

May 6th, 2010 by Adam Kalsey

When we released the new WebAPI last month, two things were missing. You couldn’t make an outbound call and transcription wasn’t available for recordings. Today we’ve added some things to make working with text and IM easier and brought parity to the Web and Scripting APIs, ensuring both have all the same features. So whether you want to host yourself and communicate over JSON or like the simplicity of our hosted Scripting API, you can do all the same things.

Here’s what’s new:

  • Outbound calls no longer require “Channel” parameter.
  • Quickly send a text message with new “message” feature
  • Outbound calling and messaging from the Web API
  • Transcriptions on the WebAPI
  • Sweden and Italy

No Channel required

When sending a text message or instant message, you need to provide call() with the network you want to send it out on. Previously we required you to also tell us if it was a voice or text channel. Obviously, if it’s an SMS message, it’s a text channel and not voice, so we’ve added defaults to the channel parameter. Now you can save a few keystrokes and just do this (JavaScript shown):

call('tel:+14075551212',{network:'SMS'});

Send a Message()

One thing people use Tropo’s text features for a lot is alerting. Sending a quick message out used to require that you set up a call, then say() something on that call and finally hang up the call. You can still do that if you want, but now you can do it all in one step;

<?php
message("Home team just scored. It's now Home: 4, Visitors: 1", array('network'=>'SMS', 'to'=>'14075551212'));
?>

Quick and easy, just fire off a message. This also comes in very handy if you want to fire of a text message while your application is on a voice call.

<?php
answer();
say('Thanks for calling the Tropo information service. Sending you a text message now.');
message('Here is what you were looking for...', array('network'=>'SMS', 'to'=>$currentCall->callerID));
?>

For reference, you can take a look at the message docs on either the Scripting or WebAPI.

Outward Bound

The session API can now kick off a WebAPI call. When you pass in the token for your WebAPI application, Tropo will now POST the JSON for the call to your URL so you can handle it. You can now respond to these POST requests with a new call element in the JSON.

{"tropo":[
   {"call":{
       "to":"tel:+13055195825"
   }},
   {"say":{
       "value":"Welcome to Tropo."
   }},
]}

For a full list of what options you can provide the call element, check out the WebAPI documentation for Call and the Session API.

Transcriptionist

When you record a caller’s input, you can now request that it be transcribed to text. Our transcription API can email you the text of the recording or POST it to the URL of your choosing.

{"tropo":[
   {"record":{
        "beep":true,
        "say":{
            "value":"I'm not here right now. Record your message after the beep."
        },
        "transcription": {
            "url":"mailto:you@example.com"
        }
    }},
]}

You can even pass in an ID that we’ll give to you when we hand you the transcription so you can tell different transcriptions apart. As always, the docs have the details on how to use a URL instead of email and all the other options you’ve got.

The new features are available for development applications today. The production servers will get upgraded in the near future, after we’ve seen the new code put through its paces on some developer applications.

And finally, we’ve added numbers in Sweden and Italy to our pool, allowing developers to purchase local numbers in those countries. Like elsewhere outside the US, these numbers can only be added to production accounts.

Related posts:

  1. Outbound Apps – How They Work in Scripting vs WebAPI
  2. How-To: Sending an SMS using WebAPI
  3. Sending outbound SMS with Java
  4. Python Tropo WebAPI Library Now Available in PyPI for Easy Installation
  5. Sending Outbound SMS with C#

Tags: , , , , , ,

Leave a Reply

Please note: By submitting a comment you agree to comply with our Comment Policy. We welcome all comments, positive or negative, but do reserve the right to remove all or part of blog comments that do not comply with our policy.

Additionally, the first time you leave a comment on this blog, it will be held for moderation. After that first comment has been approved, future comments will be posted without delay.

Additional comments powered by BackType