C# Class SchooxSharp.Api.Clients.Users

The following requests relate to getting information about users via the Schoox Academy API. Note: All requests must be Authenticated. Access Level for all requests: Administrators, Training Managers, Region and Location Managers. Depending on the role the requests return data either for all users (Access level: Administrators and Training Managers) or for users that belong to a certain region or location (Access Level: Region Managers, Local Managers). You can simulate a user's view by his/her schooX ID.
Inheritance: SchooxApiBase
Exibir arquivo Open project: jamesbar2/SchooxSharp Class Usage Examples

Private Properties

Property Type Description

Public Methods

Method Description
AddAboveUnitsToUser ( int userId, List aboveUnitIds, string externalId = null, string title = null ) : SchooxResponse

Adds Aboves Units to a given User by an array of Above Unit Ids.

AddNewAboveUnit ( AboveUnit aboveUnit ) : SchooxResponse

Creates a new Above Unit and connects it to a Type.

AddNewJob ( NewJob job ) : SchooxResponse

Creates a new job

AddNewType ( string typeName ) : SchooxResponse

Creates a new Type.

AddNewUnit ( NewUnit unit ) : SchooxResponse

Creates a new Unit and connects it to Above Units, via an array of Above Unit ids (above_ids) or an array of Above Unit names (above_names).

AddUnitsToUser ( int userId, List unitIds, string externalId = null, string title = null ) : SchooxResponse

Adds Units to a given User by an array of Unit Ids.

ArchiveUnit ( int unitId, string title = null ) : SchooxResponse

Archive a Unit.

BulkAddNewAboveUnits ( List aboveUnits ) : SchooxResponse

Creates multiple Above Units (maximum of 100) via a single request.

BulkAddNewJobs ( List jobs ) : SchooxResponse

Creates multiple academy jobs via a single request

BulkAddNewTypes ( List typeNames ) : SchooxResponse

Creates multiple Types via a single request.

BulkAddNewUnits ( List units ) : SchooxResponse

Creates multiple Units (maximum of 100) via a single request.

BulkCreateAndAddUsers ( List users ) : SchooxResponse

Creates and adds multiple users (maximum of 10) to the academy via a single request. Password is mandatory.

BulkInviteUsers ( List users ) : SchooxResponse

Adds a user through an academy invitation. You can simulate the inviting user by adding his/her schooX ID.

CreateAndAddUser ( NewUser user ) : SchooxResponse

Creates and adds a user to the academy. Password is mandatory.

DeleteAboveUnit ( int aboveId, string title = null ) : SchooxResponse

Changes the name and/or the type of an Above Unit.

DeleteArchivedUnit ( int unitId, string title = null ) : SchooxResponse

Deletes a specific Archived Unit.

DeleteJob ( int jobId, string title = null ) : SchooxResponse

Deletes a specified job. It also removes the job from all assigned users.

DeleteType ( int typeId ) : SchooxResponse

Deletes a specified type.

DeleteUnit ( int unitId, string title = null ) : SchooxResponse

Deletes a specific Unit.

EditAboveUnit ( int aboveId, AboveUnit aboveUnit, string title = null ) : SchooxResponse

Changes the name and/or the type of an Above Unit.

EditJob ( int jobId, NewJob job, string title = null ) : SchooxResponse

Changes the name and/or the report id of a job.

EditType ( int typeId, string typeName ) : SchooxResponse

Changes the name of a Type.

EditUnit ( int unitId, NewUnit unit, string title = null ) : SchooxResponse

Changes the name and/or the above units of a Unit.

EditUser ( int userId, NewUser user, string externalId = null ) : SchooxResponse

Edit the firstname, lastname, email or password of a User.

GetAboveUnits ( int typeId = null, string search = null, int start = null, int limit = null ) : SchooxResponse>

Returns a list of Above Units (max. 100/request) of your Academy.

GetAndEnumerateAllUsers ( string role, string past = null, string search = null, int aboveId = null, int unitId = null, int jobId = null, int limit = 1000 ) : List

Iterates through all "pages" of users to build a list of all users in the system. WARNING: This function should only be used on smaller user lists, writing your own enumerable or async function is a more efficient route than this function. Also, any failures will be ignored.

GetArchivedUnits ( string search = null, string searchAbove = null, int aboveId = null, int start = null, int limit = null ) : SchooxResponse>

Returns a list of Archived Units of your Academy.

GetDetailsOfUser ( int userId, string externalId = null ) : SchooxResponse

Returns data for a specific user like first and last name, email, role, region, location, job code and his/her current status in the academy.

GetJobs ( string search = null, int start = null, int limit = null ) : SchooxResponse>

Returns a list with all jobs of your Academy.

GetTypes ( ) : SchooxResponse>

Returns a list of all Types of your Academy.

GetUnits ( string search = null, string searchAbove = null, int aboveId = null, int start = null, int limit = null ) : SchooxResponse>

Returns a list of Units of your Academy.

GetUsers ( string role, string past = null, string search = null, int aboveId = null, int unitId = null, int jobId = null, int start = null, int limit = null ) : SchooxResponse>

Returns a list of academy's users. A role must be specified. Available values are: employee, customer, instructor & member.

InviteUser ( NewUser user ) : SchooxResponse

Adds a user through an academy invitation. You can simulate the inviting user by adding his/her schooX ID.

ReactivateUser ( int userId ) : SchooxResponse

Reactivates a Past Employee as Employee. You can use the User Id or his/her external_id

ReactivateUser ( string externalId ) : SchooxResponse

Reactivates a Past Employee as Employee. You can use the User Id or his/her external_id

RemoveAboveUnitFromUser ( int userId, int aboveId, string externalId = null, string title = null ) : SchooxResponse

Removes an Above Unit from a given User

RemoveUnitsFromUser ( int userId, int unitId, string externalId = null, string title = null ) : SchooxResponse

Adds Units to a given User by an array of Unit Ids.

RemoveUser ( int userId, string externalId = null ) : SchooxResponse

Removes a user from the academy.

UnarchiveUnit ( int unitId, string title = null ) : SchooxResponse

Unarchive a Unit.

UpdateUserJobs ( int userId, List jobs, string externalId = null ) : SchooxResponse

Edit the jobs of a given user by an array of units/above units & their job Ids. User must be previously assigned to the specified units & above units.

UpdateUserRoles ( int userId, List roles, string externalId = null ) : SchooxResponse

Edit the roles of a given user. Available roles are (see Constants.Roles): admin, training_manager, content_manager, professional_instructor, hourly_worker

Users ( ) : System
Users ( ISchooxService service ) : System

Method Details

AddAboveUnitsToUser() public method

Adds Aboves Units to a given User by an array of Above Unit Ids.
public AddAboveUnitsToUser ( int userId, List aboveUnitIds, string externalId = null, string title = null ) : SchooxResponse
userId int User to add above units to
aboveUnitIds List Above units to add
externalId string External ID of user to reactivate
title string Sets whether the id given is the current title. By default, the value is "false"
return SchooxResponse

AddNewAboveUnit() public method

Creates a new Above Unit and connects it to a Type.
public AddNewAboveUnit ( AboveUnit aboveUnit ) : SchooxResponse
aboveUnit AboveUnit Above unit to add
return SchooxResponse

AddNewJob() public method

Creates a new job
public AddNewJob ( NewJob job ) : SchooxResponse
job SchooxSharp.Api.Models.NewJob Job name, and report_id
return SchooxResponse

AddNewType() public method

Creates a new Type.
public AddNewType ( string typeName ) : SchooxResponse
typeName string Type name to add
return SchooxResponse

AddNewUnit() public method

Creates a new Unit and connects it to Above Units, via an array of Above Unit ids (above_ids) or an array of Above Unit names (above_names).
public AddNewUnit ( NewUnit unit ) : SchooxResponse
unit SchooxSharp.Api.Models.NewUnit Unit with names and above IDs
return SchooxResponse

AddUnitsToUser() public method

Adds Units to a given User by an array of Unit Ids.
public AddUnitsToUser ( int userId, List unitIds, string externalId = null, string title = null ) : SchooxResponse
userId int User to add units to
unitIds List Unit IDs to add
externalId string External ID of user to reactivate
title string Sets whether the id given is the current title. By default, the value is "false"
return SchooxResponse

ArchiveUnit() public method

Archive a Unit.
public ArchiveUnit ( int unitId, string title = null ) : SchooxResponse
unitId int Unit to archive
title string Sets whether the id given is the current title. By default, the value is "false"
return SchooxResponse

BulkAddNewAboveUnits() public method

Creates multiple Above Units (maximum of 100) via a single request.
public BulkAddNewAboveUnits ( List aboveUnits ) : SchooxResponse
aboveUnits List
return SchooxResponse

BulkAddNewJobs() public method

Creates multiple academy jobs via a single request
public BulkAddNewJobs ( List jobs ) : SchooxResponse
jobs List Jobs to be created
return SchooxResponse

BulkAddNewTypes() public method

Creates multiple Types via a single request.
public BulkAddNewTypes ( List typeNames ) : SchooxResponse
typeNames List Type names as a list
return SchooxResponse

BulkAddNewUnits() public method

Creates multiple Units (maximum of 100) via a single request.
public BulkAddNewUnits ( List units ) : SchooxResponse
units List Units to add
return SchooxResponse

BulkCreateAndAddUsers() public method

Creates and adds multiple users (maximum of 10) to the academy via a single request. Password is mandatory.
public BulkCreateAndAddUsers ( List users ) : SchooxResponse
users List Enumerable lists of users to be added, password is required. Use the static NewUserForAccount helper.
return SchooxResponse

BulkInviteUsers() public method

Adds a user through an academy invitation. You can simulate the inviting user by adding his/her schooX ID.
public BulkInviteUsers ( List users ) : SchooxResponse
users List Enumerable list of user objects to be invited, use the static NewUserForInvite helper.
return SchooxResponse

CreateAndAddUser() public method

Creates and adds a user to the academy. Password is mandatory.
public CreateAndAddUser ( NewUser user ) : SchooxResponse
user NewUser User object, password is required. Use the static NewUserForAccount helper.
return SchooxResponse

DeleteAboveUnit() public method

Changes the name and/or the type of an Above Unit.
public DeleteAboveUnit ( int aboveId, string title = null ) : SchooxResponse
aboveId int Above Unit to be deleted
title string Sets whether the id given is the current title. By default, the value is "false"
return SchooxResponse

DeleteArchivedUnit() public method

Deletes a specific Archived Unit.
public DeleteArchivedUnit ( int unitId, string title = null ) : SchooxResponse
unitId int Archived unit to delete
title string Sets whether the id given is the current title. By default, the value is "false"
return SchooxResponse

DeleteJob() public method

Deletes a specified job. It also removes the job from all assigned users.
public DeleteJob ( int jobId, string title = null ) : SchooxResponse
jobId int Job ID to be deleted
title string Sets whether the id given is the current title. By default, the value is "false"
return SchooxResponse

DeleteType() public method

Deletes a specified type.
public DeleteType ( int typeId ) : SchooxResponse
typeId int Type to delete
return SchooxResponse

DeleteUnit() public method

Deletes a specific Unit.
public DeleteUnit ( int unitId, string title = null ) : SchooxResponse
unitId int Unit to delete
title string Sets whether the id given is the current title. By default, the value is "false"
return SchooxResponse

EditAboveUnit() public method

Changes the name and/or the type of an Above Unit.
public EditAboveUnit ( int aboveId, AboveUnit aboveUnit, string title = null ) : SchooxResponse
aboveId int Above Unit ID to be edited
aboveUnit AboveUnit Updated AboveUnit object
title string Sets whether the id given is the current title. By default, the value is "false"
return SchooxResponse

EditJob() public method

Changes the name and/or the report id of a job.
public EditJob ( int jobId, NewJob job, string title = null ) : SchooxResponse
jobId int Job ID to be edited
job SchooxSharp.Api.Models.NewJob Updated job information
title string Sets whether the id given is the current title. By default, the value is "false"
return SchooxResponse

EditType() public method

Changes the name of a Type.
public EditType ( int typeId, string typeName ) : SchooxResponse
typeId int Type ID to edit
typeName string New type name
return SchooxResponse

EditUnit() public method

Changes the name and/or the above units of a Unit.
public EditUnit ( int unitId, NewUnit unit, string title = null ) : SchooxResponse
unitId int Unit to change
unit SchooxSharp.Api.Models.NewUnit Updated unit
title string Sets whether the id given is the current title. By default, the value is "false"
return SchooxResponse

EditUser() public method

Edit the firstname, lastname, email or password of a User.
public EditUser ( int userId, NewUser user, string externalId = null ) : SchooxResponse
userId int Users ID
user NewUser User to edit.
externalId string Sets whether the id given is the external_id of the User. By default, the value is "false"
return SchooxResponse

GetAboveUnits() public method

Returns a list of Above Units (max. 100/request) of your Academy.
public GetAboveUnits ( int typeId = null, string search = null, int start = null, int limit = null ) : SchooxResponse>
typeId int Filter Above Units by Type ID
search string Search by Above Unit title
start int Starting position
limit int Number of Above Units to return per request, up to maximum of 100,000. Default to 100
return SchooxResponse>

GetAndEnumerateAllUsers() public method

Iterates through all "pages" of users to build a list of all users in the system. WARNING: This function should only be used on smaller user lists, writing your own enumerable or async function is a more efficient route than this function. Also, any failures will be ignored.
public GetAndEnumerateAllUsers ( string role, string past = null, string search = null, int aboveId = null, int unitId = null, int jobId = null, int limit = 1000 ) : List
role string Role of users
past string List Past Employees if given role is "employee". Default value is "false"
search string Search by user's firstname or lastname
aboveId int Above Unit's ID
unitId int Unit's ID
jobId int Job's ID
limit int Max is 1,000; depending on your users connection, adjust this.
return List

GetArchivedUnits() public method

Returns a list of Archived Units of your Academy.
public GetArchivedUnits ( string search = null, string searchAbove = null, int aboveId = null, int start = null, int limit = null ) : SchooxResponse>
search string Search by Unit title
searchAbove string Filter by Above Unit title
aboveId int Filter Units by an Above Unit Id
start int Starting position
limit int Number of Units to return per page, up to maximum of 10,000. Default to 100
return SchooxResponse>

GetDetailsOfUser() public method

Returns data for a specific user like first and last name, email, role, region, location, job code and his/her current status in the academy.
public GetDetailsOfUser ( int userId, string externalId = null ) : SchooxResponse
userId int User's ID.
externalId string Sets whether the id given is the external_id of the User. By default, the value is "false"
return SchooxResponse

GetJobs() public method

Returns a list with all jobs of your Academy.
public GetJobs ( string search = null, int start = null, int limit = null ) : SchooxResponse>
search string Search by Job title
start int Starting position
limit int Max items returned per request. Default is 100
return SchooxResponse>

GetTypes() public method

Returns a list of all Types of your Academy.
public GetTypes ( ) : SchooxResponse>
return SchooxResponse>

GetUnits() public method

Returns a list of Units of your Academy.
public GetUnits ( string search = null, string searchAbove = null, int aboveId = null, int start = null, int limit = null ) : SchooxResponse>
search string Search by Unit title
searchAbove string Filter by Above Unit title
aboveId int Filter Units by an Above Unit Id
start int Starting position
limit int Number of Units to return per request, up to maximum of 100,000. Default to 100
return SchooxResponse>

GetUsers() public method

Returns a list of academy's users. A role must be specified. Available values are: employee, customer, instructor & member.
public GetUsers ( string role, string past = null, string search = null, int aboveId = null, int unitId = null, int jobId = null, int start = null, int limit = null ) : SchooxResponse>
role string Role of users
past string List Past Employees if given role is "employee". Default value is "false"
search string Search by user's firstname or lastname
aboveId int Above Unit's ID
unitId int Unit's ID
jobId int Job's ID
start int Starting Position
limit int Number of users to return per request, up to maximum of 1,000. Default to 100
return SchooxResponse>

InviteUser() public method

Adds a user through an academy invitation. You can simulate the inviting user by adding his/her schooX ID.
public InviteUser ( NewUser user ) : SchooxResponse
user NewUser User object to be invited, use the static NewUserForInvite helper.
return SchooxResponse

ReactivateUser() public method

Reactivates a Past Employee as Employee. You can use the User Id or his/her external_id
public ReactivateUser ( int userId ) : SchooxResponse
userId int User ID of user to reactivate
return SchooxResponse

ReactivateUser() public method

Reactivates a Past Employee as Employee. You can use the User Id or his/her external_id
public ReactivateUser ( string externalId ) : SchooxResponse
externalId string External ID of user to reactivate
return SchooxResponse

RemoveAboveUnitFromUser() public method

Removes an Above Unit from a given User
public RemoveAboveUnitFromUser ( int userId, int aboveId, string externalId = null, string title = null ) : SchooxResponse
userId int User to remove above units from
aboveId int Above unit to remove
externalId string External ID of user to reactivate
title string Sets whether the id given is the current title. By default, the value is "false"
return SchooxResponse

RemoveUnitsFromUser() public method

Adds Units to a given User by an array of Unit Ids.
public RemoveUnitsFromUser ( int userId, int unitId, string externalId = null, string title = null ) : SchooxResponse
userId int User to remove units from
unitId int Unit to remove
externalId string External ID of user to reactivate
title string Sets whether the id given is the current title. By default, the value is "false"
return SchooxResponse

RemoveUser() public method

Removes a user from the academy.
public RemoveUser ( int userId, string externalId = null ) : SchooxResponse
userId int User to remove
externalId string External ID of user to reactivate
return SchooxResponse

UnarchiveUnit() public method

Unarchive a Unit.
public UnarchiveUnit ( int unitId, string title = null ) : SchooxResponse
unitId int Unit to unarchive.
title string Sets whether the id given is the current title. By default, the value is "false"
return SchooxResponse

UpdateUserJobs() public method

Edit the jobs of a given user by an array of units/above units & their job Ids. User must be previously assigned to the specified units & above units.
public UpdateUserJobs ( int userId, List jobs, string externalId = null ) : SchooxResponse
userId int User to update
jobs List Jobs of the user (Models.UpdateUserJob)
externalId string External ID of user to reactivate
return SchooxResponse

UpdateUserRoles() public method

Edit the roles of a given user. Available roles are (see Constants.Roles): admin, training_manager, content_manager, professional_instructor, hourly_worker
public UpdateUserRoles ( int userId, List roles, string externalId = null ) : SchooxResponse
userId int
roles List
externalId string External ID of user to reactivate
return SchooxResponse

Users() public method

public Users ( ) : System
return System

Users() public method

public Users ( ISchooxService service ) : System
service ISchooxService
return System