Difference between revisions of "MOR API user calls get"

From Kolmisoft Wiki
Jump to navigationJump to search
Line 1: Line 1:
<br><br>
<!---This functionality is available from MOR 8--->
=[[MOR API]] User Calls=
=[[MOR API]] User Calls=



Revision as of 09:27, 23 January 2013

MOR API User Calls

Retrieves list of calls in selected time period for some user/device

Admin - can get every user calls

Reseller - can get his and his users calls

User - can get his own calls

MOR 8

  • Call: /api/user_calls
  • Methods: POST, GET(if allowed, not recomended)
  • Params:
    • user_id - Users ID in MOR database. Required.
    • period_start - Unix timestamp of calls period starting date. (Default: Today at 00:00).
    • period_end - Unix timestamp of calls period end date. (Default: Today at 23:59).
    • direction - Call direction. Possible values [outgoing, incoming]. (Default: outgoing)
    • calltype - Call type. Possible values [all, answered, busy, no_answer, failed, missed, missed_inc, missed_inc_all, missed_not_processed_inc]. (Default: all)
    • device - Device ID in MOR database. Possible values [all, numeric value of device_id]. (Default: all)
    • hash - SHA1 hash constructed using params and API_Secret_Key ( More described in Constructing hash). Required.
    • u - Users username. Required.
    • p - Users password. Required.
  • Returns:
    • Errors:
      • <error>User was not found</error> - User was not found using user_id. Use correct user_id. Make sure that username (u) and password (p) are specified.
      • <error>Incorrect hash</error> - Hash was not correct. Check API_Secret_Key and order or params while concatenating hash_string.



MOR 9

  • Call: /api/user_calls
  • Methods: POST, GET(if allowed, not recomended)
  • Params:
    • s_user - Users ID in MOR database.
    • period_start - Unix timestamp of calls period starting date. (Default: Today at 00:00).
    • period_end - Unix timestamp of calls period end date. (Default: Today at 23:59).
    • s_call_type - Call type. Possible values [all,answered,no answer,failed,busy]. (Default: all)
    • s_device - Device ID in MOR database. Possible values [all, numeric value of device_id]. (Default: all)
    • s_provider - Provider ID in MOR database. Possible values [all, numeric value of provider_id]. (Default: all).Only for Admin.
    • s_hgc - Hangup cause code ID in MOR database. Possible values [all, numeric value of hangup_cause_code_id]. (Default: all). Only for Admin or Reseller if Show HGC for Resellers is ON
    • s_did - Did ID in MOR database. Possible values [all, numeric value of did_id]. (Default: all).Only for Admin.
    • s_destination - prefix.
    • order_by - Possible values [time,src,dst,prefix,nice_billsec,hgc,server,p_name,p_rate,p_price, reseller, r_rate,r_price,user,u_rate,u_price,number, d_provider, d_inc, d_oener]. (Default: time)
    • order_desc - Possible values [0,1]. (Default: 0)
    • hash - SHA1 hash constructed using params and API_Secret_Key ( More described in Constructing hash). Required.
    • u - Users username. Required.
    • p - Users password. Required.
  • Returns:
    • Errors:
      • <error>User was not found</error> - User was not found using user_id. Use correct user_id.
      • <error>Incorrect hash</error> - Hash was not correct. Check API_Secret_Key and order or params while concatenating hash_string.


from MOR 10


add new params

  • Params:
    • s_provider - for reseller if allow own_providers.


from MOR 11


add new params

  • Params:
    • only_did - get only calls made via DIDs. Possible values [0,1]. (Default: 0)
    • s_reseller_did - get only calls made via Reseller DIDs.
    • s_did_pattern - get only calls made via DIDs patterns.





  • Example:
    • We have s_user = 123, API Secret Key = 456789
    • Hash string to be converted: "123456789"
    • We send:
      • /api/user_calls?u=admin&p=admin&s_user=123&hash=f7c3bc1d808e04732adf679965ccc34ca7ae3441

* Note that username and password are not included in hash