API & Integrations for Cloud Communications
Authentication
Step 1. Generate an API Key from the Admin Portal and copy it to a secure location.
Step 2. The API Key generated from the Admin Portal must be sent as part of the API request in the header field X-AMPTELECOM-API-KEY.
Active Calls
See all active calls.
GET https://ampapi.amptelecom.com/activecalls
No Parameters
curl -H "X-AMPTELECOM-API-KEY: ##API KEY GENERATED FROM PORTAL##" \ https://ampapi.amptelecom.com/activecalls
$curl = curl_init(); $ampkey = "## API KEY GENERATED FROM PORTAL ##"; $url = 'https://ampapi.amptelecom.com/activecalls'; $header = array( 'Content-Type: application/json', 'X-AMPTELECOM-API-KEY: ' . $ampkey ); $ch = curl_init(); curl_setopt($ch, CURLOPT_HTTPHEADER, $header); curl_setopt($ch, CURLOPT_POST, false); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $result = curl_exec($ch); curl_close($ch);
import requests ampapikey = "### API KEY GENERATED FROM PORTAL ###" url = 'https://ampapi.amptelecom.com/activecalls' headers = {"Content-type": "application/json", "X-AMPTELECOM-API-KEY": ampapikey} response = requests.get(url,data = data, headers = headers)
Call History
See from 0 (same day) to 90 days of call history.
POST https://ampapi.amptelecom.com/callhistory
Parameters:
days
An integer from 0 to 90 that represents how may days you want to go back in the call history log.
Optional Field. Must be an integer from 0 to 90.
Default: 0
timezone
This field specifies the timezone to use for the dates and times listed in the call history.
Optional Field. String containing a valid timezone location such as America/New_York, GMT, Europe/Paris, etc.
Default: GMT
curl -X POST \ -H "X-AMPTELECOM-API-KEY: ##API KEY GENERATED FROM PORTAL##" \ -H "Content-type: application/json" \ -d '{"days": 21, "timezone":"America/Chicago"}' \ https://ampapi.amptelecom.com/callhistory
$curl = curl_init(); $ampkey = "## API KEY GENERATED FROM PORTAL ##"; $url = 'https://ampapi.amptelecom.com/callhistory'; $data = '{"days": 21, "timezone":"America/Chicago"}'; $header = array( 'Content-Type: application/json', 'X-AMPTELECOM-API-KEY: ' . $ampkey ); $ch = curl_init(); curl_setopt($ch, CURLOPT_HTTPHEADER, $header); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); $result = curl_exec($ch); curl_close($ch);
import requests ampapikey = "### API KEY GENERATED FROM PORTAL ###" url = 'https://ampapi.amptelecom.com/callhistory' data = '{"days": 21, "timezone":"America/Chicago"}' headers = {"Content-type": "application/json", "X-AMPTELECOM-API-KEY": ampapikey} response = requests.post(url,data = data, headers = headers)
Originate / Make Call
Place a call from valid user extension to an extension or telephone destination.
POST https://ampapi.amptele.com/originate
Parameters:
extension
The extension number of the caller.
Required Field.
Default: null
destination
The extension number or telephone number to be called.
Required Field. Any numeric numbers. Calls to telephone numbers outside of the North American Numbering Plan must start with 011 and International Calling must be enabled.
autoanswer
Used to instruct the caller’s telephone, softphone, or other device to go off-hook when the call is made to the destination. When autoanswer is set to true, the callers phone will immediately go off-hook during the call. Otherwise, the caller’s phone will ring while the destination number is being called and need to be answered as soon as possible by the caller. Some telephones and devices may not autoanswer regardless of this setting.
Boolean. Optional Field. Accepted values: true, false
Default: true
followme
Choose whether (true) or not (false) to honor the originator’s follow-me forwarding plan.
Boolean. Optional Field. Accepted values: true, false
Default: false
curl -X POST \ -H "X-AMPTELECOM-API-KEY: ##API KEY GENERATED FROM PORTAL##" \ -H "Content-type: application/json" \ -d '{"extension": 1001, "destination":15125551212,"autoanswer":true}' \ https://ampapi.amptelecom.com/originate
$curl = curl_init(); $ampkey = "## API KEY GENERATED FROM PORTAL ##"; $url = 'https://ampapi.amptelecom.com/originate'; $data = '{"extension": 1001, "destination":15125551212,"autoanswer":true}'; $header = array( 'Content-Type: application/json', 'X-AMPTELECOM-API-KEY: ' . $ampkey ); $ch = curl_init(); curl_setopt($ch, CURLOPT_HTTPHEADER, $header); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); $result = curl_exec($ch); curl_close($ch);
import requests ampapikey = "### API KEY GENERATED FROM PORTAL ###" url = 'https://ampapi.amptelecom.com/originate' data = '{"extension": 1001, "destination":15125551212,"autoanswer":true}' headers = {"Content-type": "application/json", "X-AMPTELECOM-API-KEY": ampapikey} response = requests.post(url,data = data, headers = headers)
Stored Files
Retrieve a list of all stored files for your organization.
GET https://ampapi.amptele.com/storedfiles
No Parameters
curl -H "X-AMPTELECOM-API-KEY: ##API KEY GENERATED FROM PORTAL##" \ https://ampapi.amptelecom.com/storedfiles
$curl = curl_init(); $ampkey = "## API KEY GENERATED FROM PORTAL ##"; $url = 'https://ampapi.amptelecom.com/storedfiles'; $header = array( 'Content-Type: application/json', 'X-AMPTELECOM-API-KEY: ' . $ampkey ); $ch = curl_init(); curl_setopt($ch, CURLOPT_HTTPHEADER, $header); curl_setopt($ch, CURLOPT_POST, false); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $result = curl_exec($ch); curl_close($ch);
import requests ampapikey = "### API KEY GENERATED FROM PORTAL ###" url = 'https://ampapi.amptelecom.com/storedfiles' headers = {"Content-type": "application/json", "X-AMPTELECOM-API-KEY": ampapikey} response = requests.get(url,data = data, headers = headers)
GET https://ampapi.amptele.com/storedfile/## FILEID ##
No Parameters
curl -H "X-AMPTELECOM-API-KEY: ##API KEY GENERATED FROM PORTAL##" \ https://ampapi.amptelecom.com/storedfile/## STORED FILE ID ##
$curl = curl_init(); $fileid = "### FILE ID RETRIEVED FROM PREVIOUS API CALL TO STOREDFILES ###"; $ampkey = "## API KEY GENERATED FROM PORTAL ##"; $url = 'https://ampapi.amptelecom.com/storedfile/' . $fileid; $header = array( 'Content-Type: application/json', 'X-AMPTELECOM-API-KEY: ' . $ampkey ); $ch = curl_init(); curl_setopt($ch, CURLOPT_HTTPHEADER, $header); curl_setopt($ch, CURLOPT_POST, false); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $result = curl_exec($ch); curl_close($ch);
import requests ampapikey = "### API KEY GENERATED FROM PORTAL ###" fileid = "### FILE ID RETRIEVED FROM PREVIOUS API CALL TO STOREDFILES ###" url = 'https://ampapi.amptelecom.com/storedfile/' + fileid headers = {"Content-type": "application/json", "X-AMPTELECOM-API-KEY": ampapikey} response = requests.get(url,data = data, headers = headers)
GET https://ampapi.amptele.com/storedfile/## FILEID ##/delete
No Parameters
curl -H "X-AMPTELECOM-API-KEY: ##API KEY GENERATED FROM PORTAL##" \ https://ampapi.amptelecom.com/storedfile/## STORED FILE ID ##/delete</p>
$curl = curl_init(); $fileid = "### FILE ID RETRIEVED FROM PREVIOUS API CALL TO STOREDFILES ###"; $ampkey = "## API KEY GENERATED FROM PORTAL ##"; $url = 'https://ampapi.amptelecom.com/storedfile/' . $fileid . '/delete'; $header = array( 'Content-Type: application/json', 'X-AMPTELECOM-API-KEY: ' . $ampkey ); $ch = curl_init(); curl_setopt($ch, CURLOPT_HTTPHEADER, $header); curl_setopt($ch, CURLOPT_POST, false); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $result = curl_exec($ch); curl_close($ch);
import requests ampapikey = "### API KEY GENERATED FROM PORTAL ###" fileid = "### FILE ID RETRIEVED FROM PREVIOUS API CALL TO STOREDFILES ###" url = 'https://ampapi.amptelecom.com/storedfile/' + fileid + '/delete' headers = {"Content-type": "application/json", "X-AMPTELECOM-API-KEY": ampapikey} response = requests.get(url,data = data, headers = headers)
Text Message
Send a text message to an SMS or SIP-Messaging enabled number.
POST https://ampapi.amptelecom.com/message
Parameters:
from
An Amp Telecom SMS enabled telephone number. This number should start with the country code. For example, a U.S. telephone number would have the format 1512XXXXXXX.
Required Field.
recipients
An array of destination SMS enabled telephone numbers.
Required Field. Each destination should include the country code. For example, a U.S. telephone number would have the format 1512XXXXXXX.
text
A short text message intended for each destination in the recipients array.
Required Field.
curl -X POST \ -H "X-AMPTELECOM-API-KEY: ##API KEY GENERATED FROM PORTAL##" \ -H "Content-type: application/json" \ -d '{"from":15125558888, "recipients":[15125551212],"text":"Hello World!"}' \ https://ampapi.amptelecom.com/message
$curl = curl_init(); $ampkey = "## API KEY GENERATED FROM PORTAL ##"; $url = 'https://ampapi.amptelecom.com/message'; $data = '{"from": 15125558888, "recipients":[15125551212],"text":"Hello World!"}'; $header = array( 'Content-Type: application/json', 'X-AMPTELECOM-API-KEY: ' . $ampkey ); $ch = curl_init(); curl_setopt($ch, CURLOPT_HTTPHEADER, $header); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); $result = curl_exec($ch); curl_close($ch);
import requests ampapikey = "### API KEY GENERATED FROM PORTAL ###" url = 'https://ampapi.amptelecom.com/message' data = '{"from": 15125558888, "recipients":[15125551212],"text":"Hello World!"}' headers = {"Content-type": "application/json", "X-AMPTELECOM-API-KEY": ampapikey} response = requests.post(url,data = data, headers = headers)