API Version: Development

Javascript API

The Javascript API is designed to develop sophisticated applications that directly and natively interact with the IPCortex Communication System (CS).
It can do just about anything on behalf of a user: initiating and terminating phone calls; starting chats; reading and writing chat messages; and initiating multimedia sessions in the browser. Really, it can do anything keevio can do and more, limited only by your imagination.
To begin you must have the IPCortex CS or a Virtual Image ready.
You then need to load the API into your application page by including the API JavaScript files found on your IPCortex CS and then authenticate against the API host.
From there you can start to fetch data from the PABX. See the Reference for more detail on what is available to you.
IMPORTANT: Due to modern browser security requirements, it is not possible to simply load an HTML file from a directory and import the API files from there. The file:// scheme is not considered secure, and therefore it cannot communicate and access https:// secured files, including the login process. Instead consider starting up a simple HTTPS server, or running the API under NodeJS. It is aso possible to set up tests and examples on JSFiddle.
Title Description
Loading the API Loading the JavaScript API into your application
Authentication Full API Authentication
Fetching PBX data Javascript API data fetching

Success callbacks

Many methods will specify that they return a Promise as a means of reporting a result; Largely for legacy support, some object methods will return immediately with a success or failure indication. Most will have to carry out some background function to determine whether a request can be completed, so a callback is utilised to feed back the result.
Where a callback is indicated, and not otherwise expanded on, the callback function takes the form:
callback(success, message)
where:
Parameter Type Description
success Boolean Was the call successful.
message String More information specific to the call.