Difference between revisions of "M4 Balance in phone"

From Kolmisoft Wiki
Jump to navigationJump to search
 
(10 intermediate revisions by 2 users not shown)
Line 10: Line 10:


1. Go to '''MAINTENANCE –> Settings'''
1. Go to '''MAINTENANCE –> Settings'''
<br><br>  
<br>
[[File:File:M2_settings_menu.png]]
[[File:M2_settings_menu.png]]
<br><br>
<br>
<!---This functionality is available from MOR 12--->
 
2. In API tab check the marked option:
2. Under '''API SETTINGS''' check the marked option:
<br><br>
<br>
[[File:Settings_various_balance_over_http.png]]
[[File:M2 balance api option.png]]
<br><br>
<br>


'''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.
Line 24: Line 24:
=Usage=
=Usage=


Log in as the user you want to check your balance:
Log in as the user you want to check your balance and go to '''Personal Details''':
<br><br>
<br><br>
[[Image:bif2.png]]
[[File:M2_link_to_check_balance.png]]
<br><br>
... and in Details you will see the link:
<br><br>
[[Image:bif3.png]]
<br><br>
<br><br>
Copy and paste this link into the phone:
Copy and paste this link into the phone:
Line 40: Line 36:
[[Image:bif5.png]]
[[Image:bif5.png]]
<br><br>
<br><br>
=Advanced options=
=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.)  
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===
===API usage===


* Call: '''/api/user_simple_balance_get'''
* For Backwards-compatibility old name 'simple_balance' is also usable. Call: '''/api/simple_balance'''
* For Backwards-compatibility old name 'simple_balance' is also usable. Call: '''/api/simple_balance'''
<br><br>
<br><br>
===Parametres===
 
===Parameters===


* id – uniquehash of user whose balance you want to get. '''Required'''.
* id – uniquehash of user whose balance you want to get. '''Required'''.
Line 62: Line 62:
'''Success'''
'''Success'''


  <html>
  60.0000
    <head></head>
 
    <body>60.0000</body>
</html>
<br><br>
<br><br>
----
----
Line 91: Line 89:
  </status>
  </status>


Enable API in the MOR's SETTINGS under API section.
Enable API in the MOR's SETTINGS under the API section.
<br><br>
<br><br>
=See also=
=See also=


* [[M2 API]]
* [[M4 API]]
* [[M2 API user balance get]]
* [[M4 API user balance get]]

Latest revision as of 11:31, 28 November 2022

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 MAINTENANCE –> Settings
M2 settings menu.png

2. Under API SETTINGS check the marked option:
M2 balance api option.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 and go to Personal Details:

M2 link to check balance.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



Parameters

  • 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 the API section.

See also