<pbx-dom-api>

<PbxDomApi> – JavaScript client for <pbx-dom-api>
This SDK is automatically generated by the Swagger Codegen project:

  • API version: 2.1.0
  • Package version: 2.1.0
  • Build date: 2016-06-25T14:19:48.485Z
  • Build package: class io.swagger.codegen.languages.JavascriptClientCodegen

Installation

For Node.js

npm

To publish the library as a npm,
please follow the procedure in “Publishing npm packages”.

Then install it via:

				
npm install &lt;pbx-dom-api&gt; --save


git

If the library is hosted at a git repository, e.g.
https://github.com/YOUR_USERNAME/
then install it via:

				
npm install YOUR_USERNAME/&amp;lt;pbx-dom-api&amp;gt; --save

For browser

The library also works in the browser environment via npm and browserify. After following
the above steps with Node.js and installing browserify with

				
npm install -g browserify

perform the following (assuming main.js is your entry file):

				
browserify main.js &gt; bundle.js


Then include bundle.js in the HTML pages.

Getting Started

Please follow the installation instruction and execute the following JS code:

				
<span class="hljs-keyword">var</span> &lt;PbxDomApi&gt; = <span class="hljs-built_in">require</span>(<span class="hljs-string">'&lt;pbx-dom-api&gt;'</span>);

<span class="hljs-keyword">var</span> api = <span class="hljs-keyword">new</span> &lt;PbxDomApi&gt;.DefaultApi()

<span class="hljs-keyword">var</span> rptType = <span class="hljs-number">1.2</span>; <span class="hljs-comment">// {Number} Report type. (0 report, 1 widget, 2 chart).</span>

<span class="hljs-keyword">var</span> rptId = <span class="hljs-number">1.2</span>; <span class="hljs-comment">// {Number} Report id.</span>

<span class="hljs-keyword">var</span> opts = {
<span class="hljs-string">'start'</span>: <span class="hljs-number">3.4</span>, <span class="hljs-comment">// {Number} Start offset.</span>
<span class="hljs-string">'limit'</span>: <span class="hljs-number">3.4</span>, <span class="hljs-comment">// {Number} Number of results to return. Max 10K.</span>
<span class="hljs-string">'sortBy'</span>: <span class="hljs-string">"sortBy_example"</span>, <span class="hljs-comment">// {String} Sort column.</span>
<span class="hljs-string">'sortType'</span>: <span class="hljs-string">"sortType_example"</span>, <span class="hljs-comment">// {String} Sort mode asc/desc.</span>
<span class="hljs-string">'fromDate'</span>: <span class="hljs-string">"fromDate_example"</span>, <span class="hljs-comment">// {String} Start date time.</span>
<span class="hljs-string">'toDate'</span>: <span class="hljs-string">"toDate_example"</span>, <span class="hljs-comment">// {String} End date time.</span>
<span class="hljs-string">'duration'</span>: <span class="hljs-number">3.4</span>, <span class="hljs-comment">// {Number} Duration range.</span>
<span class="hljs-string">'phone'</span>: <span class="hljs-string">"phone_example"</span>, <span class="hljs-comment">// {String} List of caller phone.</span>
<span class="hljs-string">'phone1'</span>: <span class="hljs-string">"phone1_example"</span>, <span class="hljs-comment">// {String} List of dialled phones.</span>
<span class="hljs-string">'co'</span>: <span class="hljs-string">"co_example"</span>, <span class="hljs-comment">// {String} List of trunk/co.</span>
<span class="hljs-string">'ext'</span>: <span class="hljs-string">"ext_example"</span>, <span class="hljs-comment">// {String} list of extensions.</span>
<span class="hljs-string">'pbxId'</span>: <span class="hljs-number">3.4</span>, <span class="hljs-comment">// {Number} list of PBX Ids.</span>
<span class="hljs-string">'callSource'</span>: <span class="hljs-number">3.4</span>, <span class="hljs-comment">// {Number} list of callsource.</span>
<span class="hljs-string">'callType'</span>: <span class="hljs-number">3.4</span>, <span class="hljs-comment">// {Number} list of call type signatures.(5 Unanswered Calls, 7 Transfered Calls, 8 Forwarded Calls)</span>
<span class="hljs-string">'direction'</span>: <span class="hljs-number">3.4</span>, <span class="hljs-comment">// {Number} list of direction.(0 incoming, 1 outgoing, 2 internal)</span>
<span class="hljs-string">'callerName'</span>: <span class="hljs-string">"callerName_example"</span>, <span class="hljs-comment">// {String} list of caller name.</span>
<span class="hljs-string">'did'</span>: <span class="hljs-string">"did_example"</span>, <span class="hljs-comment">// {String} list of did.</span>
<span class="hljs-string">'dnis'</span>: <span class="hljs-string">"dnis_example"</span>, <span class="hljs-comment">// {String} list of dnis.</span>
<span class="hljs-string">'acc'</span>: <span class="hljs-string">"acc_example"</span>, <span class="hljs-comment">// {String} list of account code.</span>
<span class="hljs-string">'ring'</span>: <span class="hljs-number">3.4</span>, <span class="hljs-comment">// {Number} Ring range.Seconds unit.</span>
<span class="hljs-string">'cost'</span>: <span class="hljs-number">3.4</span>, <span class="hljs-comment">// {Number} Cost range.</span>
<span class="hljs-string">'group'</span>: <span class="hljs-number">3.4</span> <span class="hljs-comment">// {Number} Department/Group id.</span>
};

<span class="hljs-keyword">var</span> callback = <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">error, data, response</span>) </span>{
<span class="hljs-keyword">if</span> (error) {
<span class="hljs-built_in">console</span>.error(error);
} <span class="hljs-keyword">else</span> {
<span class="hljs-built_in">console</span>.log(<span class="hljs-string">'API called successfully. Returned data: '</span> + data);
}
};
api.callsGet(rptType, rptId, opts, callback);

Documentation for API Endpoints

All URIs are relative to https://api.pbxdom.com

ClassMethodHTTP requestDescription
.DefaultApicallsGetGET /Calls
.DefaultApifeaturesChartsGetGET /Features/charts
.DefaultApifeaturesReportsGetGET /Features/reports
.DefaultApifeaturesWidgetGetGET /Features/widget