Difference between revisions of "MOR API location rules get"

From Kolmisoft Wiki
Jump to navigationJump to search
 
(2 intermediate revisions by the same user not shown)
Line 13: Line 13:


* '''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'''. To show all location rules, it is possible to use '''location_id=all'''
* [[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).
* [[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).
* '''from''' - from which record to show results '''Optional'''.
* '''from''' - from which record to show results '''Optional'''.
Line 32: Line 32:
   <status>
   <status>
     <location>
     <location>
    <id>1</id>
       <name>Global</name>
       <name>Global</name>
       <location_rule>
       <location_rule>
Line 85: Line 86:
* <error>Access denied</error> - authentication user is incorrect.
* <error>Access denied</error> - authentication user is incorrect.
<br><br>
<br><br>
=See also=
=See also=


* [[MOR API]]
* [[MOR API]]

Latest revision as of 11:57, 5 October 2023

Description

Admin – can get any location rules.
Reseller – can get his and his users location rules.


Usage

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



Parametres

  • u – username for authentication. This is owner (admin or reseller) Required.
  • location_id - location ID in MOR database Required. To show all location rules, it is possible to use location_id=all
  • 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>
    <id>1</id>
     <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.



See also