Difference between revisions of "MOR API card from group sell"
From Kolmisoft Wiki
Jump to navigationJump to search
(Created page with ''This functionality is available from MOR 12'' MOR API sells Cards from Calling Card Group <br><br> ---- <br><br> * Call: /api/buy_card_from_callingroup * Me…') |
|||
Line 17: | Line 17: | ||
** u - username to login. '''Required'''. | ** u - username to login. '''Required'''. | ||
** p - password to login. '''Required'''. | ** p - password to login. '''Required'''. | ||
** email - email address, to send information about bought card '''Optional'''. | |||
** [[MOR API hash construction | hash]] - SHA1 hash constructed using '''id''' and '''quantity''' and '''API_Secret_Key''' ([[MOR API hash construction | More described in Constructing hash]]). '''Required'''. | ** [[MOR API hash construction | hash]] - SHA1 hash constructed using '''id''' and '''quantity''' and '''API_Secret_Key''' ([[MOR API hash construction | More described in Constructing hash]]). '''Required'''. | ||
** | ** |
Revision as of 13:32, 24 February 2012
'This functionality is available from MOR 12
sells Cards from Calling Card Group
- Call: /api/buy_card_from_callingroup
- Methods: POST, GET(if allowed, not recomended)
- Params:
- id - Calling Card Group ID in MOR database. Required.
- quantity - default 1. Optional.
- u - username to login. Required.
- p - password to login. Required.
- email - email address, to send information about bought card Optional.
- hash - SHA1 hash constructed using id and quantity and API_Secret_Key ( More described in Constructing hash). Required.
- Returns:
- Success
<cards>
<card> <pin>...</pin> <number>..</number> <balance_without_vat>...</balance_without_vat> <currency>...</currency> </card>
<card> <pin>...</pin> <number>...</number> <balance_without_vat>...</balance_without_vat> <currency>...</currency> </card>
</cards>
- Errors:
- <error>Bad login</error> - User supplied bad login or password.
- <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 .
- <error>Free cards was not found/error> - no free cards in Calling Card Group.
- Errors:
- Example:
- We have id = 6, quantity = 2, API Secret Key = 456789
- Hash string to be converted: "62456789"
- We might send:
- /api/buy_card_from_callingroup?id=6&quantity=2&hash=37086d860581fabc278413cd1a417d5c079f6eba&u=admin&p=admin
* Note that username and password are not included in hash