Api - Test Attempts (Test Instances) List

Test Attempts (Test Instances) List

This API is used to obtain the list of test instances from a microsite.


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 or group administrator


Parameter 3 - Request Parameters

Name Value
dispatch getRecentlyTaken
userSearchStr username, firstname, lastname, email pattern (optional)
testId specific test id (optional)
quizOrSurvey quiz | survey (optional)
fromDateLong from date in millis (optional)
toDateLong to date in millis (optional)
userId specific user's id (optional)
xml true
pageSize Optional - default value is 10

Optional - default value is 0.


to fetch multiple pages, this api needs to be called multiple times, with value for currPage parameter 0, 1, 2 .... upto the total number of items available from the api. 


First call to the API carries a response XML which contains information about the total number of items available.



Response on successfully getting the test instance list

HTTP Response Code = HttpServletResponse.SC_OK

Response XML

<testAttempts numItems="30" currPage="0" pageSize="10">


<![CDATA[ Sales Training Quiz ]]>
<![CDATA[ John ]]>
<![CDATA[ Doe ]]>
<picture id="91f78610-4add-11e1-8a65-0030499005ee" name="IMG_2113.JPG"/>




Code Snippet


    /* Check API Call for detail generic code */
    Map<String, String> parameters = new HashMap<String, String>();
    parameters.put("dispatch", "getRecentlyTaken");
    parameters.put("xml", String.valueOf(true));
    /* add the currPage parameter to fetch the data for second page onwards */
    String retStr = connection.invokeApi("testdetail.do", "charles", parameters);