Balance in phone

From Kolmisoft Wiki

Jump to: navigation, search

Contents

[edit] Description

Some phones and softphones support displaying your account balance on their screens.

For example, we will use iaxLite. Download link



[edit] Configuration

1. Go to SETTINGS –> Setup –> Settings

File:settings_path.png

2. In API tab check the marked option:

File:Settings_various_balance_over_http.png

NOTE: do not forget to enable the API on your system before you will use Balance in the Phone. If API will be not enabled you will see Balance:<?xml... instead of the real Balance.

[edit] Usage

Log in as the user you want to check your balance:

Image:bif2.png

... and in Details you will see the link:

Image:bif3.png

Copy and paste this link into the phone:

Image:bif4.png

... and you will see your balance:

Image:bif5.png

[edit] Advanced options

Optionaly you can send api request and specify currency, valid values are USER, in that case balance is returned in user's currency. And currency code(EUR, USD etc.)

[edit] API usage

  • From MOR X4 call: /api/user_simple_balance_get
  • For Backwards-compatibility old name 'simple_balance' is also usable. Call: /api/simple_balance



[edit] Parametres

  • id – uniquehash of user whose balance you want to get. Required.
  • currency – currency code. Optional. Without this parameter API request will return Balance in Default System Currency.



[edit] Request

HTML POST: http://<SERVER_IP>/billing/api/user_simple_balance_get?id=UNIQUEHASH&currency={USER|CURRENCY_CODE}



[edit] Returns

Success

<html>
   <head></head>
   <body>60.0000</body>
</html>




Errors

  • Incorrect hash
<?xml version="1.0" encoding="UTF-8"?>
<status>
 <error>Incorrect hash</error>
</status>
  • Allow devices to check balance over HTTP is not set
<html>
   <head></head>
   <body>Feature disabled</body>
</html>
  • Your API is disabled.
<?xml version="1.0" encoding="UTF-8"?>
<status>
  <error>API Requests are disabled</error>
</status>

Enable API in the MOR's SETTINGS under API section.

[edit] See also

Personal tools