MOR API did rates get

From Kolmisoft Wiki

Jump to: navigation, search

Contents

[edit] Description

MOR API Get DID rates

[edit] Usage

  • From MOR X12 call: /api/did_rates_get
  • Methods: POST, GET(if allowed, not recommended)



[edit] Parameters

Parameters which are included into hash:

  • did - DID number Required.

Parameters which are not included into hash:



[edit] Request

We have DID 370123456789, API Secret Key = secret

We send

HTML POST: http://<SERVER_IP>/billing/api/did_rates_get?did=370123456789&u=admin&hash=a2ceb0323d6a76a9fc9b66a21d321ae618c40296




[edit] Returns

<?xml version="1.0" encoding="UTF-8"?>
<page>
  <rates>
    <rate>
      <id>49</id>
      <start_time>00:00:00</start_time>
      <end_time>23:59:59</end_time>
      <rate>0.4</rate>
      <connection_fee>0.0</connection_fee>
      <increment_s>1</increment_s>
      <min_time>0</min_time>
      <did_id>17</did_id>
      <rate_type>provider</rate_type>
      <daytype></daytype>
    </rate>
    <rate>
      <id>50</id>
      <start_time>00:00:00</start_time>
      <end_time>23:59:59</end_time>
      <rate>0.0</rate>
      <connection_fee>0.0</connection_fee>
      <increment_s>1</increment_s>
      <min_time>0</min_time>
      <did_id>17</did_id>
      <rate_type>owner</rate_type>
      <daytype></daytype>
    </rate>
    <rate>
      <id>51</id>
      <start_time>00:00:00</start_time>
      <end_time>23:59:59</end_time>
      <rate>0.3</rate>
      <connection_fee>0.0</connection_fee>
      <increment_s>1</increment_s>
      <min_time>0</min_time>
      <did_id>17</did_id>
      <rate_type>incoming</rate_type>
      <daytype>WD</daytype>
    </rate>
    <rate>
      <id>52</id>
      <start_time>00:00:00</start_time>
      <end_time>23:59:59</end_time>
      <rate>0.2</rate>
      <connection_fee>0.0</connection_fee>
      <increment_s>1</increment_s>
      <min_time>0</min_time>
      <did_id>17</did_id>
      <rate_type>incoming</rate_type>
      <daytype>FD</daytype>
    </rate>
  </rates>
</page>

Errors

<?xml version="1.0" encoding="UTF-8"?>
<page>
   <status>
      <error>Error message</error>
   </status>
</page>

Error messages:

  • Incorrect hash – Hash was not correct. Check API_Secret_Key and order or params while concatenating hash_string.
  • Access Denied – Only Admin, Accountant or Reseller may use API.
  • DID was not found – DID number does not exist or incorrect.



[edit] See also

Personal tools

Try MOR

Try M2