API - User list

User List

This API can be used to get users in the microsite. The API is a restrictive one and can be called by an admin of the site only. Any other user trying to invoke this API would result in an error being returned by the API.

API Details

Signature of API call

connection.invokeApi(String uri, String realUserName, Map<String, String> requestParameters);

See details about invoking API in general


Parameter 1 - URI



Parameter 2 - UserName

Username of any site administrator


Parameter 3 - Request Parameters

Name Value
dispatch list
Optional Search Parameters
search username / first / last name / email to search for. Can use wild card * . If multiple words are present then all words are matched.
inactive true | false (to search for active or inactive users)
activeEnrollment true | false (to search for users who have any active enrollment in any course session)
fromDate user created or modified from
toDate user created or modified till


Set one of the above to filter list based on from/to dates of created, modified or either dates. 

dateFilterIgnoreTime true | false - set to do from/to date comparison based on beginning of day/end of day or date time based. 
groupId comma separated list of group ids to search the users from.
groupName name of the group (if ids are not specified) to search the users from
siteRole STUDENT | INSTRUCTOR | ADMIN (users role in microsite)
Searchable custom properties can be passed as map
customPropertyMap['address'] 4128 Business Center Drive
customPropertyMap['department'] sales
Optional additional parameters
pwToken true. Optional, pass true to retrieve password reset token and password reset urls for users.
Paging parameters
currPage page number to fetch, must be specified for 2nd page onwards. Value of currPage starts with 0. So for page 2 specify currPage = 1
numItems total records in the list, must be specified for 2nd page onwards. You can get the count of records from response of first page. then pass it as-is in subsequent pages.
pageSize Number of items in a page



1. Response on successfully finding users

HTTP Response Code = HttpServletResponse.SC_OK

Response XML

<response code="0">

    <users numItems="4282" currPage="0">
            <user id="e608d414-2160-11e6-b63c-6ce229284b01">

<!-- user name consists of namespace for the site, then asterisk, then actual username. To pass username in any api call, input must not contain the namespace and asterisk. -->


                <properties> <!-- custom properties defined in your microsite -->
                         <name><![CDATA[ DOB ]]></name>
                         <value><![CDATA[ 08/21/2018 ]]></value>
                         <displayValue><![CDATA[ 08/21/2018 ]]></displayValue>
                        <name><![CDATA[ Department ]]></name>
                        <value><![CDATA[ sales ]]></value>
                        <displayValue><![CDATA[ Sales ]]></displayValue>

                    <![CDATA[ api_e85ad12c-2ef1-11e8-ab3a-0327bc39e9e4 ]]>
                   <![CDATA[ xze4*admin ]]>
            <user id="e242476e-215d-11e6-b63c-6ce229284b01">


            <user id="657b764c-215d-11e6-b63c-6ce229284b01">







2. Response for unauthorized access

HTTP Response Code = HttpServletResponse.SC_UNAUTHORIZED

Response XML

<response code="-1">
             <value><![CDATA[You are not allowed to perform this action.]]></value>


Code Snippet

    /*  Check API Call for detail generic code */
    Map<String, String> parameters = new HashMap<String, String>();
    parameters.put("dispatch", "list");

    parameters.put("search", "john doe");
    String retStr = connection.invokeApi("userService.do", "chenry", parameters);