Writing a Google Voice App

Google Voice is great. Sure its not full of features yet, but seeing as last  week I got my invite after more than a year of waiting, I’ve been pretty excited to start using it. One thing that is lacking about Google Voice is an API. Chad Smith has developed a Firefox Plugin that integrates Google Voice with web browsing. That’s great, but I’ve migrated to Chrome and I’d like to see more applications developed to use the service. Chad has provided some basic documentation of how exactly to access and use Google Voice. You can read that here.

I’ve been playing around with placing calls from Javascript. It’s fairly simply all you need to do is post a JSON request to the proper URL. Below is basic code to make a call. It works, though not 100% of the time. (HTTP Requests to foreign servers are disabled in firefox and seem to be finicky in Chrome). Hopefully this jumpstarts some creative people out there to create a new app for Google Voice.

<script type=”text/javascript” src=”http://www.json.org/json2.js”></script>

<script type=”text/javascript”>

function call(){

var callURL=”https://www.google.com/voice/call/connect/”;

var data=”outgoingNumber=+1##########

&forwardingNumber=+1##########&subscriberNumber=undefined

&remember=0&_rnr_se=(grab this string in the google voice page source)”;

dialer = new XMLHttpRequest();

dialer.open(“POST”, callURL, true);

dialer.setRequestHeader(‘Content-Type’, ‘application/x-www-form-urlencoded;charset=utf-8′);

dialer.setRequestHeader(‘Referer’, ‘https://www.google.com/voice/#inbox’);

dialer.setRequestHeader(‘Content-Length’, data.length);

dialer.send(data);

}

</script>

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • email
  • Furl
  • StumbleUpon
  • Technorati
  1. well, google is going to dominate the world. they have everywhere

  1. August 8th, 2009