Difference between revisions of "M4 API quickstats get"

From Kolmisoft Wiki
Jump to navigationJump to search
(Created page with '=Description= Retrieves today's Quick Stats and Active Calls count<br><br> Data can be retrieved just by '''Admin''' <br> =Usage= * '''M2''' call: '''/api/quickstats_…')
 
Line 3: Line 3:
Retrieves today's [[Quick Stats]] and [[Active Calls]] count<br><br>
Retrieves today's [[Quick Stats]] and [[Active Calls]] count<br><br>


Data can be retrieved just by '''Admin'''
Data can be retrieved by '''Admin''' only


<br>
<br>
=Usage=
=Usage=



Revision as of 17:26, 11 February 2016

Description

Retrieves today's Quick Stats and Active Calls count

Data can be retrieved by Admin only


Usage

  • M2 call: /api/quickstats_get
  • Methods: POST, GET(if allowed, not recomended)



Parameters



Request

If API Secret Key = secret

You send:

HTML POST: http://<SERVER_IP>/billing/api/quickstats_get?u=admin&hash=e5e9fa1ba31ecd1ae84f75caaa474f3a663f05f4

* Note that username (u) is not included in hash

Returns

Success: Everything is ok. You get the list of calls if there is any:

<?xml version="1.0" encoding="UTF-8"?>
<page>
 <quickstats>
   <today>
     <calls> Calls count </calls>
     <duration> billsec in seconds </duration>
     <revenue> revenue today</revenue>
     <self_cost> expenditure today</self_cost>
     <profit> difference of revenue and expences</profit>
   </today>
   <active_calls>
     <total> Active Calls count </total>
     <answered_calls> Answered Calls count </answered_calls>
   </active_calls>
 </quickstats>
</page>

Errors:

  • <error>API Requests are disabled</error> – Allow API globally setting is unchecked
  • <error>GET Requests are disabled</error> – Allow GET API setting is unchecked
  • <error>Access Denied</error> – user with such username cannot use this method
  • <error>Bad login</error> – such username does not exist in the database or it was not specified
  • <error>Incorrect hash</error> – Hash was not correct. Check API_Secret_Key and order or params while concatenating hash_string
  • <error>Cannot connect to Elasticsearch</error> – data is not reachable

Example:

 <status>
   <error>API Requests are disabled</error>
 </status>



See also