Enrolling Learners in a Class
Now that an instructor-led class has been created we can use the new classId and start enrolling learners. This endpoint requires information in the request body such as "employerId" and "learnerId". The endpoints below will describe how to get the learner and employer information.
A new learner can be enrolled in the class by including the "newLearner" field instead of "learnerId". Creating a new learner will add them to the list of learners in the network, return an "id" associated with the learner, and trigger an email notification asking them to register with SkillsPass.
The "enrolledAt" field represents the date the learner enrolled in the class. If no "enrolledAt" date is provided, the current timestamp is used. The "enrolledAt" timestamp must be dated before the corresponding learning record.
Request Body Example and Schema
- Example
{
"employerId": "string",
"newLearner": {
"trainingProviderId": "string",
"firstname": "string",
"lastname": "string",
"email": "user@example.com",
"phone": "1 99999999999"
},
"learnerId": "string",
"enrolledAt": "2023-11-02T12:48:21.810Z"
}
Getting a "learnerId"
This endpoint is used to retrieve a list of learners in the training provider network. These learners can be enrolled an instructor-led class by their "learnerId". Results can be filtered using case-insensitive, partial matching query parameters such as name, and email.
Response Example and Schema
- Example
[
{
"id": "string",
"firstname": "string",
"lastname": "string",
"uniqueSystemIdentifier": "string",
"email": "string",
"phone": "string",
"created": "string"
}
]
Getting an "employerId"
Use this endpoint to view a list of employers in the training provider network. We can filter the results using the query parameter employerName to check case-insensitive partial matches for valid employers.
For leaners who don't have an employer, or employer is unknown; the "id" for "Employer Unspecified" can be used. Call this end point while filtering the results using the value employer unspecified in the employerName query parameter to get this "id".
Response Example and Schema
- Example
[
{
"id": "string",
"name": "string"
}
]
Once learners have been enrolled in a class we can move on to the final step of creating a learning record for them.