Difference between revisions of "MOR API did device unassign"

From Kolmisoft Wiki
Jump to navigationJump to search
(Undo revision 23393 by Gilbertas (Talk))
 
(5 intermediate revisions by 3 users not shown)
Line 4: Line 4:
=Usage=
=Usage=


* Call: /api/did_device_unassign
* From '''MOR X4''' call: '''/api/did_device_unassign'''
* For Backwards-compatibility old name 'did_unassign_device' is also usable. Call: /api/did_unassign_device
* For Backwards-compatibility old name 'did_unassign_device' is also usable. Call: '''/api/did_unassign_device'''
* Methods: POST, GET(if allowed, not recomended)
* Methods: POST, GET(if allowed, not recomended)
<br><br>
<br><br>
Line 20: Line 20:
We send:
We send:


  HTML POST: http://<SERVER_IP>/billing/api/device_create/u=username&did=123456789&hash=e5e9fa1ba31ecd1ae84f75caaa474f3a663f05f4
  HTML POST: http://<SERVER_IP>/billing/api/did_device_unassign?u=username&did=123456789&hash=e5e9fa1ba31ecd1ae84f75caaa474f3a663f05f4


Now we can view these changes in GUI through DID edit.
Now we can view these changes in GUI through DID edit.
Line 32: Line 32:
  <?xml version="1.0" encoding="UTF-8"?>
  <?xml version="1.0" encoding="UTF-8"?>
  <page>
  <page>
     <status>Device was unassigned from DID</status>
     <status>
      <success>Device was unassigned from DID</success>
    </status>
  </page>
  </page>
<br><br>
<br><br>
Line 39: Line 41:
'''Errors'''
'''Errors'''


* <error>Incorrect hash</error> - Hash was not correct. Check API_Secret_Key and order or params while concatenating hash_string.
<?xml version="1.0" encoding="UTF-8"?>
* <error>Access Denied</error> - Only Admin, Accountant or Reseller may use API.
<page>
* <error>Device was not found</error> - Enter existing Device ID.
    <status>
* <error>You are not authorized to manage DIDs</error> - If Accountant or Reseller is using API, they should have all permissions to perform specified actions.
        <error>Error message</error>
* <error>Invalid DID specified</error> - Enter a valid and existing (numeric) DID number.
    </status>
* <error>Your are not authorized to use this DID</error> - Specified DID is not available to this user.
</page>
* <error>DID is terminated</error> - DID is terminated and cannot be used.
 
* <error>DID is already free</error> - No Device is currently assigned to this DID.
Error messages:
* <error>DID is assigned to dialplan</error> - DID is assigned to a Dial Plan.
 
* <error>Failed to unassign DID</error>
* Incorrect hash – Hash was not correct. Check API_Secret_Key and order or params while concatenating hash_string.
* Access Denied Only Admin, Accountant or Reseller may use API.
* Device was not found Device ID does not exist in system.
* DID was not found – DID number does not exist or incorrect.
* You are not authorized to manage DIDs If Accountant or Reseller is using API, they should have all permissions to perform specified actions.
* Your are not authorized to use this DID Specified DID is not available to this user.
* DID is terminated DID is terminated and cannot be used.
* DID is already free No Device is currently assigned to this DID.
* DID is assigned to dialplan DID is assigned to a Dial Plan.
* Failed to unassign DID – unknown error.
<br><br>
<br><br>
=See also=
=See also=


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

Latest revision as of 05:41, 21 May 2018

Description

MOR API DID unassign Device

Usage

  • From MOR X4 call: /api/did_device_unassign
  • For Backwards-compatibility old name 'did_unassign_device' is also usable. Call: /api/did_unassign_device
  • Methods: POST, GET(if allowed, not recomended)



Parametres

  • did – DID number where device have to be unassigned. Required.
  • u – username for authentication. Required.
  • hash – SHA1 hash constructed using params and API_Secret_Key ( More described in Constructing hash). Required.



Request

We have did=123456789 and API Secret Key = secret

We send:

HTML POST: http://<SERVER_IP>/billing/api/did_device_unassign?u=username&did=123456789&hash=e5e9fa1ba31ecd1ae84f75caaa474f3a663f05f4

Now we can view these changes in GUI through DID edit.

Note that username and password are not included in hash

Returns

Success

<?xml version="1.0" encoding="UTF-8"?>
<page>
   <status>
      <success>Device was unassigned from DID</success>
   </status>
</page>




Errors

<?xml version="1.0" encoding="UTF-8"?>
<page>
   <status>
       <error>Error message</error>
   </status>
</page>

Error messages:

  • Incorrect hash – Hash was not correct. Check API_Secret_Key and order or params while concatenating hash_string.
  • Access Denied – Only Admin, Accountant or Reseller may use API.
  • Device was not found – Device ID does not exist in system.
  • DID was not found – DID number does not exist or incorrect.
  • You are not authorized to manage DIDs – If Accountant or Reseller is using API, they should have all permissions to perform specified actions.
  • Your are not authorized to use this DID – Specified DID is not available to this user.
  • DID is terminated – DID is terminated and cannot be used.
  • DID is already free – No Device is currently assigned to this DID.
  • DID is assigned to dialplan – DID is assigned to a Dial Plan.
  • Failed to unassign DID – unknown error.



See also