Difference between revisions of "MOR API Card Group update"

From Kolmisoft Wiki
Jump to navigationJump to search
(Created page with '=Description= MOR API Card Group update <br><br> =Usage= * From '''MOR X7''' Calling Card: '''/api/cc_group_update''' * Methods: POST, GET(if allowed, not recomended) <br><b…')
 
 
(7 intermediate revisions by 3 users not shown)
Line 18: Line 18:
* '''[[MOR API hash construction | 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''' ([[MOR API hash construction | More described in Constructing hash]]). '''Required'''.<br>
* '''[[MOR API hash construction | 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''' ([[MOR API hash construction | More described in Constructing hash]]). '''Required'''.<br>
* '''u''' - username for authentication. '''Required'''.
* '''u''' - username for authentication. '''Required'''.
* '''description''' - description for Card Group.
* '''name''' - name of Card Group.
* '''price_with_vat''' - price with TAX for Card Group.
* '''description''' - description of Card Group.
* '''setup_fee''' - setup fee for Card Group.
* '''price_with_vat''' - price with TAX of Card Group.
* '''ghost_min_perc''' - ghost min percent for Card Group.
* '''setup_fee''' - setup fee of Card Group.
* '''daily_charge''' - daily charge for Card Group.
* '''use_external_function''' - use of external script [0-no, 1-yes].
* '''tariff_id''' - Card Group tariff id.
* '''ghost_min_perc''' - ghost min percent of Card Group.
* '''lcr_id''' - Card Group lcr id.
* '''ghost_balance_perc''' - ghost balance percent of Card Group.
* '''date_from''' - Card Group valid from date.
* '''daily_charge''' - daily charge of Card Group.
* '''date_till''' - Card Group valid till date.
* '''tell_cents''' - usage of tell cents [0-no, 1-yes].
* '''dialplan_id''' - Card Group dial plan id.
* '''tell_balance_in_currency''' - Card Group Balance/Rate Currency.
* '''tariff_id''' - tariff if of Card Group
* '''lcr_id''' - LCR id of Card Group
* '''location_id''' - Card Group location id.
* '''location_id''' - Card Group location id.
* '''tax_id''' - Card Group tax id.
* '''date_from''' - Card Group valid from date (timestamp).
* '''date_till''' - Card Group valid till date (timestamp).
* '''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.
* '''allow_loss_calls''' - Allow Loss Calls for Card Group [0-off, 1-on].
* '''use_external_function''' - enable or disable use of external script;
* '''solo_pinless''' - Deny to double-use a Card with Pinless dialing, when Card is assigned to some CallerID [0-no, 1-yes].
* '''allow_loss_calls''' - Allow Loss Calls for Card Group.
* '''disable_topup_from_cards_with_cid''' - Disable credit transfers from Cards with a CallerID assigned [0-no, 1-yes].
* '''tell_cents''' - tell cents for Card Group.
* '''disable_voucher''' - disable Voucher with same Number as Card if Card is used [0-off, 1-on].
* '''tell_balance_in_currency''' - Card Group Balance/Rate Currency.
* '''callerid_leave''' - Leave CallerID assigned to Card when balance is empty [0-no, 1-yes].
* '''solo_pinless''' - enable or disable solo pinless.
* '''tax2_enabled''' - [0-no, 1-yes].
* '''disable_voucher''' - enable or disable voucher.
* '''tax3_enabled''' - [0-no, 1-yes].
* '''hidden''' - enable or disable hidden status.
* '''tax4_enabled''' - [0-no, 1-yes].
* '''callerid_leave''' - enable or disable caller id leave.
* '''compound_tax''' - [0-no, 1-yes].
* '''name''' - name of Card Group.
* '''tax1_name''' - name of the first tax.
* '''tax2_name''' - name of the second tax.
* '''tax3_name''' - name of the third tax.
* '''tax4_name''' - name of the fourth tax.
* '''total_tax_name''' - name of total taxes.
* '''tax1_value''' - value of the first tax.
* '''tax2_value''' - value of the second tax.
* '''tax3_value''' - value of the third tax.
* '''tax4_value''' - value of the fourth tax.
* '''currency''' - Card Group Currency name (must be one of active Currencies e.g. EUR).
 
 
<br><br>
<br><br>


Line 71: Line 85:
* <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>Bad login</error> - User is not authorized (possibly wrong Username).
* <error>Card Group was not found</error> - There is no such Card Group id or user is not authorized to manage this Card Group.
* <error>Wrong Card Group ID</error> - cc_Group_id is not a number.
* <error>Use external function is incorrect format</error> - Use external script parameter can only be: 1  - enabled, 0 - disabled.
* <error>Card Group not found</error> - there is no such Card Group, wrong cc_Group_id.
* <error>Tell cents is incorrect format</error> - Tell cents parameter can only be: 1  - enabled, 0 - disabled.
* <error>Tax not found</error> - there is no such Tax, wrong tax_id.
* <error>Currency was not found</error> - Currency id is not correct. There is no such Currency.
* <error>Invalid Price with TAX</error> - wrong price with TAX for Card Group.
* <error>Tariff was not found</error> - There is no such Tariff.
* <error>Invalid Currency</error> - Currency id is not correct. There is no such Currency.
* <error>LCR was not found</error> - LCR id is not correct. There is no such LCR.
* <error>Invalid Tariff id</error> - Tariff id is not correct. There is no such Tariff.
* <error>Location was not found</error> - Location id is not correct. There is no such Location.
* <error>Invalid Lcr id</error> - Lcr id is not correct. There is no such Lcr.
* <error>Date from is incorrect format</error> - Valid from is incorrect format.
* <error>Invalid Dialplan id</error> - Dialplan id is not correct. There is no such Dialplan.
* <error>Time till is incorrect format</error> - Valid till is incorrect format.
* <error>Invalid Location id</error> - Location id is not correct. There is no such Location.
* <error>Date from is greater than date till</error> - Valid from is greater than valid till.
* <error>Invalid date from</error> - unix time stamp date not correct.
* <error>Valid after is incorrect format</error> - Valid after maximum value can be 9999.
* <error>Invalid date till</error> - unix time stamp date not correct.
* <error>Allow loss calls is incorrect format</error> - Allow loss calls parameter can only be: 1  - enabled, 0 - disabled.
* <error>Date from is greater than date till</error> - valid from is greater than valid till.
* <error>Solo pinless is incorrect format</error> - Solo pinless parameter can only be: 1  - enabled, 0 - disabled.
* <error>Invalid use external function parameter, should be: 0 or 1</error> - use external script 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>Invalid allow loss calls parameter, should be: 0 or 1</error> - allow loss calls 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 tell cents parameter, should be: 0 or 1</error> - tell cents parameter can only be: 1  - enabled, 0 - disabled.
* <error>Compound TAX enabling value is incorrect format</error> - Compound parameter can only be: 1  - enabled, 0 - disabled.
* <error>Invalid solo pinless parameter, should be: 0 or 1</error> - solo pinless parameter can only be: 1  - enabled, 0 - disabled.
* <error>TAX 2 enabling value is incorrect format</error> - TAX 2 enabling value parameter can only be: 1  - enabled, 0 - disabled.
* <error>Invalid disable voucher parameter, should be: 0 or 1</error> - voucher parameter can only be: 1  - enabled, 0 - disabled.
* <error>TAX 3 enabling value is incorrect format</error> - TAX 3 enabling value parameter can only be: 1  - enabled, 0 - disabled.
* <error>Invalid hidden parameter, should be: 0 or 1</error> - hidden parameter can only be: 1  - enabled, 0 - disabled.
* <error>TAX 4 enabling value is incorrect format</error> - TAX 4 enabling value parameter can only be: 1  - enabled, 0 - disabled.
* <error>Invalid callerid leave parameter, should be: 0 or 1</error> - caller id leave parameter can only be: 1  - enabled, 0 - disabled.
 
Example:
Example:



Latest revision as of 08:09, 5 September 2017

Description

MOR API Card Group update

Usage

  • From MOR X7 Calling Card: /api/cc_group_update
  • Methods: POST, GET(if allowed, not recomended)



Parameters

Parameters which are included into hash:

  • cc_Group_id - id 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.
  • name - name of Card Group.
  • description - description of Card Group.
  • price_with_vat - price with TAX of Card Group.
  • setup_fee - setup fee of Card Group.
  • use_external_function - use of external script [0-no, 1-yes].
  • ghost_min_perc - ghost min percent of Card Group.
  • ghost_balance_perc - ghost balance percent of Card Group.
  • daily_charge - daily charge of Card Group.
  • tell_cents - usage of tell cents [0-no, 1-yes].
  • tell_balance_in_currency - Card Group Balance/Rate Currency.
  • tariff_id - tariff if of Card Group
  • lcr_id - LCR id of Card Group
  • location_id - Card Group location id.
  • date_from - Card Group valid from date (timestamp).
  • date_till - Card Group valid till date (timestamp).
  • valid_after_first_use - number of days, after which Card Group gets valid.
  • allow_loss_calls - Allow Loss Calls for Card Group [0-off, 1-on].
  • solo_pinless - Deny to double-use a Card with Pinless dialing, when Card is assigned to some CallerID [0-no, 1-yes].
  • disable_topup_from_cards_with_cid - Disable credit transfers from Cards with a CallerID assigned [0-no, 1-yes].
  • disable_voucher - disable Voucher with same Number as Card if Card is used [0-off, 1-on].
  • callerid_leave - Leave CallerID assigned to Card when balance is empty [0-no, 1-yes].
  • tax2_enabled - [0-no, 1-yes].
  • tax3_enabled - [0-no, 1-yes].
  • tax4_enabled - [0-no, 1-yes].
  • compound_tax - [0-no, 1-yes].
  • tax1_name - name of the first tax.
  • tax2_name - name of the second tax.
  • tax3_name - name of the third tax.
  • tax4_name - name of the fourth tax.
  • total_tax_name - name of total taxes.
  • tax1_value - value of the first tax.
  • tax2_value - value of the second tax.
  • tax3_value - value of the third tax.
  • tax4_value - value of the fourth tax.
  • currency - Card Group Currency name (must be one of active Currencies e.g. EUR).




Request

We have u = admin, API Secret Key = secret We send:

HTML POST: http://<SERVER_IP>/billing/api/cc_group_update?u=admin&cc_Group_id=1&hash=7e112ededcfee097cce21b6201c6d2a00dda1f4c
  • Now we can find 1 updated Card Group.

* 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 updated</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 was not found</error> - There is no such Card Group id or user is not authorized to manage this Card Group.
  • <error>Use external function is incorrect format</error> - Use external script 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>Currency was not found</error> - Currency id is not correct. There is no such Currency.
  • <error>Tariff was not found</error> - There is no such Tariff.
  • <error>LCR was not found</error> - LCR id is not correct. There is no such LCR.
  • <error>Location was not found</error> - Location id is not correct. There is no such Location.
  • <error>Date from is incorrect format</error> - Valid from is incorrect format.
  • <error>Time till is incorrect format</error> - Valid till is incorrect format.
  • <error>Date from is greater than date till</error> - Valid from is greater than valid till.
  • <error>Valid after is incorrect format</error> - Valid after maximum value can be 9999.
  • <error>Allow loss calls is incorrect format</error> - Allow loss calls 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>CallerID leave is incorrect format</error> - Caller id leave parameter can only be: 1 - enabled, 0 - disabled.
  • <error>Compound TAX enabling value is incorrect format</error> - Compound parameter can only be: 1 - enabled, 0 - disabled.
  • <error>TAX 2 enabling value is incorrect format</error> - TAX 2 enabling value parameter can only be: 1 - enabled, 0 - disabled.
  • <error>TAX 3 enabling value is incorrect format</error> - TAX 3 enabling value parameter can only be: 1 - enabled, 0 - disabled.
  • <error>TAX 4 enabling value is incorrect format</error> - TAX 4 enabling value parameter can only be: 1 - enabled, 0 - disabled.

Example:

<?xml version="1.0" encoding="UTF-8"?>
<page>
  <status>
    <error>Invalid Price with TAX</error>
  </status>
</page>



See also