Difference between revisions of "Balance in phone"

From Kolmisoft Wiki
Jump to navigationJump to search
 
(8 intermediate revisions by 3 users not shown)
Line 5: Line 5:
For example, we will use [http://iaxtalk.com/index.php?main_page=product_info&cPath=6&products_id=7  iaxLite]. [http://www.kolmisoft.com/packets/iaxlite_setup.zip Download link]
For example, we will use [http://iaxtalk.com/index.php?main_page=product_info&cPath=6&products_id=7  iaxLite]. [http://www.kolmisoft.com/packets/iaxlite_setup.zip Download link]


'''Note! Same URL is used for MOR Phone APP.'''
<br><br>
<br><br>
=Configuration=
=Configuration=


Line 19: Line 19:
<br><br>
<br><br>


'''Please 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.
'''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.
<br><br>
<br><br>
=Usage=
=Usage=


Line 43: Line 44:
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.)  
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.)  
<br><br>
<br><br>
===API usage===
* Call: '''/api/user_simple_balance_get'''
* For Backwards-compatibility old name 'simple_balance' is also usable. Call: '''/api/simple_balance'''
<br><br>
===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.
<br><br>
===Request===
===Request===


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

Latest revision as of 08:25, 29 January 2017

Description

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

For example, we will use iaxLite. Download link



Configuration

1. Go to SETTINGS –> Setup –> Settings

Settings path.png

2. In API tab check the marked option:

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.

Usage

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

Bif2.png

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

Bif3.png

Copy and paste this link into the phone:

Bif4.png

... and you will see your balance:

Bif5.png

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

API usage

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



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.



Request

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



Returns

Success

    
    60.0000
 




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
    
    Feature disabled
 
  • 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.

See also