Difference between revisions of "MOR API device delete"

From Kolmisoft Wiki
Jump to navigationJump to search
 
(4 intermediate revisions by 2 users not shown)
Line 4: Line 4:
=Usage=
=Usage=


* From '''MOR X4''' Call: '''/api/quickforward_did_delete'''
* Call: /api/device_delete
* For Backwards-compatibility old name 'device_destroy' is also usable. Call: /api/device_destroy
* Methods: POST, GET(if allowed, not recomended)
* Methods: POST, GET(if allowed, not recomended)
<br><br>
<br><br>
===Parametres===
===Parametres===


* DID - DID number, which we want to delete. '''Required'''.
* device - Device ID in MOR database, whose datas we want to delete. '''Required'''.
* u - username for authentication. '''Required'''.
* u - username for authentication. '''Required'''.
* [[MOR API hash construction | hash]] - SHA1 hash constructed using '''params''' and '''API_Secret_Key''' ([[MOR API hash construction | More described in Constructing hash]]). '''Required'''.
* [[MOR API hash construction | hash]] - SHA1 hash constructed using '''device''' and '''API_Secret_Key''' ([[MOR API hash construction | More described in Constructing hash]]). '''Required'''.
<br><br>
<br><br>
===Request===
===Request===


We have DID = 37063042438, API Secret Key = 123456
We have device = 123, API Secret Key = 456789
 
We send:
We send:
  HTML POST: http://<SERVER_IP>/billing/api/quickforwards_did_delete?u=admin&did=37063042438&hash=8fe8606b6bb38ba1cc5e80630436b270cfc7e65e
  HTML POST: http://<SERVER_IP>/billing/api/device_delete?u=admin&device=123&hash=f7c3bc1d808e04732adf679965ccc34ca7ae3441
 
'''NOTE that username and password are not included in hash'''
'''NOTE that username and password are not included in hash'''
<br><br>
<br><br>
===Returns===


'''Success'''
'''Success'''
Line 25: Line 29:
  <?xml version="1.0" encoding="UTF-8"?>
  <?xml version="1.0" encoding="UTF-8"?>
  <page>
  <page>
   <status>Quickforward successfully deleted</status>
   <status>Device was deleted</status>
  </page>
  </page>


Line 32: Line 36:


'''Errors'''
'''Errors'''
* <error>User was not found</error> - user was not found using username. Use correct username.
 
* <error>DID was not found</error> - DID was not found using DID number. Use correct DID.
* <error>Device was not found</error> - Device was not found using device. Use correct device id.</error>
* <error>You are not authorised to use Quickforwards</error> - Such 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 or params while concatenating hash_string.</error>
* <error>No Quickforward is assigned to specified DID</error> - No Quickforward is assigned to specified DID.
* <error>Registration over API is disabled</error> - Setting: Settings->API->API allow Registration, is off. Turn on API allow Registration.</error>
* <error>Access Denied</error> - User with UNIQUEHASH not found or params id not send. Enter correct id.</error>
* <error>Cannot delete device - it has calls. You can only hide device's user. Why is that and how to do that - please read in manual.</error>
* <error>Device has forwarded calls - we cannot delete it</error>
* <error>Unable to delete this device - it is used in Call Flow for Fax Detect</error>
* <error>Device has Dial Plans - we cannot delete it</error>
* <error>One or more Location rules are using this Device</error>
* <error>Cannot delete device - it is assigned to Queue</error>
 
<br><br>
<br><br>
=See also=
=See also=


* [[MOR API]]
* [[MOR API]]

Latest revision as of 13:20, 22 June 2021

Description

MOR API Delete device

Usage

  • Call: /api/device_delete
  • For Backwards-compatibility old name 'device_destroy' is also usable. Call: /api/device_destroy
  • Methods: POST, GET(if allowed, not recomended)



Parametres

  • device - Device ID in MOR database, whose datas we want to delete. Required.
  • u - username for authentication. Required.
  • hash - SHA1 hash constructed using device and API_Secret_Key ( More described in Constructing hash). Required.



Request

We have device = 123, API Secret Key = 456789

We send:

HTML POST: http://<SERVER_IP>/billing/api/device_delete?u=admin&device=123&hash=f7c3bc1d808e04732adf679965ccc34ca7ae3441

NOTE that username and password are not included in hash

Returns

Success

<?xml version="1.0" encoding="UTF-8"?>
<page>
 <status>Device was deleted</status>
</page>




Errors

  • <error>Device was not found</error> - Device was not found using device. Use correct device id.</error>
  • <error>Incorrect hash</error> - Hash was not correct. Check API_Secret_Key and order or params while concatenating hash_string.</error>
  • <error>Registration over API is disabled</error> - Setting: Settings->API->API allow Registration, is off. Turn on API allow Registration.</error>
  • <error>Access Denied</error> - User with UNIQUEHASH not found or params id not send. Enter correct id.</error>
  • <error>Cannot delete device - it has calls. You can only hide device's user. Why is that and how to do that - please read in manual.</error>
  • <error>Device has forwarded calls - we cannot delete it</error>
  • <error>Unable to delete this device - it is used in Call Flow for Fax Detect</error>
  • <error>Device has Dial Plans - we cannot delete it</error>
  • <error>One or more Location rules are using this Device</error>
  • <error>Cannot delete device - it is assigned to Queue</error>



See also