SwaggerClient-php

This PHP package is automatically generated by the Swagger Codegen project:

  • API version: 2.1.0
  • Package version:
  • Build date: 2016-06-25T14:20:23.508Z
  • Build package: class io.swagger.codegen.languages.PhpClientCodegen

Requirements

PHP 5.4.0 and later

Installation & Usage

Composer

To install the bindings via Composer, add the following to

composer.json

:


{
  "repositories": [
    {
      "type": "git",
      "url": "https://github.com//.git"
    }
  ],
  "require": {
    "/": "*@dev"
  }
}

Then run

composer install

Manual Installation

Download the files and include

autoload.php

:


    <span class="hljs-keyword">require_once</span>(<span class="hljs-string">'/path/to/SwaggerClient-php/autoload.php'</span>);

Tests

To run the unit tests:


composer install
./vendor/bin/phpunit lib/Tests

Getting Started

Please follow the installation procedure and then run the following:


<span class="hljs-preprocessor">&lt;?php</span>
<span class="hljs-keyword">require_once</span>(<span class="hljs-keyword">__DIR__</span> . <span class="hljs-string">'/vendor/autoload.php'</span>);

<span class="hljs-variable">$api_instance</span> = <span class="hljs-keyword">new</span> Swagger\Client\Api\DefaultApi();
<span class="hljs-variable">$rpt_type</span> = <span class="hljs-number">1.2</span>; <span class="hljs-comment">// double | Report type. (0 report, 1 widget, 2 chart).</span>
<span class="hljs-variable">$rpt_id</span> = <span class="hljs-number">1.2</span>; <span class="hljs-comment">// double | Report id.</span>
<span class="hljs-variable">$start</span> = <span class="hljs-number">3.4</span>; <span class="hljs-comment">// float | Start offset.</span>
<span class="hljs-variable">$limit</span> = <span class="hljs-number">3.4</span>; <span class="hljs-comment">// float | Number of results to return. Max 10K.</span>
<span class="hljs-variable">$sort_by</span> = <span class="hljs-string">"sort_by_example"</span>; <span class="hljs-comment">// string | Sort column.</span>
<span class="hljs-variable">$sort_type</span> = <span class="hljs-string">"sort_type_example"</span>; <span class="hljs-comment">// string | Sort mode asc/desc.</span>
<span class="hljs-variable">$from_date</span> = <span class="hljs-string">"from_date_example"</span>; <span class="hljs-comment">// string | Start date time.</span>
<span class="hljs-variable">$to_date</span> = <span class="hljs-string">"to_date_example"</span>; <span class="hljs-comment">// string | End date time.</span>
<span class="hljs-variable">$duration</span> = <span class="hljs-number">3.4</span>; <span class="hljs-comment">// float | Duration range.</span>
<span class="hljs-variable">$phone</span> = <span class="hljs-string">"phone_example"</span>; <span class="hljs-comment">// string | List of caller phone.</span>
<span class="hljs-variable">$phone1</span> = <span class="hljs-string">"phone1_example"</span>; <span class="hljs-comment">// string | List of dialled phones.</span>
<span class="hljs-variable">$co</span> = <span class="hljs-string">"co_example"</span>; <span class="hljs-comment">// string | List of trunk/co.</span>
<span class="hljs-variable">$ext</span> = <span class="hljs-string">"ext_example"</span>; <span class="hljs-comment">// string | list of extensions.</span>
<span class="hljs-variable">$pbx_id</span> = <span class="hljs-number">3.4</span>; <span class="hljs-comment">// float | list of PBX Ids.</span>
<span class="hljs-variable">$call_source</span> = <span class="hljs-number">3.4</span>; <span class="hljs-comment">// float | list of callsource.</span>
<span class="hljs-variable">$call_type</span> = <span class="hljs-number">3.4</span>; <span class="hljs-comment">// float | list of call type signatures.(5 Unanswered Calls, 7 Transfered Calls, 8 Forwarded Calls)</span>
<span class="hljs-variable">$direction</span> = <span class="hljs-number">3.4</span>; <span class="hljs-comment">// float | list of direction.(0 incoming, 1 outgoing, 2 internal)</span>
<span class="hljs-variable">$caller_name</span> = <span class="hljs-string">"caller_name_example"</span>; <span class="hljs-comment">// string | list of caller name.</span>
<span class="hljs-variable">$did</span> = <span class="hljs-string">"did_example"</span>; <span class="hljs-comment">// string | list of did.</span>
<span class="hljs-variable">$dnis</span> = <span class="hljs-string">"dnis_example"</span>; <span class="hljs-comment">// string | list of dnis.</span>
<span class="hljs-variable">$acc</span> = <span class="hljs-string">"acc_example"</span>; <span class="hljs-comment">// string | list of account code.</span>
<span class="hljs-variable">$ring</span> = <span class="hljs-number">3.4</span>; <span class="hljs-comment">// float | Ring range.Seconds unit.</span>
<span class="hljs-variable">$cost</span> = <span class="hljs-number">3.4</span>; <span class="hljs-comment">// float | Cost range.</span>
<span class="hljs-variable">$group</span> = <span class="hljs-number">3.4</span>; <span class="hljs-comment">// float | Department/Group id.</span>

<span class="hljs-keyword">try</span> {
    <span class="hljs-variable">$result</span> = <span class="hljs-variable">$api_instance</span>-&gt;callsGet(<span class="hljs-variable">$rpt_type</span>, <span class="hljs-variable">$rpt_id</span>, <span class="hljs-variable">$start</span>, <span class="hljs-variable">$limit</span>, <span class="hljs-variable">$sort_by</span>, <span class="hljs-variable">$sort_type</span>, <span class="hljs-variable">$from_date</span>, <span class="hljs-variable">$to_date</span>, <span class="hljs-variable">$duration</span>, <span class="hljs-variable">$phone</span>, <span class="hljs-variable">$phone1</span>, <span class="hljs-variable">$co</span>, <span class="hljs-variable">$ext</span>, <span class="hljs-variable">$pbx_id</span>, <span class="hljs-variable">$call_source</span>, <span class="hljs-variable">$call_type</span>, <span class="hljs-variable">$direction</span>, <span class="hljs-variable">$caller_name</span>, <span class="hljs-variable">$did</span>, <span class="hljs-variable">$dnis</span>, <span class="hljs-variable">$acc</span>, <span class="hljs-variable">$ring</span>, <span class="hljs-variable">$cost</span>, <span class="hljs-variable">$group</span>);
    print_r(<span class="hljs-variable">$result</span>);
} <span class="hljs-keyword">catch</span> (<span class="hljs-keyword">Exception</span> <span class="hljs-variable">$e</span>) {
    <span class="hljs-keyword">echo</span> <span class="hljs-string">'Exception when calling DefaultApi-&gt;callsGet: '</span>, <span class="hljs-variable">$e</span>-&gt;getMessage(), PHP_EOL;
}

<span class="hljs-preprocessor">?&gt;</span>

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



Download PHP Sample Code