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

Insert a Client. 

Create a new Client record and populate fields Clie_Surname, Clie_Given, Clie_Code, Clie_Username, password and DivisionId. Remaining fields will take default values or Null. Note that Clie_Code, Clie_Username and password are automatically generated. 

Clients must be linked to a division. If you do not specify a division, the client is linked to the Root Division. 

If VETtrak's security settings are configured to use email addresses for usernames, you should specify the "email" parameter (otherwise the client will have no username and not be able to log in), and there must be no other clients with a username matching that email address. 

Returns an Authenticated Client containing details of the newly created Client. 

The basic details of the newly created Client, are represented by a TClie. Note that this does not include the Clie_Username property. To access this property, call the function GetClientDetails(sClie_Code). 

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

If more detailed information is available for a new client, the procedure would be to create the new client using the AddClient function, then populate a TClieDetail object with the available details and call UpdateClientDetails

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 = "Creates a new client with the specified surname and given name")]
public TAuthClie AddClient(string sToken, string sClie_Surname, string sClie_Given, int? divisionId, string email);
Parameters 
Description 
string sToken 
String Token. 
string sClie_Surname 
String Surname of new Client. Maximum length 50 characters. 
string sClie_Given 
String Given Name of new Client. Maximum length 50 characters. Leave empty for a single name client. 
int? divisionId 
Optional ID of division to link client to. Specify null or 0 to default to the root division. 
string email 
Email address for new client. If VETtrak's security settings are configured to use email addresses for usernames, this parameter should be specified and must be unique. 

TAuthClie : an Authenticated Basic Client.

Copyright (c) VETtrak 2022. All rights reserved.