Difference between revisions of "MOR API did device assign"

From Kolmisoft Wiki
Jump to navigationJump to search
Line 33: Line 33:
  <?xml version="1.0" encoding="UTF-8"?>
  <?xml version="1.0" encoding="UTF-8"?>
  <page>
  <page>
     <status>Device assigned to DID</status>
     <status>
      <error>Device assigned to DID</error>
    </status>
  </page>
  </page>
<br><br>
<br><br>
Line 40: Line 42:
'''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>Don't be so smart</error> - Only Admin, Accountant or Reseller may use API.
<page>
* <error>Device was not found</error> - Enter existing Device ID.
    <status>
* <error>Your are not authorized to use this Device</error> - Specified Device is not available to this user.
      <error>Error message</error>
* <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.
    </status>
* <error>DID does not exist</error> - Enter existing DID number.
</page>
* <error>Invalid DID specified</error> - Enter a valid (numeric) DID number.
 
* <error>Your are not authorized to use this DID</error> - Specified DID is not available to this user.
Error messages:
* <error>DID is terminated</error> - DID is terminated and cannot be used.
 
* <error>DID is not free</error> - DID is being used in a Dial Plan or another Device is already assigned.
* Incorrect hash – Hash was not correct. Check API_Secret_Key and order or params while concatenating hash_string.
* <error>Device was not assigned</error>
* Access Denied – Only Admin, Accountant or Reseller may use API.
* Device was not found Device ID does not exist in system.
* Your are not authorized to use this Device Specified Device is not available to this user.
* You are not authorized to manage DIDs If Accountant or Reseller is using API, they should have all permissions to perform specified actions.
* DID does not exist Enter existing DID number.
* Invalid DID specified Enter a valid (numeric) DID number.
* 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 not free DID is being used in a Dial Plan or another Device is already assigned.
* Device was not assigned – unknown error
 
 
<br><br>
<br><br>
=See also=
=See also=


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

Revision as of 14:02, 29 May 2013

Descriptiom

MOR API DID assign Device

Usage

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



Parametres

  • did - DID number where device have to be assigned. Required.
  • device_id - Device ID in MOR database, to be assigned for specified DID 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 device_id = 1, did=123456789, API Secret Key = secret

We send

HTML POST: http://<SERVER_IP>/billing/api/did_device_assign?u=username&did=123456789&device_id=1&hash=bc2f114099d16656d37e45fd9e8744cb9386d462

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>
      <error>Device assigned to DID</error>
   </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.
  • Your are not authorized to use this Device – Specified Device is not available to this user.
  • You are not authorized to manage DIDs – If Accountant or Reseller is using API, they should have all permissions to perform specified actions.
  • DID does not exist – Enter existing DID number.
  • Invalid DID specified – Enter a valid (numeric) DID number.
  • 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 not free – DID is being used in a Dial Plan or another Device is already assigned.
  • Device was not assigned – unknown error




See also