A Ruby library for interaction with the Tropo Provisioning API (http://tropo.com) using JSON.
The Provisioning API provides a programmatic method to access the Tropo Provisioning Database, which is the centralized server that contains all of your applications, phone numbers, IM network information, tokens and so on. Previously, in order to create/delete applications, add/remove addresses (phone and SMS numbers, IM Accounts and tokens), or view available exchanges (area codes and their associated regions) you would need to log into the Tropo website and make your changes through your web browser. That poses a problem for an external program that needs access to your account and applications.
As an example, say you're a phone system provider - someone who creates and hosts an IVR system for doctor's offices, school systems and so on. If you wanted to provide your customers with a method to purchase additional phone numbers via a website or similar portal, you would need to provide your purchasing system with access to our Provisioning Server to create and publish the new phone number. Without the Provisioning API, you would have to manually log into the Tropo website, add the phone number to the application, then provide the customer with the new number directly. With the Provisioning API, you're able to send the request directly to the Provisioning Server through your portal, create the phone number, publish it and provide it back to your customer without any manual interaction whatsoever.
The Provisioning API is a RESTful Web Service that utilizes HTTP and JSON to allow for communication back and forth between an application and the Provisioning Server.
The Tropo Provisioning gem provides a library for convenient access to the Tropo Provisioning API.
-
Unit tests passed on: Ruby MRI v1.8.6/1.8.7, Ruby 1.9.2 and JRuby 1.6.3
-
RubyGems: Check tropo-provisioning.gemspec
$ gem install tropo-provisioning
Any HTTP method can be accessed using the TropoProvisioning wrapper:
require 'rubygems'
require 'tropo-provisioning'
tp = TropoProvisioning.new('username', 'password')
app_id = tp.create_application({ :name => 'My Shiny New App',
:voiceUrl => 'http://mydomain.com/voice_script.rb',
:partition => 'staging',
:messagingUrl => 'http://mydomain.com/message_script.rb',
:platform => 'scripting' })
address_data = tp.create_address(app_id, { :type => 'did', :prefix => '1415' })
result = tp.delete_address(app_id, address_data['number'])
tp.delete_application(app_id)
http://voxeo.github.com/tropo-webapi-ruby
git clone https://github.com/tropo/tropo-provisioning
cd tropo-provisioning
bundle install
rake rdoc
$ gemserver
Install the Yard Doc (http://yardoc.org) gem:
$ sudo gem install yardoc
From within the project:
$ yardoc
Copyright (c) 2014 Tropo, Inc. See LICENSE for details.