MOR API card balance get

From Kolmisoft Wiki

Jump to: navigation, search

Contents

[edit] Description

MOR API functionality that allows you to see the Calling Card's balance.

[edit] Usage

  • From MOR X4 call: /api/card_balance_get



[edit] Parameters

Parameters which are included into hash:

  • number - Calling Card's unique number. 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:



[edit] Request

We want to access some user's Calling Card's balance as an admin, meaning we know the secret API key, in order to do so we must

  • Generate the hash key
  • Send the query to the API

For example:

We want to get the balance of a Calling Card numbered 1111111000, and our secret key is 'secretkey', our query will look like this:

HTML POST http://<server_ip>/billing/api/card_balance_get?u=admin&number=1111111000&hash=0d43cbd508a63230032ef593089833543ea297ea 

NOTE that username is not included in hash

[edit] Returns

Success

 <?xml version="1.0" encoding="UTF-8"?>
 <page>
   <calling_card>
     <balance> ... </balance>
     <currency> ... </currency>
   </calling_card>
 </page>




Errors

  • <error>User was not found</error> - User supplied bad username for authentication.
  • <error>Incorrect hash</error> - Hash was not correct. Check API_Secret_Key and order or params while concatenating hash_string.
  • <error>You are not authorised to use this functionality/error> - the specified user doesn't have permissions to use Calling Cards.
  • <error>Calling Card was not found</error> - the Card does not exist, or the specified user doesn't have access to it.



[edit] See also

Personal tools

Try MOR

Try M2