Difference between revisions of "MOR API recordings delete"

From Kolmisoft Wiki
Jump to navigationJump to search
m
Line 9: Line 9:


Parameters which are '''included''' into hash:
Parameters which are '''included''' into hash:
* recording_id - id of the recording in DB. '''Optional.'''
* recording_id - ID of the recording in DB. '''Optional.'''
* s_user_id - User ID in MOR database. '''Optional.'''
* s_user_id - User ID in MOR database. '''Optional.'''
* s_device_id - Device ID in MOR database. '''Optional.'''
* s_device_id - Device ID in MOR database. '''Optional.'''

Revision as of 16:05, 19 August 2021

Description

Delete recordings based on search parameters

Usage

  • From MOR X16: /api/recordings_delete


Parameters

Parameters which are included into hash:

  • recording_id - ID of the recording in DB. Optional.
  • s_user_id - User ID in MOR database. Optional.
  • s_device_id - Device ID in MOR database. Optional.
  • date_from - Unix timestamp of the date from which recordings to be deleted will be selected. Optional.
  • date_till - Unix timestamp of the date until which recordings to be deleted will be selected. Optional.

date_from should be less than date_till


It is possible to use all filters (except recording_id) simultaneously. All filters are optional, but at least one must be present.

Note that parameters are shown in the same order as they have to be when generating the hash. The last parameter in a row is API_Secret_Key

Parameters which are not included into hash:

If u is a simple user (not Admin, Reseller, or Manager), then s_user_id (id of that user) is already taken implicitly and does not need to be added into API queries.

Request

We have API Secret Key = secret

We want to delete all recordings for admin user with id 5 that were recorded up to and including 2019-12-31 23:59:59 GMT

We send:

HTML POST:  https://SERVER_IP/billing/api/recordings_delete?u=admin&s_user_id=5&date_till=1577836799&hash=3da29256e422ae9c4ff53a38b262e0fb9461077e



Returns

Success: Recordings has been deleted.


<?xml version="1.0" encoding="UTF-8"?>
<page>
  <status>
    <success>Recordings were successfully deleted</success>
  </status>
</page>

Other examples:

Delete all recordings fo user with id 5 (which is created under Admin account) and device id 13 between 2021-01-01 00:00:00 and 2020-01-31 23:59:59 GMT

https://SERVER_IP/billing/api/recordings_delete?u=admin&s_user_id=5&s_device_id=13&date_from=1609459200&date_till=1612137599&hash=e794bcb581d2e71d407244f6a200cec489a7542e

Delete recording with id 45454

https://SERVER_IP/billing/api/recordings_delete?u=admin&recording_id=45454&hash=8d89172b14f2dba1015e1295e90a2ceefc15b3b1


Errors:

  • <error>Incorrect hash</error> - Hash was not correct. Check API_Secret_Key and order or params while concatenating hash_string.
  • <error>Access Denied</error> - Such username does not exist in the database or cannot access specified recording.
  • <error>Recording was not found</error> - Such Recording ID does not exist.
  • <error> Date from is greater than date till</error> - Date from is greater than date till


See also