MOR API did rates get
From Kolmisoft Wiki
Jump to navigationJump to search
Description
MOR API Get DID rates
Usage
- From MOR X12 call: /api/did_rates_get
- Methods: POST, GET(if allowed, not recommended)
Parameters
Parameters which are included into hash:
- did - DID number Required.
Parameters which are not included into hash:
- u - username for authentication. Required.
- hash - SHA1 hash constructed using params and API_Secret_Key ( More described in Constructing hash). Required.
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
Now we can view these changes in GUI through DID 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.