Difference between revisions of "MOR API users get"

From Kolmisoft Wiki
Jump to navigationJump to search
Line 20: Line 20:


* u - username to log in. '''Required'''.
* u - username to log in. '''Required'''.
* p - password to login.  
* p - password to login. '''note''': you can use either '''p''' or '''uniquehash''' to identify the user. One of them is required.<br>


Parameters that are '''not included''' into hash:
Parameters that are '''not included''' into hash:


* uniquehash - user's uniquehash.
* uniquehash - user's uniquehash. '''note''': you can use either '''p''' or '''uniquehash''' to identify the user. One of them is required.<br>
'''note''': you can use either '''p''' or '''uniquehash''' to identify the user. One of them is required<br>
'''note''': if using the browser's URL bar, then you should encode symbols. Example:
** for % use %25.
** for # use %23.
** for + use %2B.
** for & use %26.
 
*[[MOR API hash construction | hash]] – SHA1 hash constructed using '''API Secret Key''' ([[MOR API hash construction | More described in Constructing hash]]). '''Required'''.
*[[MOR API hash construction | hash]] – SHA1 hash constructed using '''API Secret Key''' ([[MOR API hash construction | More described in Constructing hash]]). '''Required'''.
<br><br>
'''note''': if using the browser's URL bar, then you should encode special symbols (these symbols usually appear in the p parameter). Example:
* for % use %25.
* for # use %23.
* for + use %2B.
* for & use %26.


<br><br>
<br><br>

Revision as of 06:52, 9 October 2025

Description

MOR API for getting list of users

  • Admin or Accountant with permissions can get all users list
  • Reseller can get his own users list
  • Partner can get his resellers and users



Usage

  • From MOR X8 call: /api/users_get
  • Methods: POST, GET(if allowed, not recomended)



Parameters

Parameters that are included into hash:

  • u - username to log in. Required.
  • p - password to login. note: you can use either p or uniquehash to identify the user. One of them is required.

Parameters that are not included into hash:

  • uniquehash - user's uniquehash. note: you can use either p or uniquehash to identify the user. One of them is required.
  • hash – SHA1 hash constructed using API Secret Key ( More described in Constructing hash). Required.



note: if using the browser's URL bar, then you should encode special symbols (these symbols usually appear in the p parameter). Example:

  • for % use %25.
  • for # use %23.
  • for + use %2B.
  • for & use %26.



Request

If API Secret Key = secret

You send:

HTML POST: http://<SERVER_IP>/billing/api/users_get?u=admin&p=admin1&test=1&hash=c420ef706a02e6449994b7575b25ef5f74cc722b



Returns

<?xml version="1.0" encoding="UTF-8"?>
<page>
 <status>
  <users>
   <user>
    <id> ... </id>
    <username> ... </username>
    <first_name> ... </first_nam>
    <last_name> ... </last_name>
    <balance> ... </balance>
    <blocked> ... </blocked>
    <lcr_id> ... </lcr_id>
    <tariff_id> ... </tariff_id>
    <owner_id> ... </owner_id>
    <usertype> ... </usertype>
    <hidden> ... </hidden>
   </user>
  </users>
 </status>
</page>

Errors:

  • <error>API Requests are disabled</error> – Allow API globally setting is unchecked
  • <error>GET Requests are disabled</error> – Allow GET API setting is unchecked
  • <error>Access Denied</error> – User is not allowed to to get users list or username and password are not correct.
  • <error>Incorrect hash</error> – Hash was not correct. Check API_Secret_Key and order of parameters while concatenating the hash_string
  • <error>You are not authorized to view this page</error> – User is not authorized to get users list.


Example:

 <status>
   <error>API Requests are disabled</error>
 </status>



See also