Use the Add-Ons Purchase API to purchase add-ons
The Add-Ons Purchase API is used to purchase add-ons within a DialogTech account.
Base URL for Add-Ons Purchase
Parameter List
Parameter | Required | Accepts | Max Length | Notes | Usage |
---|---|---|---|---|---|
action | Yes | String: addons.purchase | n/a | Only accepts addons.purchase to purchase add-ons | Defines the API Call as "Add-Ons Purchase" type |
access_key | Yes | String | n/a | Access Key from the Key Manager within a DialogTech account | Credentials used for access to the API for a particular DialogTech account |
secret_access_key | Yes | String | n/a | Secret Access Key from the Key Manager within a DialogTech account | Credentials used for access to the API for a particular DialogTech account |
item_id | Yes | String | n/a | See Item List Below | Defines the type of Add-On being purchased |
qty | Yes | String | n/a | Quantity of the add-on being purchased | Defines the amount of the add-on being purchased |
send_receipt | No | 0 or 1 | 1 | 0 - Do not send a receipt to the email on file (default) 1 - Send a receipt to the email on file (default) | Sends a receipt to the billing email on file within the account for the purchase |
Item List
item_id | Add-On Name |
---|---|
1 | Smart Click-to-Call |
2 | Voicemail Box |
3 | Tollfree Number |
4 | Smart Voice Broadcast Port |
5 | Basic Voice Broadcast Port |
6 | Local Number |
8 | Simultaneous FindMe Port |
9 | Queue Slot |
10 | Queues |
14 | Campaign Guest Login |
17 | Canadian Local Number |
18 | True 800 Number |
*Note: Other IDs may be available for your account. Any available IDs will return in the results of the Add-Ons List API call
Using this API
These code examples are meant to show a basic method of accessing DialogTech's Add-Ons List API.
<?php
/*
Add-Ons Purchase
This example will purchase 2
Local Number Slot add-ons which can
then be used to get a number from the
Number Order API
*/
// Create cURL resource
$ch = curl_init();
$baseuri = "https://secure.dialogtech.com/ibp_api.php?";
// API Specific Static Parameters
$action = "addons.purchase";
// Required User Parameters To Request the API
$access_key = "foo";
$secret_access_key = "bar";
$item_id = "6";
$qty = "2";
// Construct the full URL
$full_url = $baseuri . "&action=" . $action .
"&access_key=" . $access_key .
"&secret_access_key=" . $secret_access_key .
"&item_id=" . $item_id .
"&qty=" . $qty;
// Set the URL
curl_setopt($ch, CURLOPT_URL, $full_url);
// Sets the return options of the cURL to return the actual result from the curl request, and FALSE on failure
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// Sets the $output variable to the result of the curl
$output = curl_exec($ch);
// Close curl resource to free up system resources
curl_close($ch);
// Echo the XML response to the page
echo $output;
?>
Example Response
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE response [
<!ELEMENT response (result,result_description)>
<!ELEMENT result (#PCDATA)>
<!ELEMENT result_description (#PCDATA)>
]>
<response>
<result>success</result>
<result_description>
</result_description>
</response>
Example Receipt
This is a receipt for charges associated with your DialogTech account (formerly Ifbyphone)
==========================================================================
RECEIPT
Mon May 1st, 2017
Acct ID: 1014
..........................................................................
IMPORTANT NOTE:
The charge for DialogTech will appear on your
credit card statement from "IF BY PHONE".
DialogTech
300 W. Adams, Suite 900
Chicago, IL 60606 USA
Bill to:
Homer Simpson
--------------------------------------------------------------------------
Additional Option: Local Number (qty: 2) Local Number 0.00
=========================
Pro-Rated Total for Options: 0.00
Regulatory Recovery Fee: 0.00
Amount PAID: 0.00
==========================================================================
THANK YOU
Thanks again for your business!
http://www.dialogtech.com
..........................................................................