PBXCLOUD API

PBXCloud API

PBXCloud API

OBS: API er desværre ikke noget vi kan supportere på.

API is a way to manage your PBX Cloud from external softwares. It allows easy access to calls, phone status and more. It allows also to create, delete and edit records, even if in a limited way.

API can be used by using an API key generated in the Configuration/Settings page. Two kinds of keys can be generated, one allowing Read/Write access and one allowing only read-only operations.

The latest syntax for the operations can be retrieved here: 

Some usage examples (please note the URL can be slightly different then your account)


DIAL / Call an extension and then dial a number

https://portal.pbxcloud.eu/pbx/proxyapi.php?key=NLbP7GFNVRqu9SDm&reqtype=DIAL&source=402&dest=9922323232&tenant=DEMO&account=402-DEMO

This command returns a call id like:

Success|Originate successfully queued|15a4cfe6429054|

The call id can be used to retrieve the recording with

https://portal.pbxcloud.eu/pbx/proxyapi.php?key=NLbP7GFNVRqu9SDm&reqtype=INFO&info=recording&id=15a4cfe6429054

You can provide variables to the dial plan, by using the var parameter like:

https://portal.pbxcloud.eu/pbx/proxyapi.php?key=NLbP7GFNVRqu9SDm&reqtype=DIAL&source=402&dest=9922323232&tenant=DEMO&account=402-DEMO&var=callid%3D453131

%3D is the URL encoded equivalent of =

The variable will be available in the dial plan as "TENANTCODE-variable". In this example as DEMO-callid


AGENT / Pause agent from queue
https://portal.pbxcloud.eu/pbx/proxyapi.php?key=NLbP7GFNVRqu9SDm&reqtype=AGENT&action=PAUSE&queue=281&extension=104-DEMO&tenant=DEMO&pausereason=Breakfast


MEDIAFILE / Retrieve a media file by its ID
https://portal.pbxcloud.eu/pbx/proxyapi.php?key=NLbP7GFNVRqu9SDm&reqtype=MEDIAFILE&tenant=DEMO&id=19&action=GETAUDIO&objectid=3619


VOICEMAIL
Get all voicemails for a tenant
https://portal.pbxcloud.eu/pbx/proxyapi.php?key=NLbP7GFNVRqu9SDm&reqtype=VOICEMAIL&tenant=DEMO&action=list


Get info about voicemails in a mailbox
https://portal.pbxcloud.eu/pbx/proxyapi.php?key=NLbP7GFNVRqu9SDm&reqtype=VOICEMAIL&tenant=DEMO&mailbox=102&action=messages


Get the binary audio for a message
https://portal.pbxcloud.eu/pbx/proxyapi.php?key=NLbP7GFNVRqu9SDm&reqtype=VOICEMAIL&tenant=DEMO&mailbox=102&action=message&msgid=1475685709-00000004


COUNTCALLS / Count the calls on a system
https://portal.pbxcloud.eu/pbx/proxyapi.php?key=NLbP7GFNVRqu9SDm&reqtype=COUNTCALLS


INFO

Get the cdr for a tenant in CSV format
https://portal.pbxcloud.eu/pbx/proxyapi.php?key=NLbP7GFNVRqu9SDm&reqtype=INFO&info=CDRS&format=csv&tenant=DEMO&start=2017-01-01&end=2017-02-01


Get the cdr for all tenants in CSV format
https://portal.pbxcloud.eu/pbx/proxyapi.php?key=NLbP7GFNVRqu9SDm&reqtype=INFO&info=CDRS&format=csv&tenant=%&start=2017-01-01&end=2017-02-01

Please note, when getting the CSV for a single tenant, the CSV format used is the tenant one, when getting the CSV for multiple tenants, the Admin format is used.


Get the queue log for a tenant in CSV format
https://portal.pbxcloud.eu/pbx/proxyapi.php?key=NLbP7GFNVRqu9SDm&reqtype=INFO&info=QUEUELOGS&format=csv&tenant=DEMO&start=2017-10-01&end=2017-12-01


ManageDB / Custom Destination Types

Getting the custom destination type list
https://portal.pbxcloud.eu/pbx/proxyapi.php?key=NLbP7GFNVRqu9SDm&reqtype=MANAGEDB&object=CUSTOMTYPES&tenant=DEMO&action=list


ManageDB / Custom Destinations

Getting the custom destination list
https://portal.pbxcloud.eu/pbx/proxyapi.php?key=NLbP7GFNVRqu9SDm&reqtype=MANAGEDB&object=CUSTOM&tenant=DEMO&action=list


Getting info for a custom destination
https://portal.pbxcloud.eu/pbx/proxyapi.php?key=NLbP7GFNVRqu9SDm&reqtype=MANAGEDB&object=CUSTOM&tenant=DEMO&action=get&objectid=67


Creating a custom destination

$config['cu_name']="Boss phone";
$config['cu_ct_id']=1;
$config['cu_param1']="3564732920";
$config['cu_param2']="INCOMINGDID";
$config['cu_param3']="30";

$url = "https://portal.pbxcloud.eu/pbx/proxyapi.php?key=NLbP7GFNVRqu9SDm&reqtype=MANAGEDB&action=add&object=custom&tenant=DEMO";
$resource = curl_init();
curl_setopt($resource, CURLOPT_URL, $url);
curl_setopt($resource, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($resource, CURLOPT_VERBOSE, true);
curl_setopt($resource, CURLOPT_POSTFIELDS, "jsondata=".urlencode(json_encode($config)));
$data = curl_exec($resource);
curl_close($resource);

print_r($data);


Updating a custom destination

$config['cu_name']="Boss private phone";
$config['cu_id']=286;
$config['cu_param1']="0636287454";

$url = "https://portal.pbxcloud.eu/pbx/proxyapi.php?key=NLbP7GFNVRqu9SDm&reqtype=MANAGEDB&action=update&object=custom&tenant=DEMO&objectid=286";
$resource = curl_init();
curl_setopt($resource, CURLOPT_URL, $url);
curl_setopt($resource, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($resource, CURLOPT_VERBOSE, true);
curl_setopt($resource, CURLOPT_POSTFIELDS, "jsondata=".urlencode(json_encode($config)));
$data = curl_exec($resource);
curl_close($resource);

print_r($data);



    • Related Articles

    • PBXCloud - API Syntax index

      PBXCloud - API Syntax index OBS: API er desværre ikke noget vi kan supportere på. Parameters: reqtype - Request type tenant - Sometime optional if the Admin API key is used, otherwise provide the tenant code key - Use the Admin API key or the Tenant ...
    • Ændring af/opret åbningstider

      Ændring af/opret åbningstider Hvordan ændre jeg mine åbningstider, på PBX CLOUD? Åbningstiderne på PBXCLOUD styres af én eller flere tidsstyringer, som alle findes i systemets indstillings menu. Når du er logget ind på PBX portalen finder du ...
    • PBXCLOUD Zoho Integration

      You can link your Zoho account to PBXCLOUD, which will log your calls inside Zoho and open up for multiple features inside Zoho.   1. Receive a PBX Auth Token from Comtalk.   2. Go to https://zoho.pbxcloud.eu and click on “Log in with Zoho”   3. ...
    • Omstilling fra mobiltelefon

      Omstilling fra mobiltelefon Med Comtalks PBXCLOUD løsning er det muligt at omstille et opkald direkte fra mobiltelefonen. Opkald kan omstilles til både interne lokalnumre eller eksterne telefonnumre. Direkte Omstilling Når du modtager et opkald, ...
    • Ring ud med brugerdefineret telefonnummer

      Hvis du har behov for at ringe ud med et andet nummer, end jeres almindelige, kan du ændre dette med en stjernekode el. funktionskode. Nedenfor gennemgås opsætning af denne funktion. Når De er logget ind på PBXCLOUD, følg da venligst ruten: ...