MOR API location rules get

From Kolmisoft Wiki
Revision as of 15:23, 3 April 2019 by Edvardas (talk | contribs)
Jump to navigationJump to search

Description

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


Usage

  • From MOR X14 call: /api/location_rule_delete
  • 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.
  • 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.



See also