MOR API CLI add

From Kolmisoft Wiki
Revision as of 08:57, 11 June 2014 by Tomas (talk | contribs) (→‎Request)
Jump to navigationJump to search

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.
  • cli_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&cli_description=description&comment=comment&ivr_id=2&banned=1&device_id=2&test=1&hash=1ba6df6ad2532aea7ca035be29b7dd63feb1df88

* 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