Difference between revisions of "MOR API card group get"

From Kolmisoft Wiki
Jump to navigationJump to search
 
(5 intermediate revisions by one other user not shown)
Line 1: Line 1:
=Description=
<!---This functionality is available from MOR 12--->
<!---This functionality is available from MOR 12--->
[[MOR API]] Show Calling Card Group
[[MOR API]] Show Calling Card Group
<br><br>
<br><br>
----
=Usage=
 
* From '''MOR X4''' call: '''/api/card_group_get '''
* For Backwards-compatibility old name 'show_calling_card_group' is also usable. Call: '''/api/show_calling_card_group'''
* Methods: POST, GET(if allowed, not recomended)
<br><br>
===Parameters===
 
Parameters which are '''included''' into hash:
 
* id - Calling Card Group ID in MOR database. '''Required'''.
 
'''Note that parameters are shown in the same order as they have to be when generating the hash. Last parameter in a row is API_Secret_Key'''
<br><br>
Parameters which are '''not included''' into hash:
 
* [[MOR API hash construction | hash]] - SHA1 hash constructed using parameters above and API_Secret_Key ([[MOR API hash construction | More described in Constructing hash]]). '''Required'''.
* u - username for authentication. '''Required'''.
<br><br>
<br><br>
* Call: /api/show_calling_card_group
* Methods: POST, GET(if allowed, not recomended)
* Params:
** id - Calling Card Group ID in MOR database. '''Required'''.
** u - username to login. '''Required'''.
** p - password to login. '''Required'''.
** [[MOR API hash construction | hash]] - SHA1 hash constructed using '''id''' and '''API_Secret_Key''' ([[MOR API hash construction | More described in Constructing hash]]). '''Required'''.
**


* Returns:
===Request===
**Success
 
<cardgroup>
We have id = 6, API Secret Key = 456789
  <name>....</name>
  <iamge_link>/billing/cards/example.jpg</iamge_link>
  <description>...</description>
  <price>...</price>
  <price_with_tax>...</price_with_tax>
  <currency>...</currency>
  <free_cards_size>...</free_cards_size>
  <pin_length>....</pin_length>
  <number_length>....</number_length>
</cardgroup>


We send:


HTML POST: http://<SERVER_IP>/billing/api/card_group_get?u=username&id=6&hash=67df827dec80a7241fb3fc4de22a90e62c5e8d93


** Errors:
'''NOTE that username is not included in hash'''
*** <error>Bad login</error> - User supplied bad login or password.
<br><br>
*** <error>Incorrect hash</error> - Hash was not correct. Check API_Secret_Key and order or params while concatenating hash_string.
===Returns===
*** <error>Cardgroup was not found</error> - Use correct Calling Card Group ID .
 
'''Success'''
 
<?xml version="1.0" encoding="UTF-8"?>
<page>
  <cardgroup>
    <name>....</name>
    <iamge_link>/billing/cards/example.jpg</iamge_link>
    <description>...</description>
    <price>...</price>
    <price_with_tax>...</price_with_tax>
    <currency>...</currency>
    <free_cards_size>...</free_cards_size>
    <pin_length>....</pin_length>
    <number_length>....</number_length>
  </cardgroup>
</page>
<br><br>
<br><br>
----
----
*Example:
 
**We have id = 6, API Secret Key = 456789
'''Errors'''
**Hash string to be converted: "6456789"
 
**We might send:
* <error>Bad login</error> - User supplied bad login.
***/api/show_calling_card_group?id=6&hash=67df827dec80a7241fb3fc4de22a90e62c5e8d93&u=admin&p=admin
* <error>Incorrect hash</error> - Hash was not correct. Check API_Secret_Key and order or params while concatenating hash_string.
'''* Note that username and password are not included in hash'''
* <error>Cardgroup was not found</error> - Use correct Calling Card Group ID .
<br><br>
 
=See also=
 
* [[MOR API]]

Latest revision as of 10:23, 31 August 2017

Description

MOR API Show Calling Card Group

Usage

  • From MOR X4 call: /api/card_group_get
  • For Backwards-compatibility old name 'show_calling_card_group' is also usable. Call: /api/show_calling_card_group
  • Methods: POST, GET(if allowed, not recomended)



Parameters

Parameters which are included into hash:

  • id - Calling Card Group ID in MOR database. Required.

Note that parameters are shown in the same order as they have to be when generating the hash. Last parameter in a row is API_Secret_Key

Parameters which are not included into hash:



Request

We have id = 6, API Secret Key = 456789

We send:

HTML POST: http://<SERVER_IP>/billing/api/card_group_get?u=username&id=6&hash=67df827dec80a7241fb3fc4de22a90e62c5e8d93

NOTE that username is not included in hash

Returns

Success

<?xml version="1.0" encoding="UTF-8"?>
<page>
 <cardgroup>
   <name>....</name>
   <iamge_link>/billing/cards/example.jpg</iamge_link>
   <description>...</description>
   <price>...</price>
   <price_with_tax>...</price_with_tax>
   <currency>...</currency>
   <free_cards_size>...</free_cards_size>
   <pin_length>....</pin_length>
   <number_length>....</number_length>
 </cardgroup>
</page>




Errors

  • <error>Bad login</error> - User supplied bad login.
  • <error>Incorrect hash</error> - Hash was not correct. Check API_Secret_Key and order or params while concatenating hash_string.
  • <error>Cardgroup was not found</error> - Use correct Calling Card Group ID .



See also