M2 API aggregate get

From Kolmisoft Wiki
Revision as of 15:05, 11 July 2017 by Robert (talk | contribs) (→‎Parameters)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search


M2 API for getting M2 aggregate statistic.


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


  • u - username to login. Required.
  • hash – SHA1 hash constructed using API Secret Key ( More described in Constructing hash). Required.
  • from - Date from which queues log start. If not used, this parameter will be set to today's date 00:00:00. Date should be entered in Unix time stamp (Epoch) format.
  • till - Date when queues log end. If not used, this parameter will be set to today's date 23:59:59. Date should be entered in Unix time stamp (Epoch) format.
  • a_currency – currency code, by default usd.
  • group_by_originator – group by originator possible values [0,1]. (Default: 0).
  • group_by_op – group by origination point possible values [0,1]. (Default: 0).
  • group_by_terminator – group by terminator possible values [0,1]. (Default: 0).
  • group_by_tp – group by termination point possible values [0,1]. (Default: 0).
  • group_by_dst_group – group by destination group possible values [0,1]. (Default: 0).
  • group_by_dst – group by destination possible values [0,1]. (Default: 0).

* NOTE by default grouped by originator, terminator and destination group

  • s_originator_id – id of originator.
  • s_terminator_id – id of terminator.
  • s_op_device – id of origination point.
  • s_tp_device – id of termination point.
  • a_src – value for CallerID
  • a_dst – value for Destination
  • dst_group – value for Destination Group
  • use_real_billsec – Possible values [0,1]. (Default: 0).
  • from_user_perspective - Possible values [0,1]. (Default: 0).
  • answered_calls - show aggregates when Answered Calls >= value.


If API Secret Key = secret

You send:

HTML POST: http://<SERVER IP>/billing/api/aggregate_get?u=admin&hash=e5e9fa1ba31ecd1ae84f75caaa474f3a663f05f4

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



     <dst_group>Iran - Mobile</dst_group>
     <originator>Test User 127</originator>
     <terminator>Test User 105</terminator>
     <dst_group>Russia - Mobile TWO</dst_group>
     <originator>Test User 127</originator>
     <terminator>Test User 108</terminator>


  <error>Incorrect hash</error>
   <error>No data found</error>
   <error>Access Denied</error>

See also