Difference between revisions of "MOR API recordings delete"
m |
|||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
=Description= | =Description= | ||
Delete recordings based on search parameters<br><br> | Delete recordings based on search parameters.<br><br> | ||
=Usage= | =Usage= | ||
Line 11: | Line 11: | ||
* 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.'''. If s_device_id is used, s_user_id must be present too. | ||
* date_from - Unix timestamp of the date from which recordings to be deleted will be selected. '''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_till - Unix timestamp of the date until which recordings to be deleted will be selected. '''Optional.''' | ||
Line 45: | Line 45: | ||
<status> | <status> | ||
<success>Recordings were successfully deleted</success> | <success>Recordings were successfully deleted</success> | ||
<amount>99</amount> | |||
</status> | </status> | ||
</page> | </page> | ||
Line 66: | Line 67: | ||
* <error>Access Denied</error> - Such username does not exist in the database or cannot access specified recording. | * <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>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 | * <error>Recordings were not found</error> - No recordings matched search filter | ||
* <error>Date from is greater than date till</error> - Date from is greater than date till | |||
* <error>s_user_id must be present</error> - s_device_id parameter is present, but s_user_id is missing | |||
Latest revision as of 05:39, 1 September 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.. If s_device_id is used, s_user_id must be present too.
- 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:
- u - username to login. Required.
- hash - SHA1 hash constructed using parameters above and API_Secret_Key ( More described in Constructing hash). Required (if setting Disable hash checking is not checked).
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.
Important notice: If API string uses other parameters instead of recording_id (which delete one specific recording with that id), please take caution, as incorrect parameters can delete more recordings than intended.
Request
We have API Secret Key = secret
We want to delete all recordings for User with id 5 (under Admin account) 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> <amount>99</amount> </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
Delete all User gilbertas recordings (using his account for authentication)
https://SERVER_IP/billing/api/recordings_delete?u=gilbertas&hash=e5e9fa1ba31ecd1ae84f75caaa474f3a663f05f4
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>Recordings were not found</error> - No recordings matched search filter
- <error>Date from is greater than date till</error> - Date from is greater than date till
- <error>s_user_id must be present</error> - s_device_id parameter is present, but s_user_id is missing