Update Course Session Member

This API is used to update a learner's record in a course 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

enrollmentService.do

 

Parameter 2 - UserName

Username of the site admin

 

Parameter 3 - Request Parameters

Name Value
dispatch updateCourseSessionMember
xml true
courseSessionId Course session id
extId

If course session id is not known, you can pass extId.

Either courseSessionId or extId must be specified.

ids

comma separated user ids (id of user in lms)

usernames

comma separated user names (login id of user in lms).

openIds

comma separated open ids

Either ids or usernames or openIds must be specified.

startDate Start date of the learner, represented as epoch time in milliseconds - number of milliseconds that have elapsed since January 1, 1970 (midnight UTC/GMT), not counting leap seconds - optional
endDate

End date of the learner, represented as epoch time in milliseconds - number of milliseconds that have elapsed since January 1, 1970 (midnight UTC/GMT), not counting leap seconds - optional

dueDate

Due date of the learner, represented as epoch time in milliseconds - number of milliseconds that have elapsed since January 1, 1970 (midnight UTC/GMT), not counting leap seconds - optional

remove Remove learner from course session - optional
award true | false - optional, send it only to award or reset award
score Float number - total points, optional
awardDate Award date (completion date) of the learner, represented as epoch time in milliseconds - number of milliseconds that have elapsed since January 1, 1970 (midnight UTC/GMT), not counting leap seconds - optional

customUpdPropMap['property1Name'],

customUpdPropMap['property2Name'],

customUpdPropMap['property3Name']

...

...

Custom property values to be updated. Each property name should be passed as "customUpdPropMap['name of property']"

These custom properties must be first defined in microsite, using the Site Admin->Custom Properties->Course Member properties.

 

Response

Response on successfully updating the coupon

HTTP Response Code = HttpServletResponse.SC_OK

Response XML

 

<response code="0">
   <msgs>
      <msg>
         <code>0225</code>
         <value>
            <![CDATA[Learner updated successfully]]>
         </value>
      </msg>
   </msgs>
</response>

 

Code Snippet

/* Check API Call for detail */

 

Map<String, String> parameters = new HashMap<String, String>();
populateMapForCouponUpdate(parameters);
String result = connection.invokeApi("couponService.do", "adminusername", parameters);
System.out.println(result);
 
private void populateMapForCouponUpdate(Map<String, String> parameters) {
    parameters.put("dispatch", "updateCourseSessionMember
");
    parameters.put("xml", String.valueOf(true));
    parameters.put("courseSessionId", "xxxx-xxxx-xxxx-xxxx");
    parameters.put("usernames", "user1,user2");
    parameters.put("expDate", "1495163497116"); //Set end dates of learners
    parameters.put("customUpdPropMap['property1Name']","property1Value");
    parameters.put("customUpdPropMap['property2Name']","property2Value");
}

Rating: