Difference between revisions of "MOR API location rules get"
From Kolmisoft Wiki
Jump to navigationJump to search
| Line 8: | Line 8: | ||
* '''u''' – username for authentication. This is owner (admin or reseller) '''Required'''. | * '''u''' – username for authentication. This is owner (admin or reseller) '''Required'''. | ||
* '''location_id''' - location ID in MOR database '''Required'''. | * '''location_id''' - location ID in MOR database '''Required'''. | ||
* '''from''' - from which record to show results ''' | * [[MOR API hash construction | hash]] - SHA1 hash constructed using '''params''' and '''API_Secret_Key''' ([[MOR API hash construction | More described in Constructing hash]]). '''Required''' (if setting '''Disable hash checking''' is not checked). | ||
* '''max_results''' - How many records to show ''' | * '''from''' - from which record to show results '''Optional'''. | ||
* '''max_results''' - How many records to show '''Optional'''. | |||
<br><br> | <br><br> | ||
Revision as of 14:44, 3 April 2019
Description
Admin – can get any location rules.
Reseller – can get his and his users location rules.
Parametres
- u – username for authentication. This is owner (admin or reseller) Required.
- location_id - location ID in MOR database Required.
- hash - SHA1 hash constructed using params and API_Secret_Key ( More described in Constructing hash). Required (if setting Disable hash checking is not checked).
- from - from which record to show results Optional.
- max_results - How many records to show Optional.
Request
We send:
HTML POST: http://<SERVER_IP>/billing/api/location_rules_get?u=admin&location_id=1&hash=f10a3a417b912bc58021b6d0a36a162380a6b539
Returns
Success
<page>
<status>
<location>
<name>Global</name>
<location_rule>
<id>1</id>
<location_id>1</location_id>
<name>Int. prefix</name>
<enabled>1</enabled>
<cut>00</cut>
<add></add>
<minlen>10</minlen>
<maxlen>20</maxlen>
<lr_type>dst</lr_type>
<lcr_id></lcr_id>
<tariff_id></tariff_id>
<did_id></did_id>
<device_id></device_id>
<change_callerid_name>0</change_callerid_name>
<src_cut></src_cut>
<src_add></src_add>
<src_minlen>1</src_minlen>
<src_maxlen>100</src_maxlen>
<locationgroup_id>0</locationgroup_id>
</location_rule>
<location_rule>
<id>2</id>
<location_id>1</location_id>
<name>STANDARD prefix</name>
<enabled>1</enabled>
<cut>10#</cut>
<add></add>
<minlen>10</minlen>
<maxlen>20</maxlen>
<lr_type>dst</lr_type>
<lcr_id>2</lcr_id>
<tariff_id>4</tariff_id>
<did_id></did_id>
<device_id></device_id>
<change_callerid_name>0</change_callerid_name>
<src_cut></src_cut>
<src_add></src_add>
<src_minlen>1</src_minlen>
<src_maxlen>100</src_maxlen>
<locationgroup_id>0</locationgroup_id>
</location_rule>
</location>
</status>
</page>
Errors
- <error>Location was not found</error>
- <error>Access denied</error> - authentication user is incorrect.