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

Searches for web-published occurrences with the specified criteria. Can return additional details about each occurrence. 

Any combination of a programmeId, date range, and location, to filter the occurrences by, may be specified. At least one of these must be specified. 

programmeId is the ID of a programme to filter occurrences by. You can use GetWebProgrammes, GetWebProgrammesForDates, GetWebProgrammesForProgType or GetWebProgrammesForProgTypeAndDates to find a programmeId to filter by. Specify 0 or null to not filter occurrences by programme. 

startDate and endDate is the date range to filter occurrences by. If either is specified, both must be specified. Specify overlapDates = false to get occurrences that start in the specified date range (inclusive). Specify overlapDates = true to get occurrences that overlap the specified date range (inclusive). If startDate and endDate are null/not set, occurrences are not filtered by date. 

locationCode is the code of a location to filter occurrences by. Call GetWebLocationsForProgrammeAndDates to get a list of candidate locations. If null or an empty string, occurrences are not filtered by location. 

returnOccurrenceLists is an array of strings, used to specify which lists in each returned TOccuExtended you would like populated. Regardless of what you specify (even null or empty), the OccurrenceDetail property (containing a TOccu) in each TOccuExtended will always be populated. You can specify one or more of the following strings in the array (one per array element) to populate the corresponding lists in each returned TOccuExtended:

  • Classes
  • Prices
  • Staff
  • StudyReasons
  • Tasks
  • Units
 

includeFull is false by default, meaning that only occurrences with available places are returned. "Available places" means that the number of students enrolled is less than the maximum number allowed for the occurrence. If you specify includeFull = true, occurrences that don't have any available places are also returned. 

Note that specifying wide criteria that returns a large number of occurrences, and/or too many lists in returnOccurrenceLists, may cause a long delay while the API collates the data, and/or a large amount of data, and in extreme cases may cause your web service client to time out. 

Each occurrence item is represented by a TOccuExtended. The collection of occurrences is represented by a List of TOccuExtended. Only the lists that you have specified in the returnOccurrenceLists array will be populated in each object. 

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

Requires a valid registration key entry for the Short Courses feature. 

This function has security level "Protected", and can only be accessed by users that have explicitly been granted permission to the API.

C#
[WebMethod(Description = "Searches for web-published occurrences with available places")]
public TAuthOccuExtendedList SearchWebOccurrences(string token, int? programmeId, DateTime? startDate, DateTime? endDate, bool overlapDates, string locationCode, List<string> returnOccurrenceLists, bool? includeFull);
Parameters 
Description 
string token 
String containing a token. 
int? programmeId 
Optional integer ID of programme to get occurrences for. Specify 0 or null to not filter on programme. 
DateTime? startDate 
Optional date, start of date range in which to find occurrences. If specified, endDate must also be specified. Specify null for this and endDate to not filter on dates. 
DateTime? endDate 
Optional date, end of date range in which to find occurrences. If specified, startDate must also be specified. Specify null for this and startDate to not filter on dates. 
bool overlapDates 
Boolean. False to get occurrences which start in the specified date range. True to get occurrences which overlap the specified date range. Ignored if no date range is specified. 
string locationCode 
Optional code of location to filter occurrences by. Specify empty or null to not filter on location. 
List<string> returnOccurrenceLists 
List of strings specifying what lists in each TOccuExtended to return. Can contain any of the following: Classes, Prices, Staff, StudyReasons, Tasks, Units 
bool? includeFull 
Boolean. False (the default) to only retrieve occurrences with available places. True to also include occurrences that have no available places. 

TAuthOccuExtendedList: an authenticated list of occurrence extended details.

Copyright (c) VETtrak 2022. All rights reserved.