MOR API location rule copy

From Kolmisoft Wiki

Jump to: navigation, search

Contents

[edit] Description

Copies localization rule from one 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.



[edit] Usage

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



[edit] Parameters

Parameters which are included into hash:

  • location_rule_id - id of location 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.


[edit] Request

Example:

HTML POST: http://<SERVER_IP>//billing/api/location_rule_copy?u=admin&location_rule_id=8&location_id=2&hash=ae17d6e98af04a4ad400e65c74d90385a2a0d912

* Note that username is not included in hash

[edit] Returns

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

[edit] Errors

Possible Error return values are:

  • Location was not found - location with location_id does not exist.
  • Location error - Reseller does not have permission to copy rule to that location.
  • Location rule was not found - location with location_rule_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>

[edit] See also

Personal tools

Try MOR

Try M2