Difference between revisions of "MOR API provider rules get"
From Kolmisoft Wiki
Jump to navigationJump to search
(Created page with "=Description= MOR API provider rules get <br><br> =Usage= * Call: /api/provider_rules_get * Methods: POST, GET(if allowed, not recomended) <br><br> ===Parameters=== Parameters which are '''included''' into hash: * provider_id - List rules of this Provider. '''Required'''. <br><br> Parameters which are '''not included''' into hash: * ''' hash''' - SHA1 hash constructed using '''parameters''' which are listed above. Note that parame...") |
|||
Line 35: | Line 35: | ||
'''Success''' | '''Success''' | ||
<?xml version="1.0" encoding="UTF-8"?> | <?xml version="1.0" encoding="UTF-8"?> | ||
<page> | <page> | ||
<status> | <status> | ||
<provider_rules> | <provider_rules> |
Revision as of 07:55, 10 January 2023
Description
MOR API provider rules get
Usage
- Call: /api/provider_rules_get
- Methods: POST, GET(if allowed, not recomended)
Parameters
Parameters which are included into hash:
- provider_id - List rules of this Provider. Required.
Parameters which are not included into hash:
- hash - SHA1 hash constructed using parameters which are listed above. Note that parameters are shown in the same order as they have to be when generating the hash. Last parameter in a row is API_Secret_Key ( More described in Constructing hash). Required.
- u - username for authentication. Required.
Request
We have device_id = 2, API Secret Key = secret
We send:
HTML POST: http://SERVER_IP/billing/api/provider_rules_get?u=admin&provider_id=5&hash=6e79d4a82f68102f43be11d873177f47817f84df
Returns
Success
<?xml version="1.0" encoding="UTF-8"?> <page> <status> <provider_rules> <provider_rule> <id>1</id> <provider_id>5</provider_id> <name>Test Rule</name> <enabled>1</enabled> <cut>370</cut> <add>370</add> <minlen>1</minlen> <maxlen>100</maxlen> <pr_type>dst</pr_type> <change_callerid_name>0</change_callerid_name> <tariff_id></tariff_id> <set_pai>0</set_pai> <suffix></suffix> </provider_rule> </provider_rules> </status> </page>
Errors
- Provider was not found - Provider does not exist;
- Provider has no rules - Provider does not have any rules.
Example:
<?xml version="1.0" encoding="UTF-8"?> <page> <error>Error message</error> </page>