Difference between revisions of "MOR API Calling Cards get"
From Kolmisoft Wiki
Jump to navigationJump to search
Line 4: | Line 4: | ||
=Usage= | =Usage= | ||
* Call: /api/calling_cards_get | * Call: /api/calling_cards_get '''(from MOR X7)''' | ||
* Methods: POST, GET(if allowed, not recomended) | * Methods: POST, GET(if allowed, not recomended) | ||
<br><br> | <br><br> |
Revision as of 14:37, 5 November 2015
Description
MOR API Returns the list of Calling Cards with respect to provided search parameters.
Usage
- Call: /api/calling_cards_get (from MOR X7)
- Methods: POST, GET(if allowed, not recomended)
Parameters
- hash - SHA1 hash constructed using the required parameters (in this case none of the parameters is required). The hash will contain only an API_Secret_Key ( More described in Constructing hash). Required.
- u - username for authentication. Required.
- number - Calling Card's number.
- name - Calling Card's name
- pin - Calling Card's PIN code.
- batch_number - Calling Card's batch number.
- min_balance - lower boundary of the Calling Card's balance range.
- max_balance - upper boundary of the Calling Card's balance range.
- callerid - Calling Card's CallerID for "pinless" dialing.
- language - Calling Card's language.
- sold - determines whether a Calling Card is sold or not (yes|no 1|0).
- distributor - Calling Card's distributor's (User's) id.
Request
We have u = admin, API Secret Key = secret
We send:
HTML POST: http://<SERVER_IP>/billing/api/calling_cards_get?u=admin&number=1111111119&name=test_card&pin=2668&min_balance=10&max_balance=50&language=en&callerid=3&sold=0&distributor=2&hash=e5e9fa1ba31ecd1ae84f75caaa474f3a663f05f4
- Now we get a search result containing the Calling Cards with the specified attributes data.
* Note that a Username and a Password are not included into hash
Returns
Success
<?xml version="1.0" encoding="UTF-8"?> <page> <cards> <card> <card_id>26</card_id> <card_number>1111111119</card_number> <card_name>test_card</card_name> <card_pin>2668</card_pin> <card_batch_number>5</card_batch_number> <card_callerid>3</card_callerid> <card_balance>10.0840336134454</card_balance> <card_minimal_balance>20.0</card_minimal_balance> <card_first_use/> <card_daily_charge_paid_till>2015-11-05 02:00:00 +0200</card_daily_charge_paid_till> <card_sold>0</card_sold> <card_language>en</card_language> <card_distributor>Test User #1</card_distributor> </card> </cards> </page>
Errors
- <error>Access Denied</error> - User is not authorized or is a Simple User. Only Admin, Reseller or Accounant can use this API method.
- <error>Incorrect hash</error> - hash is not correct. Check API_Secret_Key and order or parameters while concatenating a hash_string.
- <error>You are not authorized to use this functionality</error> - User has no permissions to manage Calling Cards.
- <error>Cards were not found</error> - no Cards were found with provided search parameters.
Example:
<?xml version="1.0" encoding="UTF-8"?> <page> <status> <error>Cards were not found</error> </status> </page>