MOR API Card Group create

From Kolmisoft Wiki
Revision as of 08:37, 11 November 2015 by Edvinas (talk | contribs)
Jump to navigationJump to search

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 dial plan 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>Bad login</error> - User is not authorized (possibly wrong Username).
  • <error>Card Group must have name</error> - Card Group name is not given. Name is requered parameter.
  • <error>Invalid use external function parameter, should be: 0 or 1</error> - use external script 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>Invalid tell cents parameter, should be: 0 or 1</error> - tell cents 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>Invalid disable voucher parameter, should be: 0 or 1</error> - voucher 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>Invalid callerid leave parameter, should be: 0 or 1</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>Invalid Tariff id</error> - Tariff id is not correct. There is no such Tariff.
  • <error>Invalid Lcr id</error> - Lcr id is not correct. There is no such Lcr.
  • <error>Invalid Dialplan id</error> - Dialplan id is not correct. There is no such Dialplan.
  • <error>Invalid Location id</error> - Location id is not correct. There is no such Location.
  • <error>Invalid Currency</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>



See also