Difference between revisions of "MOR API location rule copy"

From Kolmisoft Wiki
Jump to navigationJump to search
(Created page with '<!---This functionality is available from MOR X14---> =Description= Copies localization rule from once location to other one<br><br> '''Admin''' - can copy localization rules be…')
 
Line 54: Line 54:
* 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.
Example:
<?xml version="1.0" encoding="UTF-8"?>
<page>
  <status>
    <error>Location rule was not found</error>
  </status>
</page>
=See also=
* [[MOR API]]

Revision as of 14:52, 3 April 2019

Description

Copies localization rule from once location to other one

Admin - can copy localization rules between Admin locations and between Admin and Reseller locations.

Reseller - can copy localization rules between his own locations.



Usage

  • From MOR X14 call: /api/location_rule_copy
  • Methods: POST, GET(if allowed, not recomended)



Parameters

Parameters which are included into hash:

  • location_rule_id - id of rule which will be copied. Required
  • location_id - id of location to which rule with location_rule_id will be copied to. 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 resseller username Required.


Request

Example:

HTML POST: 192.168.0.106/billing/api/location_rule_copy?u=admin&location_rule_id=8&location_id=2&hash=ae17d6e98af04a4ad400e65c74d90385a2a0d912

* Note that username is not included in hash

Returns

<?xml version="1.0" encoding="UTF-8"?>
<page>
  <status>
    <success>Rule copied</success>
  </status>
</page>

Errors

Possible Error return values are:

  • Location was not found - location with id does not exist.
  • Location error - Reseller does not have permission to copy rule to that location.
  • Location rule was not found - location with that id does not exist.
  • Rule must be unique - exactly same rule already exists in location we are trying to copy to.
  • 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>Location rule was not found</error>
  </status>
</page>

See also