Difference between revisions of "MOR API CLI add"

From Kolmisoft Wiki
Jump to navigationJump to search
(Created page with '=Description= <!---This functionality is available from in MOR X3 and from MOR X5---> MOR API CLI add Please note that admin/reseller can create CLI just for their own Users…')
 
Line 19: Line 19:
* ivr_id – id of the IVR.  
* ivr_id – id of the IVR.  
* device_id – id of device this CLI should be assigned to. '''Required'''.
* device_id – id of device this CLI should be assigned to. '''Required'''.
* [[MOR API hash construction | hash]] SHA1 hash constructed using '''cli_number''', '''cli_number''', '''cli_number''', '''cli_number''', '''cli_number''' and '''API_Secret_Key''' ([[MOR API hash construction | More described in Constructing hash]]). '''Required'''.
* [[MOR API hash construction | hash]] - SHA1 hash constructed using parameters above and API_Secret_Key ([[MOR API hash construction | More described in Constructing hash]]). '''Required'''.
 





Revision as of 06:51, 4 June 2014

Description

MOR API CLI add

Please note that admin/reseller can create CLI just for their own Users Devices.

Usage

  • Call: /api/cli_add



Parametres

  • u – username to login. Required.
  • cli_number – this specifies CLI number which will be deleted. Required.
  • description – description of CLI
  • comment – comment of CLI
  • banned – banned (1) or not banned (0).
  • ivr_id – id of the IVR.
  • device_id – id of device this CLI should be assigned to. Required.
  • hash - SHA1 hash constructed using parameters above and API_Secret_Key ( More described in Constructing hash). Required.


Returning XML is put in file. That file is gziped and returned as a response content.

Request

We have API Secret Key = 456789, cli_number = 12345, device_id = 2 and CLI should be banned.
We send:

HTML POST: http://<server_ip>/billing/api/cli_add?u=admin&cli_number=1234678&description=description&comment=comment&ivr_id=2&banned=1&device_id=2&test=1&hash=f4e91be346b55776ee342e5863b3803dc69c3627

* Note that username and password are not included in hash

Returns

Success

<page>
      <status>CLI successfully created</status>
</page>




Errors

  • <error>CLI must be numeric</error> – CLI must be numeric.
  • <error>CLI already exists. It is assigned to user_name device</error> - such CLI is already created and belongs to the user that is mention in this error notice.
  • <error>CLI Number cannot be empty</error> - CLI number must be specified.
  • <error>IVR was not found</error> - if IVR parameter is used, IVR id must be also specified.
  • <error>Device ID cannot be empty</error> - device id must be specified.
  • <error>Access Denied</error> – User was not found by username and password. Use correct username and password. Make sure that username (u) and password (p) are specified.
  • <error>You are not authorised to use this functionality</error> - accountant needs to have Manage Device permissions.
  • <error>Incorrect hash</error> – Hash was not correct. Check API_Secret_Key and order or params while concatenating hash_string.



See also