Register a user to a learning path
Depending on the learning path settings, users can register by themselves (only to the public trainings) or be assigned to the learning path by administrators or managers (to any training). In both cases the same mutationcreateLpIndividualMembership
should be used.
In case if the user is being registered to a learning path not by themselves,
the current API user should be associated with
ADMINISTRATOR
scope.
See more about the user context scope here.Argument | Type | Description |
---|---|---|
lpId | ID | Required; ID of the learning path to register a user to. |
userContextId | ID | Required in case of registration by the manager. Should be left empty in case of self-registration. Represents context ID of the user who should be enrolled to the learning path. By default, the current user from the API request will be taken. |
CreateLpIndividualMembershipResponse
object will be returned that contains the following properties:
Property | Type | Description |
---|---|---|
errors | [Violation] | Contains the list of validation errors, if there are any. |
response | IndividualMembership | Represents the created membership object (see below). |
IndividualMembership
object
Property | Type | Description |
---|---|---|
id | ID | Required; represents the unique identifier of the membership. |
learningPath | LearningPath | Required; the learning path associated with the membership. |
cta | [Cta] | An optional list of call-to-actions (CTA) that define the allowed user interaction with the related learning path based on the created membership. The full list of learning path CTAs can be checked here. |
Unenroll a user from a learning path
In general, the unenrollment process follows the same rules and behavior as enrollment: a user can be unregistered from any previously enrolled learning path by themselves or by administrator. In both casesremoveLpIndividualMembership
mutation should be used.
Mutation accepts the same arguments as createLpIndividualMembership
.
As a result, SuccessResponse
object will be returned:
Property | Type | Description |
---|---|---|
errors | [Violation] | Contains the list of validation errors, if there are any. |
response | Boolean | If true , the mutation has been successfully executed and the membership was removed. |