MOR API recordings get

From Kolmisoft Wiki

Jump to: navigation, search

Contents

[edit] Description

MOR API for getting MOR recordings

[edit] Usage

  • From MOR X7 call: /api/recordings_get
  • Methods: POST, GET(if allowed, not recomended)



[edit] Parameters

  • u - username to login. Required.
  • hash – SHA1 hash constructed using API Secret Key ( More described in Constructing hash). Required.
  • date_from - Date from which recordings 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.
  • date_till - Date when recordings 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.
  • destination - Destination to which recordings were made.
  • source - Source from which recordings were made.
  • user - User's ID who made recordings.
  • device - Device which has been used by User to make recordings.
  • uniqueid - returns recordings by call uniqueid. Other parameters are ignored in this case.
  • callback_uniqueid - returns recordings by callback uniqueid. Other parameters are ignored in this case. Only works when use_callback_uniqueid setting is enabled in mor.conf.



[edit] Request

If API Secret Key = secret

You send:

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

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

[edit] Returns

<?xml version="1.0" encoding="UTF-8"?>
<page>
 <status>
  <recordings>
   <recording>
    <id> ... </id>
    <user_id> ... </user_id>
    <dst_user_id> ... </dst_user_id>
    <src_device_id> ... </src_device_id>
    <dst_device_id> ... </dst_device_id>
    <date> ... </date>
    <comment> ... </comment>
    <duration> ... </duration>
    <source> ... </source>
    <destination> ... </destination>
    <size> ... </size>
    <mp3_url></mp3_url>
   </recording>
  </recordings>
 </status>
</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 a username cannot use this method or such a 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 of parameters while concatenating the hash_string
  • <error>No Recordings found</error> – There are no recordings with given parameters.
  • <error>Date from is incorrect format</error> – Date from must be used in Unix time stamp format.
  • <error>Date till is incorrect format</error> – Date till must be used in Unix time stamp format.
  • <error>Date from is greater than date till</error> – Date from can not be bigger than date till.

Example:

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



[edit] See also

Personal tools

Try MOR

Try M2