Difference between revisions of "MOR API Card Group create"

From Kolmisoft Wiki
Jump to navigationJump to search
(Created page with '=Description= MOR API Card Group create <br><br> =Usage= * Call: /api/cc_group_create * Methods: POST, GET(if allowed, not recomended) <br><br> ===Parameters=== Parameters …')
 
 
(11 intermediate revisions by 3 users not shown)
Line 4: Line 4:
=Usage=
=Usage=


* Call: /api/cc_group_create
* From '''MOR X7''' Calling Card: '''/api/cc_group_create'''
* Methods: POST, GET(if allowed, not recomended)
* Methods: POST, GET(if allowed, not recomended)
<br><br>
<br><br>
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.
* '''tariff_id''' - Card Group Tariff ID.
* '''lcr_id''' - Card Group lcr id.
* '''lcr_id''' - Card Group LCR id.
* '''date_from''' - Card Group valid from date.
* '''date_from''' - Card Group valid from date (timestamp).
* '''date_till''' - Card Group valid till date.
* '''date_till''' - Card Group valid till date (timestamp).
* '''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 dial plan id.
* '''location_id''' - Card Group Location ID.
* '''location_id''' - Card Group location id.
* '''tax_id''' - Card Group TAX ID.
* '''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 [0-no, 1-yes].
* '''allow_loss_calls''' - Allow Loss Calls for Card Group.
* '''allow_loss_calls''' - Allow Loss Calls for Card Group [0-off, 1-on].
* '''tell_cents''' - tell cents for Card Group.
* '''tell_cents''' - tell cents for Card Group [0-off, 1-on].
* '''tell_balance_in_currency''' - Card Group Balance/Rate Currency.
* '''tell_balance_in_currency''' - Card Group Balance/Rate Currency [0-off, 1-on].
* '''solo_pinless''' - enable or disable solo pinless.
* '''solo_pinless''' - Deny to double-use a Card with Pinless dialing, when Card is assigned to some CallerID [0-no, 1-yes].
* '''disable_voucher''' - enable or disable voucher.
* '''disable_topup_from_cards_with_cid''' - Disable credit transfers from Cards with a CallerID assigned [0-no, 1-yes].
* '''hidden''' - enable or disable hidden status.
* '''disable_voucher''' - enable or disable voucher [0-off, 1-on].
* '''callerid_leave''' - enable or disable caller id leave.
* '''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).
<br><br>
<br><br>


Line 52: Line 52:


* Now we can find 1 newly created Card Group.'''<br>
* Now we can find 1 newly created Card Group.'''<br>
'''* Note that if not passing optional parameters, default values will be used.'''
'''* Note that if not passing optional parameters, default values will be used.'''<br>
'''* Note that a Username and a Password are not included into hash'''
'''* Note that a Username and a Password are not included into hash'''
<br><br>
<br><br>
Line 62: Line 62:
  <page>
  <page>
   <status>
   <status>
     <success>Cards created: 11/11</success>
     <success>Card Group was successfully created</success>
   </status>
   </status>
  </page>
  </page>
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>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 required parameter.
* <error>Card Group must have name</error> - Card Group name is not given. Name is requered parameter.
* <error>Use external function is incorrect format</error> - use external script 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>Allow loss calls is incorrect format</error> - allow loss calls 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>Tell cents is incorrect format</error> - tell cents 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>Solo pinless is incorrect format</error> - solo pinless 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>Disable voucher is incorrect format</error> - voucher 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>CallerID leave is incorrect format</error> - Caller ID leave 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 date from</error> - UNIX time stamp date not correct.
* <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 till</error> - UNIX time stamp date not correct.
* <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>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>Tariff was not found</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>LCR was not found</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>Location was not found</error> - Location ID is not correct. There is no such Location.
* <error>Invalid Location id</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 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.
* <error>Invalid Price with TAX</error> - price is not correct, can not be negative.



Latest revision as of 08:09, 5 September 2017

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 (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).



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>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>



See also