MOR API Card Group create

From Kolmisoft Wiki

Jump to: navigation, search

Contents

[edit] Description

MOR API Card Group create

[edit] Usage

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



[edit] 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 (timestamp).
  • date_till - Card Group valid till date (timestamp).
  • number_length - Card Group number length.
  • pin_length - Card Group PIN length.
  • 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 [0-no, 1-yes].
  • allow_loss_calls - Allow Loss Calls for Card Group [0-off, 1-on].
  • tell_cents - tell cents for Card Group [0-off, 1-on].
  • tell_balance_in_currency - Card Group Balance/Rate Currency [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 - enable or disable voucher [0-off, 1-on].
  • callerid_leave - Leave CallerID assigned to Card when balance is empty [0-no, 1-yes].
  • currency - Card Group Currency name (must be one of active Currencies e.g. EUR).



[edit] 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

[edit] 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>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>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>



[edit] See also

Personal tools

Try MOR

Try M2