Difference between revisions of "MOR API did device unassign"

From Kolmisoft Wiki
Jump to navigationJump to search
(Created page with 'MOR API DID unassign Device <br><br> ---- <br><br> * Call: /api/did_unassign_device * Methods: POST, GET(if allowed, not recomended) * Params: ** did - DID number to be creat…')
 
Line 1: Line 1:
[[MOR API]]
=Description=
DID unassign Device
[[MOR API]] DID unassign Device
<br><br>
<br><br>
----
=Usage=
 
* 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)
<br><br>
<br><br>
* Call: /api/did_unassign_device
===Parametres===
* Methods: POST, GET(if allowed, not recomended)
 
* Params:
* did DID number where device have to be unassigned. '''Required'''.
** did - DID number to be created '''Required'''.
* u username for authentication. '''Required'''.
** u - username to login. '''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'''.
** p - password to login. '''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'''.
* Returns:
**Success
*** <status>Device was unassigned from DID</status>
** Errors:
*** <error>Incorrect hash</error> - Hash was not correct. Check API_Secret_Key and order or params while concatenating hash_string.
*** <error>Don't be so smart</error> - Only Admin, Accountant or Reseller may use API.
*** <error>Device was not found</error> - Enter existing Device ID.
*** <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>Invalid DID specified</error> - Enter a valid and existing (numeric) DID number.
*** <error>Your are not authorized to use this DID</error> - Specified DID is not available to this user.
*** <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>DID is assigned to dialplan</error> - DID is assigned to a Dial Plan.
*** <error>Failed to unassign DID</error>
<br><br>
<br><br>
== Request ==
== Request ==


http://123.123.123.123/billing/api/device_create/u=admin&p=password&did=123456789&hash=bc2f114099d16656d37e45fd9e8744cb9386d462
We have did=123456789 and API Secret Key = secret
 
We send:
 
HTML POST: http://<SERVER_IP>/billing/api/device_create/u=username&did=123456789&hash=e5e9fa1ba31ecd1ae84f75caaa474f3a663f05f4


*admin - owner's username
Now we can view these changes in GUI through DID edit.
*password - owner's password
 
*did - DID number
'''Note that username and password are not included in hash'''
<br><br>
<br><br>
----
===Returns===
*Example:
**We have API Secret Key = secret
**Converted Hash string like "e5e9fa1ba31ecd1ae84f75caaa474f3a663f05f4"
*We send:
**http://123.123.123.123/billing/api/device_create/u=admin&p=password&did=123456789&hash=e5e9fa1ba31ecd1ae84f75caaa474f3a663f05f4
*We get:


            <page>
'''Success'''
                  <status>Device was unassigned from DID</status>
            </page>


*We send:
<?xml version="1.0" encoding="UTF-8"?>
**http://123.123.123.123/billing/api/device_create/u=admin&p=password&did=123456790&hash=e5e9fa1ba31ecd1ae84f75caaa474f3a663f05f4
<page>
*We get:
    <status>Device was unassigned from DID</status>
</page>
<br><br>
----


            <page>
'''Errors'''
                  <status>Device was unassigned from DID</status>
            </page>


*Now we can view these changes in GUI through DID edit.
* <error>Incorrect hash</error> - Hash was not correct. Check API_Secret_Key and order or params while concatenating hash_string.
* <error>Access Denied</error> - Only Admin, Accountant or Reseller may use API.
* <error>Device was not found</error> - Enter existing Device ID.
* <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>Invalid DID specified</error> - Enter a valid and existing (numeric) DID number.
* <error>Your are not authorized to use this DID</error> - Specified DID is not available to this user.
* <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>DID is assigned to dialplan</error> - DID is assigned to a Dial Plan.
* <error>Failed to unassign DID</error>
<br><br>
=See also=


'''* Note that username and password are not included in hash'''
* [[MOR API]]

Revision as of 10:16, 25 May 2013

Description

MOR API DID unassign Device

Usage

  • 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/device_create/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>Device was unassigned from DID</status>
</page>




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> - Only Admin, Accountant or Reseller may use API.
  • <error>Device was not found</error> - Enter existing Device ID.
  • <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>Invalid DID specified</error> - Enter a valid and existing (numeric) DID number.
  • <error>Your are not authorized to use this DID</error> - Specified DID is not available to this user.
  • <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>DID is assigned to dialplan</error> - DID is assigned to a Dial Plan.
  • <error>Failed to unassign DID</error>



See also