Add Members to a Course

Note: Applicable to all services except Zoho Creator.

Overview

The zoho.learn.addMembersToCourse task adds members to a specific course.

Scope

ZohoLearn.course.UPDATE

Syntax

<response>=zoho.learn.course.addMembers(<portalUrl>,<courseId>,<params>,<connection>);

where:

ParameterData TypeDescription
<response>KEY-VALUEThe response returned contains the status of the member addition operation.
portalUrlTEXTThe URL of the hub/network (portal) in Zoho Learn.
courseIdTEXTThe ID of the course to which members need to be added. Course ID can be fetched from Get course API; here, id from the response represents the course ID.
paramsKEY-VALUE (Map)

A map containing the following keys:

  • userIds – List of user IDs to be added.
  • role – Role to assign to the added members.
connectionTEXTThe connection link name created for this service. A Zoho OAuth connection with the scope ZohoLearn.course.UPDATE must be configured.

Example

The following script adds members to a course with the specified role:

response=zoho.learn.course.addMembers("zylker","12361400",{"userIds":{799705135}},"learnconnection");

where:

responseThe KEY-VALUE response variable that holds the course details.
zylkerThe TEXT representing the URL of the hub/network.
12361400The TEXT representing the ID of the course in which members need to be added.
"userIds":{799705135}The KEY-VALUE variable containing the user IDs and the role to be assigned.
learnconnectionThe connection link name in TEXT format.

Response Format

Success Response

  • The success response will be returned in the following format:

    { "STATUS": "OK", "DATA": [ { "role": "MEMBER", "name": "Ben Taylor", "colorIndex": "1", "emailId": "taylor@zylker.com", "id": "799705135", "type": "MEMBER", "learnerCourseStatus": "INPROGRESS", "status": "ACTIVE", "learnerCourseProgress": "8.33375" } ] }

Failure Response

  • The failure response for an invalid course ID will be returned in the following format:

    { "result": "failure", "reason": "Course is invalid.", "errorCode": "237" }

 

Related Topics