C# Класс 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.
Наследование: SchooxApiBase
Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание

Открытые методы

Метод Описание
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

Описание методов

AddAboveUnitsToUser() публичный Метод

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"
Результат SchooxResponse

AddNewAboveUnit() публичный Метод

Creates a new Above Unit and connects it to a Type.
public AddNewAboveUnit ( AboveUnit aboveUnit ) : SchooxResponse
aboveUnit AboveUnit Above unit to add
Результат SchooxResponse

AddNewJob() публичный Метод

Creates a new job
public AddNewJob ( NewJob job ) : SchooxResponse
job SchooxSharp.Api.Models.NewJob Job name, and report_id
Результат SchooxResponse

AddNewType() публичный Метод

Creates a new Type.
public AddNewType ( string typeName ) : SchooxResponse
typeName string Type name to add
Результат SchooxResponse

AddNewUnit() публичный Метод

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
Результат SchooxResponse

AddUnitsToUser() публичный Метод

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"
Результат SchooxResponse

ArchiveUnit() публичный Метод

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"
Результат SchooxResponse

BulkAddNewAboveUnits() публичный Метод

Creates multiple Above Units (maximum of 100) via a single request.
public BulkAddNewAboveUnits ( List aboveUnits ) : SchooxResponse
aboveUnits List
Результат SchooxResponse

BulkAddNewJobs() публичный Метод

Creates multiple academy jobs via a single request
public BulkAddNewJobs ( List jobs ) : SchooxResponse
jobs List Jobs to be created
Результат SchooxResponse

BulkAddNewTypes() публичный Метод

Creates multiple Types via a single request.
public BulkAddNewTypes ( List typeNames ) : SchooxResponse
typeNames List Type names as a list
Результат SchooxResponse

BulkAddNewUnits() публичный Метод

Creates multiple Units (maximum of 100) via a single request.
public BulkAddNewUnits ( List units ) : SchooxResponse
units List Units to add
Результат SchooxResponse

BulkCreateAndAddUsers() публичный Метод

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.
Результат SchooxResponse

BulkInviteUsers() публичный Метод

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.
Результат SchooxResponse

CreateAndAddUser() публичный Метод

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.
Результат SchooxResponse

DeleteAboveUnit() публичный Метод

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"
Результат SchooxResponse

DeleteArchivedUnit() публичный Метод

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"
Результат SchooxResponse

DeleteJob() публичный Метод

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"
Результат SchooxResponse

DeleteType() публичный Метод

Deletes a specified type.
public DeleteType ( int typeId ) : SchooxResponse
typeId int Type to delete
Результат SchooxResponse

DeleteUnit() публичный Метод

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"
Результат SchooxResponse

EditAboveUnit() публичный Метод

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"
Результат SchooxResponse

EditJob() публичный Метод

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"
Результат SchooxResponse

EditType() публичный Метод

Changes the name of a Type.
public EditType ( int typeId, string typeName ) : SchooxResponse
typeId int Type ID to edit
typeName string New type name
Результат SchooxResponse

EditUnit() публичный Метод

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"
Результат SchooxResponse

EditUser() публичный Метод

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"
Результат SchooxResponse

GetAboveUnits() публичный Метод

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
Результат SchooxResponse>

GetAndEnumerateAllUsers() публичный Метод

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.
Результат List

GetArchivedUnits() публичный Метод

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
Результат SchooxResponse>

GetDetailsOfUser() публичный Метод

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"
Результат SchooxResponse

GetJobs() публичный Метод

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
Результат SchooxResponse>

GetTypes() публичный Метод

Returns a list of all Types of your Academy.
public GetTypes ( ) : SchooxResponse>
Результат SchooxResponse>

GetUnits() публичный Метод

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
Результат SchooxResponse>

GetUsers() публичный Метод

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
Результат SchooxResponse>

InviteUser() публичный Метод

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.
Результат SchooxResponse

ReactivateUser() публичный Метод

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
Результат SchooxResponse

ReactivateUser() публичный Метод

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
Результат SchooxResponse

RemoveAboveUnitFromUser() публичный Метод

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"
Результат SchooxResponse

RemoveUnitsFromUser() публичный Метод

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"
Результат SchooxResponse

RemoveUser() публичный Метод

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
Результат SchooxResponse

UnarchiveUnit() публичный Метод

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"
Результат SchooxResponse

UpdateUserJobs() публичный Метод

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
Результат SchooxResponse

UpdateUserRoles() публичный Метод

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
Результат SchooxResponse

Users() публичный Метод

public Users ( ) : System
Результат System

Users() публичный Метод

public Users ( ISchooxService service ) : System
service ISchooxService
Результат System