Deleting Memberships

Memberships in IMS-ES can only be deleted when you have the identifier of the Membership. If the original identifier was automatically generated, the User and Hierarchy have to be given, if a custom identifier was given it suffices.

DeleteMembership

This function deletes the given Membership, or in other words removes the User from the Hierarchy.

Syntax:

OperationResult DeleteMembership(string userSyncKey, string hierarchySyncId);
OperationResult DeleteMembership(string membershipId);

Parameters:

userSyncKey:

The User to be removed from the Hierarchy.

hierarchySyncId:

The Hierarchy from which the User should be removed.

membershipId:

The custom identifier of the Membership that should be deleted.

Returns:

The OperationResult containing the warning that Itslearning has send back, or if there was none, null.

Exceptions:

  • ImsEsException: If IMS-ES encountered an error in Itslearning, this exception will be thrown.

  • ValidationException: If the generated identifier is too long (more than 255 characters) this exception will be thrown.


DeleteMemberships

This function deletes the given Memberships. In the MembershipPairs the role doesn't have to be specified (it is not used in this function).

Syntax:

BatchOperationResult DeleteMemberships(ICollection<MembershipPair> memberships);
BatchOperationResult DeleteMemberships(ICollection<string> membershipIds);

Parameters:

memberships:

An ICollection with the MembershipPairs to be deleted, containing the Users and Hierarchies. (role doesn't have to be specified)

membershipIds:

An ICollection with the custom identifiers of the Memberships to be deleted.

Returns:

A BatchOperationResult with the list of warnings that Itslearning has send back (this list can be empty).

Exceptions:

  • ImsEsBatchException: If IMS-ES encountered an error in Itslearning, this exception will be thrown.

  • ValidationException: If the generated identifier is too long (more than 255 characters) this exception will be thrown.