ASP.NET VETtrak API web services
ContentsIndexHome
PreviousUpNext
VT_API.GetClientsForStaff Method

Gets a list of clients that are associated with a staff member in various ways. 

This will return clients that are associated with the staff member through classes, enrolments, contracts and/or events, where those things overlap the specified date range and, optionally, the staff member is assigned with a particular type and/or the status of the enrolments and contracts are of specified types. 

The results are represented in a list of TClieStaffLinks, one per client that is linked in any way. Each one contains the client itself in a TClie. Each one also contains a list of TStaffLink that describes each way that this client is linked to the staff member. 

A token is passed for authentication. If the authentication fails, or other errors occur, no data will be returned. The result of the authentication is represented by a TAuthenticate object. 

This function has security level "Restricted". Users that have explicitly been granted permission to the API can use it with any parameters, otherwise, the logged-in client can only access their own data.

C#
[WebMethod(Description = "Gets a list of clients associated with a staff member in various ways")]
public TAuthClieStaffLinksList GetClientsForStaff(string token, string staffClientCode, bool includeClasses, bool includeEnrolments, bool includeContracts, bool includeEvents, DateTime startDate, DateTime endDate, string staffType, List<int> statusTypes);
Parameters 
Description 
string token 
Mandatory string containing a token. 
string staffClientCode 
The client code of the staff member to get clients for. 
bool includeClasses 
If true, includes clients in classes where the staff member is assigned to the class and the class overlaps the start and end dates 
bool includeEnrolments 
If true, includes clients in enrolments where the staff member is assigned to the enrolment and the enrolment overlaps the start and end dates and, if the staff type is specified, the staff member is assigned to the enrolment with that staff type 
bool includeContracts 
If true, includes clients in contracts where the staff member is assigned to the contract and the contract overlaps the start and end dates and, if the staff type is specified, the staff member is assigned to the contract with that staff type 
bool includeEvents 
If true, includes clients in client events where the staff member is assigned to the event and the event overlaps the start and end dates 
DateTime startDate 
The start date of the range in which to consider classes, enrolments, contracts and events 
DateTime endDate 
The end date of the range in which to consider classes, enrolments, contracts and events 
string staffType 
Optional string of the staff type to consider. If this is specified, only contracts and enrolments where the staff member is assigned with this type are considered. A list of valid staff types can be obtained by calling GetStaffTypes. Pass an empty or null string to ignore staff type 
List<int> statusTypes 
Optional list of status types to consider. If this is specified, only enrolments or contracts with a status type that is in the specified list are considered. If the list is not specified or is empty, all enrolment and contract statuses are considered. Each item in the list can be one of the following integers:
  • 0: Active
  • 1: Completed
  • 9: Cancelled 

TAuthClieStaffLinksList containing the clients that are associated with this staff member and match the criteria

Copyright (c) VETtrak 2022. All rights reserved.