API - Self Enroll in Program Session

Self Enroll in Program Session

This API can be used to self enroll user to a program session. This API should be called as actual user (learner) rather than admin

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 the learner who is enrolling in program session

Parameter 3 - Request Parameters

Name Value
dispatch selfEnrollInProgramSession
programSessionId program session id to enroll in to
extId Optional - external id of program session (instead of program session id)
authCodeId Optional - Auth code id (coupon code id)
authCodeStr Optional - Auth code (coupon code)



1. Response on successfully enrolling

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("dispatch", "selfEnrollInProgramSession");
    String retStr = connection.invokeApi("enrollmentService.do", "chenry", parameters);