Difference between revisions of "MOR API Card Group create"
From Kolmisoft Wiki
Jump to navigationJump to search
Line 23: | Line 23: | ||
* '''ghost_min_perc''' - ghost min percent for Card Group. | * '''ghost_min_perc''' - ghost min percent for Card Group. | ||
* '''daily_charge''' - daily charge for Card Group. | * '''daily_charge''' - daily charge for Card Group. | ||
* '''tariff_id''' - Card Group | * '''tariff_id''' - Card Group Tariff ID. | ||
* '''lcr_id''' - Card Group | * '''lcr_id''' - Card Group LCR id. | ||
* '''date_from''' - Card Group valid from date. | * '''date_from''' - Card Group valid from date. | ||
* '''date_till''' - Card Group valid till date. | * '''date_till''' - Card Group valid till date. | ||
* '''number_length''' - Card Group number length. | * '''number_length''' - Card Group number length. | ||
* '''pin_length''' - Card Group pin length. | * '''pin_length''' - Card Group pin length. | ||
* '''dialplan_id''' - Card Group | * '''dialplan_id''' - Card Group Dialplan ID. | ||
* '''location_id''' - Card Group | * '''location_id''' - Card Group Location ID. | ||
* '''tax_id''' - Card Group | * '''tax_id''' - Card Group TAX ID. | ||
* '''valid_after_first_use''' - number of days, after which Card Group gets valid. | * '''valid_after_first_use''' - number of days, after which Card Group gets valid. | ||
* '''ghost_balance_perc''' - Card Group ghost balance percent. | * '''ghost_balance_perc''' - Card Group ghost balance percent. | ||
* '''use_external_function''' - enable or disable use of external script | * '''use_external_function''' - enable or disable use of external script. | ||
* '''allow_loss_calls''' - Allow Loss Calls for Card Group. | * '''allow_loss_calls''' - Allow Loss Calls for Card Group. | ||
* '''tell_cents''' - tell cents for Card Group. | * '''tell_cents''' - tell cents for Card Group. | ||
Line 41: | Line 41: | ||
* '''disable_voucher''' - enable or disable voucher. | * '''disable_voucher''' - enable or disable voucher. | ||
* '''hidden''' - enable or disable hidden status. | * '''hidden''' - enable or disable hidden status. | ||
* '''callerid_leave''' - enable or disable | * '''callerid_leave''' - enable or disable Caller ID leave. | ||
<br><br> | <br><br> | ||
Line 72: | Line 72: | ||
* <error>Access Denied</error> - User is not authorized or is a Simple User. Only Admin, Reseller or Accounant can use this API method. | * <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>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>You are not authorized to use this functionality</error> - User has no permissions to manage Calling Cards. | ||
* <error>Card Group must have name</error> - Card Group name is not given. Name is required parameter. | |||
* <error>Card Group must have name</error> - Card Group name is not given. Name is | * <error>Use external function is incorrect format</error> - use external script parameter can only be: 1 - enabled, 0 - disabled. | ||
* <error> | * <error>Allow loss calls is incorrect format</error> - allow loss calls parameter can only be: 1 - enabled, 0 - disabled. | ||
* <error> | * <error>Tell cents is incorrect format</error> - tell cents parameter can only be: 1 - enabled, 0 - disabled. | ||
* <error> | * <error>Solo pinless is incorrect format</error> - solo pinless parameter can only be: 1 - enabled, 0 - disabled. | ||
* <error> | * <error>Disable voucher is incorrect format</error> - voucher parameter can only be: 1 - enabled, 0 - disabled. | ||
* <error> | * <error>Hidden is incorrect format</error> - hidden parameter can only be: 1 - enabled, 0 - disabled. | ||
* <error> | * <error>Callerid leave is incorrect format</error> - Caller ID leave parameter can only be: 1 - enabled, 0 - disabled. | ||
* <error> | * <error>Invalid date from</error> - UNIX time stamp date not correct. | ||
* <error>Invalid date from</error> - | * <error>Invalid date till</error> - UNIX time stamp date not correct. | ||
* <error>Invalid date till</error> - | |||
* <error>Date from is greater than date till</error> - valid from is greater than valid till. | * <error>Date from is greater than date till</error> - valid from is greater than valid till. | ||
* <error> | * <error>Tariff was not found</error> - Tariff id is not correct. There is no such Tariff. | ||
* <error> | * <error>LCR was not found</error> - LCR ID is not correct. There is no such LCR. | ||
* <error> | * <error>Dialplan was not found</error> - Dialplan ID is not correct. There is no such Dialplan. | ||
* <error> | * <error>Location was not found</error> - Location ID is not correct. There is no such Location. | ||
* <error> | * <error>Currency was not found</error> - Currency ID is not correct. There is no such Currency. | ||
* <error>Invalid Price with TAX</error> - price is not correct, can not be negative. | * <error>Invalid Price with TAX</error> - price is not correct, can not be negative. | ||
Revision as of 08:57, 11 November 2015
Description
MOR API Card Group create
Usage
- From MOR X7 Calling Card: /api/cc_group_create
- Methods: POST, GET(if allowed, not recomended)
Parameters
Parameters which are included into hash:
- name - name of a Card Group Required.
Parameters which are not included into hash:
- hash - SHA1 hash constructed using the parameters which are listed above. Note that the parameters are shown in the same order as they need to be when generating the hash. The last parameter in a row is API_Secret_Key ( More described in Constructing hash). Required.
- u - username for authentication. Required.
- description - description for Card Group.
- price_with_vat - price with TAX for Card Group.
- setup_fee - setup fee for Card Group.
- ghost_min_perc - ghost min percent for Card Group.
- daily_charge - daily charge for Card Group.
- tariff_id - Card Group Tariff ID.
- lcr_id - Card Group LCR id.
- date_from - Card Group valid from date.
- date_till - Card Group valid till date.
- number_length - Card Group number length.
- pin_length - Card Group pin length.
- dialplan_id - Card Group Dialplan ID.
- location_id - Card Group Location ID.
- tax_id - Card Group TAX ID.
- valid_after_first_use - number of days, after which Card Group gets valid.
- ghost_balance_perc - Card Group ghost balance percent.
- use_external_function - enable or disable use of external script.
- allow_loss_calls - Allow Loss Calls for Card Group.
- tell_cents - tell cents for Card Group.
- tell_balance_in_currency - Card Group Balance/Rate Currency.
- solo_pinless - enable or disable solo pinless.
- disable_voucher - enable or disable voucher.
- hidden - enable or disable hidden status.
- callerid_leave - enable or disable Caller ID leave.
Request
We have u = admin, API Secret Key = secret We send:
HTML POST: http://<SERVER_IP>/billing/api/cc_group_create?u=admin&name=card_group_test&hash=7e112ededcfee097cce21b6201c6d2a00dda1f4c
- Now we can find 1 newly created Card Group.
* Note that if not passing optional parameters, default values will be used.
* Note that a Username and a Password are not included into hash
Returns
Success
<?xml version="1.0" encoding="UTF-8"?> <page> <status> <success>Card Group was successfully created</success> </status> </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>Card Group must have name</error> - Card Group name is not given. Name is required parameter.
- <error>Use external function is incorrect format</error> - use external script parameter can only be: 1 - enabled, 0 - disabled.
- <error>Allow loss calls is incorrect format</error> - allow loss calls parameter can only be: 1 - enabled, 0 - disabled.
- <error>Tell cents is incorrect format</error> - tell cents parameter can only be: 1 - enabled, 0 - disabled.
- <error>Solo pinless is incorrect format</error> - solo pinless parameter can only be: 1 - enabled, 0 - disabled.
- <error>Disable voucher is incorrect format</error> - voucher parameter can only be: 1 - enabled, 0 - disabled.
- <error>Hidden is incorrect format</error> - hidden parameter can only be: 1 - enabled, 0 - disabled.
- <error>Callerid leave is incorrect format</error> - Caller ID leave parameter can only be: 1 - enabled, 0 - disabled.
- <error>Invalid date from</error> - UNIX time stamp date not correct.
- <error>Invalid date till</error> - UNIX time stamp date not correct.
- <error>Date from is greater than date till</error> - valid from is greater than valid till.
- <error>Tariff was not found</error> - Tariff id is not correct. There is no such Tariff.
- <error>LCR was not found</error> - LCR ID is not correct. There is no such LCR.
- <error>Dialplan was not found</error> - Dialplan ID is not correct. There is no such Dialplan.
- <error>Location was not found</error> - Location ID is not correct. There is no such Location.
- <error>Currency was not found</error> - Currency ID is not correct. There is no such Currency.
- <error>Invalid Price with TAX</error> - price is not correct, can not be negative.
Example:
<?xml version="1.0" encoding="UTF-8"?> <page> <status> <error>Invalid solo pinless parameter, should be: 0 or 1</error> </status> </page>