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

Adds units to a client occurrence enrolment. 

The units must exist on the occurrence that the enrolment is in. 

An Enrolment ID (enrolmentId) is passed as a parameter. This should be the ID of an occurrence enrolment. This can be sourced from functions such as GetEnrolmentsForClient or GetEnrolmentsForOccurrence

The parameter unitCodes is a List of strings, indicating the codes of the units to add to the enrolment. The easiest way to get a list of these is to use the GetUnitsForOccurrence function to get a list of all units in the occurrence the Enrolment is in. 

Any units specified that already exist on the enrolment will be ignored. 

An error will occur if any units specified do not exist on the occurrence. An error will occur if the enrolment specified is not an occurrence enrolment. 

A token is passed for authentication. If the authentication fails, or other errors occur, no units are added. 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 = "Adds the specified units to the existing occurrence enrolment ID")]
public TAuthenticate AddUnitsToEnrolment(string token, int enrolmentId, List<string> unitCodes);
Parameters 
Description 
string token 
String containing a token. 
int enrolmentId 
Integer ID of the Client Occurrence Enrolment. 
List<string> unitCodes 
List of strings, which are the codes of the units to add to the enrolment. 

TAuthenticate : an Authenticate Object containing the result of the update.

Copyright (c) VETtrak 2022. All rights reserved.