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

Sends a single SMS message to a mobile number, using the VETtrak SMS service. 

To use this function, the VETtrak database must contain a registration key for the SMS Extension, and the business must have sufficient SMS credits. Errors will be returned if either of these are not the case. Use the VETtrak Support Centre website to purchase additional SMS credits. Note that each SMS message sent through this function will be deducted from the business' prepaid SMS balance. 

The same messageContent is sent to the mobile phone number mobileNumber. 

To send the message at a later time, specify the date/time at which to send the message in the scheduleDate parameter. Leave this parameter null/empty to send immediately. 

The result of the call is represented in the returned TAuthSMSResult object. The TAuthenticate within the TAuthSMSResult indicates the overall status of the operation. If this does not represent success, it will contain the error message, the SMS message was not sent, and the other properties of the TAuthSMSResult will not be set. 

If the TAuthenticate shows success, the resulting TAuthSMSResult indicates the number of SMS that were sent (which should be 1), and the remaining SMS credit balance. Note that a status of success means that the SMS message was successfully queued for dispatch, not that it was successfully received by the destination mobile handset. 

Note that there is no validation of the mobile number, whatever mobile number is specified will be attempted to be sent to. Use of an invalid mobile number will still incur the normal cost. 

Whereever possible, the SendSMSMessages function should be used in preference to this function, especially if you know the client code of the clients you are sending messages to. The SendSMSMessages function has more functionality. 

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 "Protected", and can only be accessed by users that have explicitly been granted permission to the API.

C#
[WebMethod(Description = "Sends an SMS text message to a mobile number, using the VETtrak SMS service")]
public TAuthSMSResult SendSMSMessageToNumber(string token, string messageContent, string sender, string mobileNumber, string providerId, DateTime? scheduleDate);
Parameters 
Description 
string token 
Mandatory string containing a token. 
string messageContent 
The content of the SMS message to send, mandatory string of no more than 612 characters. If it is more than 160 characters long, it is sent as a multi-part message and an SMS credit is charged per 153-character chunk of the message. 
string sender 
The sender to use for the SMS message, who the message will appear to be from on the mobile handset. Can be a mobile number (to allow replies) or a name (which will prevent replies and should contain alphanumeric characters only). Mandatory string of between 3 and 11 characters. 
string mobileNumber 
The mobile number to send the SMS message to 
string providerId 
Optional ID of the API developer. If specified, this identifies what developer's API the SMS came from. If specified, this needs to be a valid ID provided by VETtrak Support. Pass blank or null for none 
DateTime? scheduleDate 
Optional scheduled date/time at which to send the message. If null or not specified, sends immediately 

A TAuthSMSResult containing a TAuthenticate indicating the status of the overall operation. If successful, also contains the new SMS balance.

Copyright (c) VETtrak 2022. All rights reserved.