Difference between revisions of "MOR API location rule update"
From Kolmisoft Wiki
Jump to navigationJump to search
(Created page with '<!---This functionality is available from MOR X14---> =Description= Create localization rule<br><br> '''Admin''' - can update localization rules for locations under Admin accoun…') |
|||
(8 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
<!---This functionality is available from MOR X14---> | <!---This functionality is available from MOR X14---> | ||
=Description= | =Description= | ||
Update localization rule<br><br> | |||
'''Admin''' - can update localization rules for locations under Admin account. | '''Admin''' - can update localization rules for locations under Admin account. | ||
Line 18: | Line 18: | ||
Parameters which are '''included''' into hash: | Parameters which are '''included''' into hash: | ||
* | * location_rule_id - id of location rule which will be updated. '''Required'''. | ||
'''Note that parameters are shown in the same order as they have to be when generating the hash. Last parameter in a row is API_Secret_Key''' | '''Note that parameters are shown in the same order as they have to be when generating the hash. Last parameter in a row is API_Secret_Key''' | ||
Line 40: | Line 40: | ||
* did_id - id of did to route call to (-1 if you want to unassign it). | * did_id - id of did to route call to (-1 if you want to unassign it). | ||
* device_id - id of device to change call owner to (-1 if you want to unassign it). | * device_id - id of device to change call owner to (-1 if you want to unassign it). | ||
* change_callerid_name - | * change_callerid_name - change callerid name option (0 - disabled, 1 - enabled, default 0). | ||
* | * location_group_id - id of location group (available only for combined rules). | ||
* dst_locationgroup_id - id of location group (available only for combined rules). | |||
===Request=== | ===Request=== | ||
Line 48: | Line 48: | ||
Example: | Example: | ||
HTML POST: http://<SERVER_IP>/billing/api/ | HTML POST: http://<SERVER_IP>/billing/api/location_rule_update?u=admin&location_rule_id=19&cut=8683&add=370683&minlen=1&maxlen=97&hash=9ddb5c8853d0a6a6299f70379ced8bdd78ce87af | ||
<br><br> | <br><br> | ||
Line 55: | Line 55: | ||
<page> | <page> | ||
<status> | <status> | ||
<success>Rule | <success>Rule updated</success> | ||
</status> | </status> | ||
</page> | </page> | ||
Line 67: | Line 67: | ||
* Cut and Add cannot be empty - both cut and add parameters are empty. | * Cut and Add cannot be empty - both cut and add parameters are empty. | ||
* Device not found - device id does not exist. | * Device not found - device id does not exist. | ||
* Location | * Location rule was not found - location rule with location_rule_id does not exist or belongs to different account. | ||
* LCR was not found - LCR with lcr_id does not exist. | |||
* | |||
* Cannot assign lcr - lcr_id was used in Reseller account. | * Cannot assign lcr - lcr_id was used in Reseller account. | ||
* Cannot assign did - did_id was used in Reseller account. | * Cannot assign did - did_id was used in Reseller account. | ||
* DID was not found - DID with did_id does not exist. | * DID was not found - DID with did_id does not exist. | ||
* Tariff was not found - tariff does not exist or is not accessible. | * Tariff was not found - tariff does not exist or is not accessible. | ||
* Location Group was not found - location group with id location_group_id does not exist. | |||
* Access Denied - incorrect authentication username. | * Access Denied - incorrect authentication username. | ||
* Incorrect hash – Hash was not correct. Check API_Secret_Key and order or params while concatenating hash_string. | * Incorrect hash – Hash was not correct. Check API_Secret_Key and order or params while concatenating hash_string. | ||
Line 81: | Line 81: | ||
<page> | <page> | ||
<status> | <status> | ||
<error> | <error> | ||
<message>LCR was not found</message> | |||
</error> | |||
</status> | </status> | ||
</page> | </page> |
Latest revision as of 11:44, 28 July 2020
Description
Update localization rule
Admin - can update localization rules for locations under Admin account.
Reseller - can update localization rules for his own locations.
Usage
- From MOR X14 call: /api/location_rule_update
- Methods: POST, GET(if allowed, not recommended)
Parameters
Parameters which are included into hash:
- location_rule_id - id of location rule which will be updated. Required.
Note that parameters are shown in the same order as they have to be when generating the hash. Last parameter in a row is API_Secret_Key
Parameters which are not included into hash:
- hash - SHA1 hash constructed using parameters above and API_Secret_Key ( More described in Constructing hash). Required (if setting Disable hash checking is not checked).
- u - username for authentication. Either admin or reseller username. Required.
- enabled - enable or disable rule (enable - 1, disable - 0, default 1)
- name - name of localization rule.
- cut - cut pattern for destination
- add - add pattern for destination..
- minlen - minimal length for destination pattern (default 1).
- maxlen - maximum length for destination pattern (default 99).
- src_cut - cut pattern for source.
- src_add - add pattern for source.
- src_minlen - minimal length for source pattern (default 1).
- src_maxlen - minimal length for destination pattern(default 99).
- tariff_id - id of tariff to change to (-1 if you want to unassign it).
- lcr_id - id of lcr to change to (-1 if you want to unassign it).
- did_id - id of did to route call to (-1 if you want to unassign it).
- device_id - id of device to change call owner to (-1 if you want to unassign it).
- change_callerid_name - change callerid name option (0 - disabled, 1 - enabled, default 0).
- location_group_id - id of location group (available only for combined rules).
- dst_locationgroup_id - id of location group (available only for combined rules).
Request
Example:
HTML POST: http://<SERVER_IP>/billing/api/location_rule_update?u=admin&location_rule_id=19&cut=8683&add=370683&minlen=1&maxlen=97&hash=9ddb5c8853d0a6a6299f70379ced8bdd78ce87af
Returns
<?xml version="1.0" encoding="UTF-8"?> <page> <status> <success>Rule updated</success> </status> </page>
Errors
Possible Error return values are:
- Rule must be unique - exact same rule already exists.
- Rule must have name - name parameter is empty.
- Cannot assign device - device id is not suitable (for example, device id is internal Provider device).
- Cut and Add cannot be empty - both cut and add parameters are empty.
- Device not found - device id does not exist.
- Location rule was not found - location rule with location_rule_id does not exist or belongs to different account.
- LCR was not found - LCR with lcr_id does not exist.
- Cannot assign lcr - lcr_id was used in Reseller account.
- Cannot assign did - did_id was used in Reseller account.
- DID was not found - DID with did_id does not exist.
- Tariff was not found - tariff does not exist or is not accessible.
- Location Group was not found - location group with id location_group_id does not exist.
- Access Denied - incorrect authentication username.
- Incorrect hash – Hash was not correct. Check API_Secret_Key and order or params while concatenating hash_string.
Example:
<?xml version="1.0" encoding="UTF-8"?> <page> <status> <error> <message>LCR was not found</message> </error> </status> </page>