Reading Users
Reading Users
When there are have been changes to Users in Itslearning, it is also convenient to also retrieve this information again. With the functions below you can retrieve Users from Itslearning by their SyncKey, or by the Hierarchy SyncId that they are enrolled in.
ReadUser
This function retrieves the User from Itslearning with the given SyncKey.
Syntax:
OperationResult warning = ImsEsClient.ReadUser(string syncKey, out User readUser);
Parameters:
syncKey:
The Synchronization key of the User to be retrieved.
readUser:
The retrieved User from Itslearning.
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.
ReadUsers
This function retrieves the specified Users from Itslearning.
Syntax:
BatchOperationResult warning = ImsEsClient.ReadUsers(ICollection<string> syncKeys, out List<User> readUserList);
Parameters:
syncKeys:
An ICollection with the User SyncKeys to be retrieved.
readUserList:
The list with the retrieved Users.
Returns:
A OperationResult 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.
ReadUsersFromHierarchy
This function retrieves all Users added to the given Hierarchy.
Syntax:
OperationResult warning = ImsEsClient.ReadUsersFromHierarchy(string hierarchySyncId, out List<User> readUserList);
Parameters:
hierarchySyncId:
The Synchonization Id of the Hierarchy.
readUserList:
A list with the retrieved Users.
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.
ReadAllUsers
This function retrieves all Users from Itslearning.
Precondition: Method readAllPersons needs to be enabled in IMS-ES integration settings.
Syntax:
OperationResult warning = ImsEsClient.ReadAllUsers(
int
? pageIndex,
int
? pageSize, out List<User> readUserList, out
int
virtualCount);
Parameters:
pageIndex:
The page number which should be returned (should be >= 1).
pageSize:
The page size (maximum user count on the page). For performance reasons it is restricted to 100 as maximum value.
readUserList:
A list with the retrieved Users.
virtualCount:
Total count of persons in itslearning to be returned.
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.