MOR API tariffs get
From Kolmisoft Wiki
Revision as of 08:24, 20 June 2022 by Nerijuss (talk | contribs) (Created page with "=Description= Retrieve list of tariffs <br><br> =Usage= * Call: '''/api/tariffs_get''' * Methods: POST, GET(if allowed, not recomended) <br><br> ===Parameters=== Parameters which are '''included''' into hash: * u - username for authentication. '''Required'''. <br/><br/> Parameters which are '''not included''' into hash: * hash - SHA1 hash constructed using '''tariff_id''' and/or '''user_id''' and '''API_Secret_Key''' (MOR API hash con...")
Description
Retrieve list of tariffs
Usage
- Call: /api/tariffs_get
- Methods: POST, GET(if allowed, not recomended)
Parameters
Parameters which are included into hash:
- u - username for authentication. Required.
Parameters which are not included into hash:
- hash - SHA1 hash constructed using tariff_id and/or user_id and API_Secret_Key ( More described in Constructing hash). Required.
Request
We have username admin
We send:
HTML POST: http://<SERVER_IP>/billing/api/tariffs_get?u=admin&hash=71516eea4850f7e0300ac86adf9fb64bca845aa7
Returns
Success
<page> <tariffs> <tariff> <id>1</id> <name>Test Tariff</name> <purpose>provider</purpose> <currency>USD</currency> <last_update_date/> </tariff> <tariff> <id>2</id> <name>Test Tariff for Users</name> <purpose>user_wholesale</purpose> <currency>USD</currency> <last_update_date/> </tariff> <tariff> <id>4</id> <name>Test Tariff + 0.1</name> <purpose>user</purpose> <currency>USD</currency> <last_update_date/> </tariff> <tariff> <id>5</id> <name>Test Tariff bad currency</name> <purpose>provider</purpose> <currency>AAA</currency> <last_update_date/> </tariff> <tariff> <id>6</id> <name>test_1</name> <purpose>user_by_provider</purpose> <currency>USD</currency> <last_update_date>2022-06-13 14:50:06 +0300</last_update_date> <delta_value/> <delta_percent>111.0</delta_percent> </tariff> </tariffs> </page>
Errors
- <error>You are not authorized to use this functionality</error>
- <error>Access Denied</error>
- <error>No Tariffs found</error>