{"metadata":{"image":[],"title":"","description":""},"api":{"url":"","auth":"required","results":{"codes":[]},"settings":"","params":[]},"next":{"description":"","pages":[]},"title":"Add-Ons Purchase","type":"basic","slug":"add-ons-purchase","excerpt":"","body":"[block:api-header]\n{\n \"title\": \"Use the Add-Ons Purchase API to purchase add-ons\"\n}\n[/block]\nThe Add-Ons Purchase API is used to purchase add-ons within a DialogTech account.\n[block:callout]\n{\n \"type\": \"info\",\n \"title\": \"Base URL for Add-Ons Purchase\",\n \"body\": \"https://secure.dialogtech.com/ibp_api.php\"\n}\n[/block]\n\n[block:api-header]\n{\n \"title\": \"Parameter List\"\n}\n[/block]\n\n[block:parameters]\n{\n \"data\": {\n \"h-0\": \"Parameter\",\n \"h-1\": \"Required\",\n \"h-2\": \"Accepts\",\n \"h-3\": \"Max Length\",\n \"h-4\": \"Notes\",\n \"h-5\": \"Usage\",\n \"0-0\": \"action\",\n \"0-1\": \"Yes\",\n \"0-2\": \"String: **addons.purchase**\",\n \"0-3\": \"n/a\",\n \"0-4\": \"Only accepts **addons.purchase** to purchase add-ons\",\n \"0-5\": \"Defines the API Call as \\\"Add-Ons Purchase\\\" type\",\n \"1-0\": \"access_key\",\n \"1-1\": \"Yes\",\n \"1-2\": \"String\",\n \"1-3\": \"n/a\",\n \"2-0\": \"secret_access_key\",\n \"2-1\": \"Yes\",\n \"2-2\": \"String\",\n \"2-3\": \"n/a\",\n \"1-4\": \"Access Key from the Key Manager within a DialogTech account\",\n \"1-5\": \"Credentials used for access to the API for a particular DialogTech account\",\n \"2-5\": \"Credentials used for access to the API for a particular DialogTech account\",\n \"2-4\": \"Secret Access Key from the Key Manager within a DialogTech account\",\n \"3-0\": \"item_id\",\n \"3-1\": \"Yes\",\n \"3-2\": \"String\",\n \"3-3\": \"n/a\",\n \"3-5\": \"Defines the type of Add-On being purchased\",\n \"4-0\": \"qty\",\n \"4-1\": \"Yes\",\n \"4-2\": \"String\",\n \"4-3\": \"n/a\",\n \"4-4\": \"Quantity of the add-on being purchased\",\n \"4-5\": \"Defines the amount of the add-on being purchased\",\n \"5-0\": \"send_receipt\",\n \"5-1\": \"No\",\n \"5-2\": \"**0** or **1**\",\n \"5-3\": \"1\",\n \"5-4\": \"**0** - Do not send a receipt to the email on file (default)\\n**1** - Send a receipt to the email on file (default)\",\n \"5-5\": \"Sends a receipt to the billing email on file within the account for the purchase\",\n \"3-4\": \"*See Item List Below*\"\n },\n \"cols\": 6,\n \"rows\": 6\n}\n[/block]\n\n[block:api-header]\n{\n \"title\": \"Item List\"\n}\n[/block]\n\n[block:parameters]\n{\n \"data\": {\n \"h-0\": \"item_id\",\n \"h-1\": \"Add-On Name\",\n \"h-2\": \"Description\",\n \"0-0\": \"**1**\",\n \"0-1\": \"Smart Click-to-Call\",\n \"1-0\": \"**2**\",\n \"1-1\": \"Voicemail Box\",\n \"2-1\": \"Tollfree Number\",\n \"2-0\": \"**3**\",\n \"3-0\": \"**4**\",\n \"3-1\": \"Smart Voice Broadcast Port\",\n \"4-0\": \"**5**\",\n \"4-1\": \"Basic Voice Broadcast Port\",\n \"5-0\": \"**6**\",\n \"5-1\": \"Local Number\",\n \"6-0\": \"**8**\",\n \"6-1\": \"Simultaneous FindMe Port\",\n \"7-0\": \"**9**\",\n \"7-1\": \"Queue Slot\",\n \"8-0\": \"**10**\",\n \"8-1\": \"Queues\",\n \"9-0\": \"**14**\",\n \"9-1\": \"Campaign Guest Login\",\n \"10-0\": \"**17**\",\n \"10-1\": \"Canadian Local Number\",\n \"11-0\": \"**18**\",\n \"11-1\": \"True 800 Number\"\n },\n \"cols\": 2,\n \"rows\": 12\n}\n[/block]\n*Note: Other IDs may be available for your account. Any available IDs will return in the results of the [Add-Ons List](doc:add-ons-list) API call\n[block:api-header]\n{\n \"title\": \"Using this API\"\n}\n[/block]\nThese code examples are meant to show a basic method of accessing DialogTech's Add-Ons List API.\n[block:code]\n{\n \"codes\": [\n {\n \"code\": \"<?php\\n /*\\n Add-Ons Purchase\\n This example will purchase 2 \\n Local Number Slot add-ons which can\\n then be used to get a number from the\\n Number Order API\\n */\\n\\n // Create cURL resource\\n $ch = curl_init(); \\n $baseuri = \\\"https://secure.dialogtech.com/ibp_api.php?\\\";\\n\\n // API Specific Static Parameters\\n $action = \\\"addons.purchase\\\";\\n\\n // Required User Parameters To Request the API\\n $access_key = \\\"foo\\\";\\n $secret_access_key = \\\"bar\\\";\\n $item_id = \\\"6\\\";\\n $qty = \\\"2\\\";\\n \\n // Construct the full URL\\n $full_url = $baseuri . \\\"&action=\\\" . $action .\\n \\\"&access_key=\\\" . $access_key .\\n \\\"&secret_access_key=\\\" . $secret_access_key .\\n \\\"&item_id=\\\" . $item_id .\\n \\\"&qty=\\\" . $qty;\\n\\n\\n // Set the URL\\n curl_setopt($ch, CURLOPT_URL, $full_url);\\n\\n // Sets the return options of the cURL to return the actual result from the curl request, and FALSE on failure\\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\\n\\n // Sets the $output variable to the result of the curl\\n $output = curl_exec($ch);\\n\\n // Close curl resource to free up system resources\\n curl_close($ch);\\n\\n // Echo the XML response to the page\\n echo $output;\\n?>\",\n \"language\": \"text\",\n \"name\": \"PHP Example\"\n }\n ]\n}\n[/block]\n**Example Response**\n[block:code]\n{\n \"codes\": [\n {\n \"code\": \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n<!DOCTYPE response [\\n<!ELEMENT response (result,result_description)>\\n<!ELEMENT result (#PCDATA)>\\n<!ELEMENT result_description (#PCDATA)>\\n]>\\n<response>\\n<result>success</result>\\n<result_description>\\n</result_description>\\n</response>\",\n \"language\": \"xml\",\n \"name\": \"xml\"\n }\n ]\n}\n[/block]\n**Example Receipt**\n[block:code]\n{\n \"codes\": [\n {\n \"code\": \"\\t\\nThis is a receipt for charges associated with your DialogTech account (formerly Ifbyphone)\\n\\n==========================================================================\\n\\nRECEIPT\\n\\nMon May 1st, 2017\\nAcct ID: 1014\\n\\n..........................................................................\\n\\nIMPORTANT NOTE:\\n\\nThe charge for DialogTech will appear on your\\n\\ncredit card statement from \\\"IF BY PHONE\\\".\\n\\nDialogTech\\n300 W. Adams, Suite 900\\nChicago, IL 60606 USA\\n\\n\\n\\nBill to:\\n\\nHomer Simpson\\n\\n\\n--------------------------------------------------------------------------\\n\\n\\nAdditional Option: Local Number (qty: 2) Local Number 0.00\\n\\n=========================\\n\\nPro-Rated Total for Options: 0.00\\n\\nRegulatory Recovery Fee: 0.00\\n\\n\\nAmount PAID: 0.00\\n\\n==========================================================================\\n\\nTHANK YOU\\nThanks again for your business!\\nhttp://www.dialogtech.com\\n..........................................................................\",\n \"language\": \"text\",\n \"name\": \"[DialogTech] Receipt For Purchase\"\n }\n ]\n}\n[/block]","updates":[],"order":25,"isReference":false,"hidden":true,"sync_unique":"","link_url":"","link_external":false,"_id":"5908c4ee5399d51b00ef5fd9","githubsync":"","version":{"version":"1.0","version_clean":"1.0.0","codename":"","is_stable":true,"is_beta":false,"is_hidden":false,"is_deprecated":false,"categories":["558d9c33beb7c719007f631d","558db0bc7afc102f008ed863","558db0d07afc102f008ed864","558db3c84cd25f0d00b7ecb2","558dbace7afc102f008ed894","558dbd104cd25f0d00b7ecca","558dbd4c4cd25f0d00b7eccb","559d3e858639bd21008e90a6","55bb8ca5a8400c2d00873e70","58fdfb438fbd2819000db9eb","590829c7ade4172d006a87b8","59082a11beedcf0f00235d87","5908bd2cba2afd23007d6d12","5908d1f64f544425002b6aae","591e5e9e2c1b1f0f000fa4e5","5a283434aba91f002834ea86","5a69fe5cde745d002c936c66","5a81e6ef761cf300127317f8","5a81e7d63b1e120012bed5a1","5f6cf225ba56a40011bff62d","5f970e8b7617eb041ae758bb","602adb88243fbc0056918566","602adbb91828a600535980c4"],"_id":"558d9c33beb7c719007f631c","createdAt":"2015-06-26T18:38:43.154Z","project":"558d9c32beb7c719007f6319","releaseDate":"2015-06-26T18:38:43.153Z","__v":23},"createdAt":"2017-05-02T17:42:06.207Z","parentDoc":null,"__v":0,"category":{"sync":{"isSync":false,"url":""},"pages":[],"title":"Administration APIs","slug":"administration-apis","order":1,"from_sync":false,"reference":false,"_id":"590829c7ade4172d006a87b8","createdAt":"2017-05-02T06:40:07.955Z","project":"558d9c32beb7c719007f6319","__v":0,"version":"558d9c33beb7c719007f631c"},"project":"558d9c32beb7c719007f6319","user":"58cadf93d223510f005d27db"}
Add-Ons Purchase
The Add-Ons Purchase API is used to purchase add-ons within a DialogTech account.
Base URL for Add-Ons Purchase
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
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
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
<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
..........................................................................