Difference between revisions of "M4 API users get"

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


* u - username to login. '''Required'''.
* u - username to login. '''Required'''.
* user_id - specify "all" to list all users or specify the ID of the user to list only that user. '''Required'''.


*[[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'''.
Line 26: Line 27:
You send:
You send:


  HTML POST: http://<SERVER_IP>/billing/api/users_get?u=admin&hash=c420ef706a02e6449994b7575b25ef5f74cc722b
  HTML POST: http://<SERVER_IP>/billing/api/users_get?u=admin&user_id=all&hash=c420ef706a02e6449994b7575b25ef5f74cc722b


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

Latest revision as of 12:33, 23 August 2023

Description

M4 API for getting list of users

  • Admin or Manager with permissions can get all users list



Usage

  • Methods: POST, GET(if allowed, not recomended)



Parameters

Parameters which are included into hash

  • u - username to login. Required.
  • user_id - specify "all" to list all users or specify the ID of the user to list only that user. Required.



Request

If API Secret Key = secret

You send:

HTML POST: http://<SERVER_IP>/billing/api/users_get?u=admin&user_id=all&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>
    <tariff_id> ... </tariff_id>
    <owner_id> ... </owner_id>
    <usertype> ... </usertype>
   </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