Difference between revisions of "MOR API Card Group update"

From Kolmisoft Wiki
Jump to navigationJump to search
 
Line 36: Line 36:
* '''allow_loss_calls''' - Allow Loss Calls for Card Group [0-off, 1-on].
* '''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].
* '''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].
* '''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].
* '''callerid_leave''' - Leave CallerID assigned to Card when balance is empty [0-no, 1-yes].

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