Difference between revisions of "MOR API CLI add"
From Kolmisoft Wiki
Jump to navigationJump to search
(5 intermediate revisions by 3 users not shown) | |||
Line 13: | Line 13: | ||
* u – username to login. '''Required'''. | * u – username to login. '''Required'''. | ||
* cli_number – this specifies CLI number which will be | * device_id – id of device this CLI should be assigned to. '''Required'''. | ||
* | * cli_number – this specifies CLI number which will be added. '''Required If cli_domain is empty'''. | ||
* cli_domain - domain of CLI. '''Required If cli_number is empty. It is not included into hash'''. | |||
* cli_description – description of CLI | |||
* comment – comment of CLI | * comment – comment of CLI | ||
* banned – banned (1) or not banned (0). | * banned – banned (1) or not banned (0). | ||
* ivr_id – id of the IVR. | * ivr_id – id of the IVR. | ||
* [[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'''. | * [[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'''. | ||
Line 31: | Line 32: | ||
We send: | We send: | ||
HTML POST: http://<server_ip>/billing/api/cli_add?u=admin&cli_number=1234678& | 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''' | '''* Note that username and password are not included in hash''' | ||
Line 58: | Line 59: | ||
* <error>Incorrect hash</error> – Hash was not correct. Check API_Secret_Key and order or params while concatenating hash_string. | * <error>Incorrect hash</error> – Hash was not correct. Check API_Secret_Key and order or params while concatenating hash_string. | ||
<br><br> | <br><br> | ||
=See also= | =See also= | ||
* [[MOR API]] | * [[MOR API]] | ||
* [[CLIs (Incoming CallerIDs)]] | * [[CLIs (Incoming CallerIDs)]] |
Latest revision as of 10:01, 15 February 2021
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.
- device_id – id of device this CLI should be assigned to. Required.
- cli_number – this specifies CLI number which will be added. Required If cli_domain is empty.
- cli_domain - domain of CLI. Required If cli_number is empty. It is not included into hash.
- cli_description – description of CLI
- comment – comment of CLI
- banned – banned (1) or not banned (0).
- ivr_id – id of the IVR.
- 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.