Difference between revisions of "MOR API tariff rates get"

From Kolmisoft Wiki
Jump to navigationJump to search
Line 28: Line 28:
   <pagename> Tariff </pagename>
   <pagename> Tariff </pagename>
   <tariff_name> ''tariff name'' </tariff_name>
   <tariff_name> ''tariff name'' </tariff_name>
  <purpose> ''tariff type'' </purpose>
   <currency> ''currency'' </currency>
   <currency> ''currency'' </currency>
   <rates>
   <rates>
   <rate>
   <destination>
     <name> ''name'' </name>
     <destination_group_name> ''name'' </destination_group_name>
     <destination_type> ''destination type'' </destination_type>
     <destination_group_type> ''destination type'' </destination_group_type>
     <duration> ''duration'' </duration>
     <rate>
    <type> ''type'' </type>
    <duration> ''duration'' </duration>
    <round_by> ''round by'' </round_by>
    <type> ''type'' </type>
    <tariff_rate> ''rate'' </tariff_rate>
    <round_by> ''round by'' </round_by>
    <start_time> ''start time'' </start_time>
    <tariff_rate> ''rate'' </tariff_rate>
    <end_time> ''end time'' </end_time>
    <start_time> ''start time'' </start_time>
    <daytype> ''daytype'' </daytype>
    <end_time> ''end time'' </end_time>
   </rate>
    <daytype> ''daytype'' </daytype>
    </rate>
   </destination>
   </rates>
   </rates>
  </page>
  </page>


** Wholesale:
** Wholesale:
Line 48: Line 54:
   <pagename> Tariff </pagename>
   <pagename> Tariff </pagename>
   <tariff_name> ''tariff name'' </tariff_name>
   <tariff_name> ''tariff name'' </tariff_name>
  <purpose> ''tariff type'' </purpose>
   <currency> ''currency'' </currency>
   <currency> ''currency'' </currency>
   <rates>
   <rates>

Revision as of 09:46, 23 December 2011

This functionality is available from MOR 11


MOR API Tariff rates






  • Call: /api/get_tariff
  • Params:
    • u - username to login. Required.
    • p - password to login. Required.
    • tariff_id - user tariff id (option for admin or reseller). If not sent, user gets his tariff rates.
    • hash - SHA1 hash constructed using tariff_id and API_Secret_Key ( More described in Constructing hash). Required.


  • Errors:
    • <error>No tariff found</error> - Tariff was not found.
    • <error>Bad login</error> - User was not found by username and password. Use correct username and password. Make sure that username (u) and password (p) are specified.
    • <error>Incorrect hash</error> - Hash was not correct. Check API_Secret_Key and order or params while concatenating hash_string.
  • Returns:
    • Retail:
<page>
 <pagename> Tariff </pagename>
 <tariff_name> tariff name </tariff_name>
 <purpose> tariff type </purpose>
 <currency> currency </currency>
 <rates>
  <destination>
   <destination_group_name> name </destination_group_name>
   <destination_group_type> destination type </destination_group_type>
   <rate>
    <duration> duration </duration>
    <type> type </type>
    <round_by> round by </round_by>
    <tariff_rate> rate </tariff_rate>
    <start_time> start time </start_time>
    <end_time> end time </end_time>
    <daytype> daytype </daytype>
   </rate>
  </destination>
 </rates>
</page>



    • Wholesale:
<page>
 <pagename> Tariff </pagename>
 <tariff_name> tariff name </tariff_name>
 <purpose> tariff type </purpose>
 <currency> currency </currency>
 <rates>
  <rate>
   <direction> direction </direction>
   <destination> destination </destination>
   <prefix> prefix </prefix>
   <subcode> subcode </subcode>
   < code> code 
   <tariff_rate> rate </tariff_rate>
   <con_fee> connection fee </con_fee>
   <increment> increment </increment>
   <min_time> minimal time </min_time>
   <start_time> start time </start_time>
   <end_time> end time </end_time>
   <daytype> daytype </daytype>
  </rate>
 </rates>
</page>




  • Example:
    • We have API Secret Key = 456789, tariff_id = 100
    • Hash string to be converted: "100456789"
    • We send:
      • /api/get_tariff?u=admin&p=admin&tariff_id=100&hash=71516eea4850f7e0300ac86adf9fb64bca845aa7

* Note that username and password are not included in hash