Difference between revisions of "MOR API dids get"

From Kolmisoft Wiki
Jump to navigationJump to search
 
(One intermediate revision by one other user not shown)
Line 19: Line 19:
* '''search_device''' - device_id
* '''search_device''' - device_id
* '''search_provider''' - provider_id
* '''search_provider''' - provider_id
* '''search_language''' - word which is used in DIDs configuration as languege
* '''search_language''' - word which is used in DIDs configuration as language
* '''search_hide_terminated_dids''' - 1 - hide, 0 - show
* '''search_hide_terminated_dids''' - 1 - hide, 0 - show
* '''from''' - from which record to show results.
* '''max_results''' - how many records to show.
<br><br>
<br><br>
===Request===
===Request===
Line 32: Line 34:
* Now we can find free DIDs in GUI DIDs list.
* Now we can find free DIDs in GUI DIDs list.


'''* Note that username are not included in hash'''
'''* Note that all parameters are not included in the hash, but "u" and hash are required for the API.'''
<br><br>
<br><br>
===Returns===
===Returns===



Latest revision as of 14:15, 21 February 2023

Description

MOR API DIDs get

Usage

  • Call: /api/dids_get
  • Methods: POST, GET(if allowed, not recomended)



Parametres

  • hash - SHA1 hash constructed using API_Secret_Key ( More described in Constructing hash). Required.
  • u - username for authentication. Required.
  • search_did_number - DID number
  • search_status - free, reserved, active, closed, terminated
  • search_did_owner - text
  • search_dialplan - dialplan_id
  • search_user - user_id
  • search_device - device_id
  • search_provider - provider_id
  • search_language - word which is used in DIDs configuration as language
  • search_hide_terminated_dids - 1 - hide, 0 - show
  • from - from which record to show results.
  • max_results - how many records to show.



Request

We have search_status = free, API Secret Key = secret

We send:

HTML POST: http://<SERVER_IP>/billing/api/dids_get?u=admin&search_status=free&hash=6e79d4a82f68102f43be11d873177f47817f84df
  • Now we can find free DIDs in GUI DIDs list.

* Note that all parameters are not included in the hash, but "u" and hash are required for the API.

Returns

Success

<?xml version="1.0" encoding="UTF-8"?>
<page>
  <dids>
  <did>
     <did>37066xxxxxx</did>
     <provider>Test Provider</provider>
     <language>language</language>
     <status>Active</status>
     <reseller>Test Reseller</reseller>
     <owner>User Resellers</owner>
     <device>IAX2/105</device>
     <dial_plan></dial_plan>
     <simultaneous_call_limit>Unlimited</simultaneous_call_limit>
     <tone_zone>it</tone_zone>
     <id>6501</id>
   </did>
   <did>
     <did>37066xxxxxx</did>
     <provider>Test Provider</provider>
     <language></language>
     <status>Active</status>
     <reseller>Test Reseller</reseller>
     <device></device>
     <dial_plan>testDialPlan (authbypin)</dial_plan>
     <simultaneous_call_limit>Unlimited</simultaneous_call_limit>
     <tone_zone></tone_zone>
     <id>6502</id>
   </did>
  </dids>
</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> - User with UNIQUEHASH not found or params id not send. Enter correct id.
  • <error>No DIDs found</error> - No DIDs found

Example:

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



See also