swagger_client

SwaggerClient – the Ruby gem for the <PBXDom API>

This SDK is automatically generated by the Swagger Codegen project:

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

Installation

Build a gem

To build the Ruby code into a gem:


gem build swagger_client.gemspec

Then either install the gem locally:


gem install ./swagger_client-1.0.0.gem

(for development, run

gem install --dev ./swagger_client-1.0.0.gem

to install the development dependencies)

or publish the gem to a gem hosting service, e.g. RubyGems.

Finally add this to the Gemfile:


gem 'swagger_client', '~&gt; 1.0.0'

Install from Git

If the Ruby gem is hosted at a git repository: https://github.com/YOUR_GIT_USERNAME/YOUR_GIT_REPO, then add the following in the Gemfile:


gem 'swagger_client', :git =&gt; 'https://github.com/YOUR_GIT_USERNAME/YOUR_GIT_REPO.git'

Include the Ruby code directly

Include the Ruby code directly using

-I

as follows:


ruby -Ilib script.rb

Getting Started

Please follow the installation procedure and then run the following code:


<span class="hljs-comment"># Load the gem</span>
<span class="hljs-keyword">require</span> <span class="hljs-string">'swagger_client'</span>

api_instance = <span class="hljs-constant">SwaggerClient::DefaultApi</span>.new

rpt_type = <span class="hljs-number">1.2</span> <span class="hljs-comment"># Float | Report type. (0 report, 1 widget, 2 chart).</span>

rpt_id = <span class="hljs-number">1.2</span> <span class="hljs-comment"># Float | Report id.</span>

opts = {
  <span class="hljs-symbol">start:</span> <span class="hljs-number">3.4</span>, <span class="hljs-comment"># Float | Start offset.</span>
  <span class="hljs-symbol">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-symbol">sort_by:</span> <span class="hljs-string">"sort_by_example"</span>, <span class="hljs-comment"># String | Sort column.</span>
  <span class="hljs-symbol">sort_type:</span> <span class="hljs-string">"sort_type_example"</span>, <span class="hljs-comment"># String | Sort mode asc/desc.</span>
  <span class="hljs-symbol">from_date:</span> <span class="hljs-string">"from_date_example"</span>, <span class="hljs-comment"># String | Start date time.</span>
  <span class="hljs-symbol">to_date:</span> <span class="hljs-string">"to_date_example"</span>, <span class="hljs-comment"># String | End date time.</span>
  <span class="hljs-symbol">duration:</span> <span class="hljs-number">3.4</span>, <span class="hljs-comment"># Float | Duration range.</span>
  <span class="hljs-symbol">phone:</span> <span class="hljs-string">"phone_example"</span>, <span class="hljs-comment"># String | List of caller phone.</span>
  <span class="hljs-symbol">phone1:</span> <span class="hljs-string">"phone1_example"</span>, <span class="hljs-comment"># String | List of dialled phones.</span>
  <span class="hljs-symbol">co:</span> <span class="hljs-string">"co_example"</span>, <span class="hljs-comment"># String | List of trunk/co.</span>
  <span class="hljs-symbol">ext:</span> <span class="hljs-string">"ext_example"</span>, <span class="hljs-comment"># String | list of extensions.</span>
  <span class="hljs-symbol">pbx_id:</span> <span class="hljs-number">3.4</span>, <span class="hljs-comment"># Float | list of PBX Ids.</span>
  <span class="hljs-symbol">call_source:</span> <span class="hljs-number">3.4</span>, <span class="hljs-comment"># Float | list of callsource.</span>
  <span class="hljs-symbol">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-symbol">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-symbol">caller_name:</span> <span class="hljs-string">"caller_name_example"</span>, <span class="hljs-comment"># String | list of caller name.</span>
  <span class="hljs-symbol">did:</span> <span class="hljs-string">"did_example"</span>, <span class="hljs-comment"># String | list of did.</span>
  <span class="hljs-symbol">dnis:</span> <span class="hljs-string">"dnis_example"</span>, <span class="hljs-comment"># String | list of dnis.</span>
  <span class="hljs-symbol">acc:</span> <span class="hljs-string">"acc_example"</span>, <span class="hljs-comment"># String | list of account code.</span>
  <span class="hljs-symbol">ring:</span> <span class="hljs-number">3.4</span>, <span class="hljs-comment"># Float | Ring range.Seconds unit.</span>
  <span class="hljs-symbol">cost:</span> <span class="hljs-number">3.4</span>, <span class="hljs-comment"># Float | Cost range.</span>
  <span class="hljs-symbol">group:</span> <span class="hljs-number">3.4</span> <span class="hljs-comment"># Float | Department/Group id.</span>
}

<span class="hljs-keyword">begin</span>
  result = api_instance.calls_get(rpt_type, rpt_id, opts)
  p result
<span class="hljs-keyword">rescue</span> <span class="hljs-constant">SwaggerClient::ApiError</span> =&gt; e
  puts <span class="hljs-string">"Exception when calling DefaultApi-&gt;calls_get: <span class="hljs-subst">#{e}</span>"</span>
<span class="hljs-keyword">end</span>

Documentation for API Endpoints

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

ClassMethodHTTP requestDescription
SwaggerClient::DefaultApicalls_getGET /Calls
SwaggerClient::DefaultApifeatures_charts_getGET /Features/charts
SwaggerClient::DefaultApifeatures_reports_getGET /Features/reports
SwaggerClient::DefaultApifeatures_widget_getGET /Features/widget



Download Ruby Sample Code