API - Enroll Users in Program Session

Enroll User(s) to Program Session

This API can be used to enroll users to a program session.

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 enrollUsersInProgramSession
Either usernames or ids is required
programSessionId program session id to enroll in to
extId Optional - external id of program session (instead of program session id)

comma separated usernames

e.g. adoe,bdoe,cdoe,ddoe....


81154232-7e81-11e4-b5ad-fb29daca67a3, xxx-xxx-xxx-xxx-xxx

comma separated user ids

(Optional .. specify either usernames or ids)

sendMail true or false. Send true to send enrollment emails.



1. Response on successfully adding user to group

HTTP Response Code = HttpServletResponse.SC_OK

Response XML

<response code="0">



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("programSessionId", "81154232-7e81-11e4-b5ad-fb29daca67a3");

    parameters.put("usernames", "adoe,bdoe,cdoe");
    parameters.put("dispatch", "enrollUsersInProgramSession");
    String retStr = connection.invokeApi("enrollmentService.do", "chenry", parameters);