MAPI Manual

NAME

LIST_USERS

FUNCTION

List users of an organisation

SYNOPSIS

action: LIST_USERS

org_id


login_name
login_passwd
or  
login_name
session_id
or  
device_id

DESCRIPTION

This function lists the users of an organisation based on the role of the logged-in user. If the role of the logged-in user is account manager, this function will list the admin users. If the logged-in user is admin, it will list the managers. Both GET and POST methods can be used to perform the request.

Required Parameters
* action: specifies the requested function. Sets to LIST_USERS.
* org_id: the organisation ID.

* login_name: the login name for authenticating the user.
* login_passwd: the login password for authenticating the user.
or
* login_name: the login name for authenticating the user.
* session_id: the session ID for authenticating the user.
or
* device_id: a unique ID of the device. The system can use it as a key to identify users.

RETURN DATA

For each valid request, the server provides a response in XML format.
The response contains the following attributes:
* mcp_user_id: user ID.
* login_name: login name of the user.
* group_id: ID of the group to which the user belongs.
* first_name: first name of the user.
* middle_name: middle name.
* last_name: last name.
* display_name: display name.
* org_id: organisation ID.
* role: role of the user.
* is_active: the active status of the user.
* create_time: timestamp when the user was created.

For an invalid request, the response XML contains the following attribute:
* msg: a string containing the error message.

ROLE PERMITTED

Admin, account manager

EXAMPLES

The following example shows a successful HTTP GET request and response.

Request:
http://app02.yvntech.com/MapIHttpS/MapIS?action=LIST_USERS&org_id=9000&device_id=demoid

Response:
<result tftype='1' infotype='0'>
    <resultset name='sys_user' search_found_rows='34'>
        <row>
            <field name='mcp_user_id'>37009000</field>
            <field name='login_name'>name1@example.com</field>
            <field name='group_id'>37009000</field>
            <field name='first_name'>Drake</field>
            <field name='middle_name'></field>
            <field name='last_name'>li</field>
            <field name='display_name'>Drake li</field>
            <field name='org_id'>9000</field>
            <field name='role'>manager</field>
            <field name='is_active'>1</field>
            <field name='create_time'>2014-06-30 17:08:11</field>
        </row>
        <row>
            <field name='mcp_user_id'>36009000</field>
            <field name='login_name'>name2@example.com</field>
            <field name='group_id'>36009000</field>
            <field name='first_name'>Shayne</field>
            <field name='middle_name'></field>
            <field name='last_name'>Nguyen</field>
            <field name='display_name'>Shayne Nguyen</field>
            <field name='org_id'>9000</field>
            <field name='role'>manager</field>
            <field name='is_active'>1</field>
            <field name='create_time'>2014-06-25 22:17:25</field>
        </row>
        ...
        ...
        </resultset>
</result>

TIPS

ENVIRONMENT

AUTHOR

YVN Tech

SEE ALSO

Mweb v2.0 YVNTECH 2014