swagger-java-client

Requirements

Building the API client library requires Maven to be installed.

Installation

To install the API client library to your local Maven repository, simply execute:


mvn install

To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:


mvn deploy

Refer to the official documentation for more information.

Maven users

Add this dependency to your project’s POM:


<span class="hljs-tag">&lt;<span class="hljs-title">dependency</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-title">groupId</span>&gt;</span>io.swagger<span class="hljs-tag">&lt;/<span class="hljs-title">groupId</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-title">artifactId</span>&gt;</span>swagger-java-client<span class="hljs-tag">&lt;/<span class="hljs-title">artifactId</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-title">version</span>&gt;</span>1.0.0<span class="hljs-tag">&lt;/<span class="hljs-title">version</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-title">scope</span>&gt;</span>compile<span class="hljs-tag">&lt;/<span class="hljs-title">scope</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-title">dependency</span>&gt;</span>

Gradle users

Add this dependency to your project’s build file:


compile <span class="hljs-string">"io.swagger:swagger-java-client:1.0.0"</span>

Others

At first generate the JAR by executing:


mvn package

Then manually install the following JARs:

  • target/swagger-java-client-1.0.0.jar
  • target/lib/*.jar

Getting Started

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


<span class="hljs-keyword">import</span> io.swagger.client.*;
<span class="hljs-keyword">import</span> io.swagger.client.auth.*;
<span class="hljs-keyword">import</span> io.swagger.client.model.*;
<span class="hljs-keyword">import</span> io.swagger.client.api.DefaultApi;

<span class="hljs-keyword">import</span> java.io.File;
<span class="hljs-keyword">import</span> java.util.*;

<span class="hljs-keyword">public</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">DefaultApiExample</span> </span>{

    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">void</span> <span class="hljs-title">main</span><span class="hljs-params">(String[] args)</span> </span>{
       
        DefaultApi apiInstance = <span class="hljs-keyword">new</span> DefaultApi();
        Double rptType = <span class="hljs-number">3.4</span>D; <span class="hljs-comment">// Double | Report type. (0 report, 1 widget, 2 chart).</span>
        Double rptId = <span class="hljs-number">3.4</span>D; <span class="hljs-comment">// Double | Report id.</span>
        BigDecimal start = <span class="hljs-keyword">new</span> BigDecimal(); <span class="hljs-comment">// BigDecimal | Start offset.</span>
        BigDecimal limit = <span class="hljs-keyword">new</span> BigDecimal(); <span class="hljs-comment">// BigDecimal | Number of results to return. Max 10K.</span>
        String sortBy = <span class="hljs-string">"sortBy_example"</span>; <span class="hljs-comment">// String | Sort column.</span>
        String sortType = <span class="hljs-string">"sortType_example"</span>; <span class="hljs-comment">// String | Sort mode asc/desc.</span>
        String fromDate = <span class="hljs-string">"fromDate_example"</span>; <span class="hljs-comment">// String | Start date time.</span>
        String toDate = <span class="hljs-string">"toDate_example"</span>; <span class="hljs-comment">// String | End date time.</span>
        BigDecimal duration = <span class="hljs-keyword">new</span> BigDecimal(); <span class="hljs-comment">// BigDecimal | Duration range.</span>
        String phone = <span class="hljs-string">"phone_example"</span>; <span class="hljs-comment">// String | List of caller phone.</span>
        String phone1 = <span class="hljs-string">"phone1_example"</span>; <span class="hljs-comment">// String | List of dialled phones.</span>
        String co = <span class="hljs-string">"co_example"</span>; <span class="hljs-comment">// String | List of trunk/co.</span>
        String ext = <span class="hljs-string">"ext_example"</span>; <span class="hljs-comment">// String | list of extensions.</span>
        BigDecimal pbxId = <span class="hljs-keyword">new</span> BigDecimal(); <span class="hljs-comment">// BigDecimal | list of PBX Ids.</span>
        BigDecimal callSource = <span class="hljs-keyword">new</span> BigDecimal(); <span class="hljs-comment">// BigDecimal | list of callsource.</span>
        BigDecimal callType = <span class="hljs-keyword">new</span> BigDecimal(); <span class="hljs-comment">// BigDecimal | list of call type signatures.(5 Unanswered Calls, 7 Transfered Calls, 8 Forwarded Calls)</span>
        BigDecimal direction = <span class="hljs-keyword">new</span> BigDecimal(); <span class="hljs-comment">// BigDecimal | list of direction.(0 incoming, 1 outgoing, 2 internal)</span>
        String callerName = <span class="hljs-string">"callerName_example"</span>; <span class="hljs-comment">// String | list of caller name.</span>
        String did = <span class="hljs-string">"did_example"</span>; <span class="hljs-comment">// String | list of did.</span>
        String dnis = <span class="hljs-string">"dnis_example"</span>; <span class="hljs-comment">// String | list of dnis.</span>
        String acc = <span class="hljs-string">"acc_example"</span>; <span class="hljs-comment">// String | list of account code.</span>
        BigDecimal ring = <span class="hljs-keyword">new</span> BigDecimal(); <span class="hljs-comment">// BigDecimal | Ring range.Seconds unit.</span>
        BigDecimal cost = <span class="hljs-keyword">new</span> BigDecimal(); <span class="hljs-comment">// BigDecimal | Cost range.</span>
        BigDecimal group = <span class="hljs-keyword">new</span> BigDecimal(); <span class="hljs-comment">// BigDecimal | Department/Group id.</span>
        <span class="hljs-keyword">try</span> {
            List&lt;InlineResponse200&gt; result = apiInstance.callsGet(rptType, rptId, start, limit, sortBy, sortType, fromDate, toDate, duration, phone, phone1, co, ext, pbxId, callSource, callType, direction, callerName, did, dnis, acc, ring, cost, group);
            System.out.println(result);
        } <span class="hljs-keyword">catch</span> (ApiException e) {
            System.err.println(<span class="hljs-string">"Exception when calling DefaultApi#callsGet"</span>);
            e.printStackTrace();
        }
    }
}

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




API Java Sample Code