API - Get user details

Get User Details

This API can be used to get user's details 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 get
id or userName or openId must be specified
id user id, e.g. a570e68e-2134-11e6-b63c-6ce229284b01
userName user name of the user. E.g. jdoe
openId openId can be used to uniquely identify the user (this field can be used as a custom unique key)
pwToken optional. pass true to retrieve password reset token and password reset urls for this user



1. Response on successfully finding the user

HTTP Response Code = HttpServletResponse.SC_OK

Response XML

<response code="0">

    <user id="0a94dd08-bcf2-11e3-9f5e-ed9f54c5e015" siteRole="STUDENT" status="ACTIVE">

                    <value><![CDATA[4128 Business Center Dr]]></value>
                    <displayValue><![CDATA[4128 Business Center Dr]]></displayValue>
                    <groupMember groupId="ba2d8118-a91d-11e3-9904-ce5a5bb8887f"
                    <groupMember groupId="b8cbee9e-8d3f-11e3-afb2-a1819f9d3329" parentId="b8befcf2-8d3f-11e3-afb2-a1819f9d3329"
                    <groupMember groupId="b8befcf2-8d3f-11e3-afb2-a1819f9d3329"
                    <groupMember groupId="d7fd60c8-f881-11e4-aa97-cd61805e5592"



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>

3. Response when user is not found

<response code="-1">
         <value><![CDATA[Unable to find User with matching id]]></value>

Code Snippet

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

    parameters.put("userName", "jdoe");
    String retStr = connection.invokeApi("userService.do", "chenry", parameters);