Sends a batch of SMS messages to clients in VETtrak and/or mobile numbers, 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 all the specified smsRecipients. The list of recipients is specified in a List of TSMSRecipient. Each TSMSRecipient can specify a client code and/or a mobile number. If a client code is used, the client's mobile number in VETtrak is used and sent SMS history is recorded against the client in VETtrak. It is also possible, for some or all recipients, to specify a mobile number only (for clients not in VETtrak, which does not record sent SMS history), or to specify both a client code and a mobile number (to use the specified mobile number instead of the client's mobile number in VETtrak, but still record the SMS history against the client). Note that if acceptReplies is specified as "true", every TSMSRecipient in smsRecipients must have a ClientCode specified, so that replies can be recorded successfully.
If sending a marketing message, please specify true for the isMarketing parameter. If true, any smsRecipients that have a client code specified, where that client has elected not to receive marketing messages, will be automatically excluded from the SMS sending.
To allow recipients to reply to messages, specify true for acceptReplies. This will cause the sender parameter to be ignored - instead the sender will be a number generated by the SMS Gateway, allowing recipients to reply to it. Users can use the Utility -> Retrieve SMS Replies and Receipts menu option in VETtrak to check for and retrieve replies.
To send messages at a later time, specify the date/time at which to send the messages in the scheduleDate parameter. Leave this parameter null/empty to send immediately.
The result of the call is represented in the returned TAuthSMSResultList object. The TAuthenticate within the TAuthSMSResultList indicates the overall status of the operation. If this does not represent success, it will contain the error message, no SMS messages were sent, and the other properties of the TAuthSMSResultList will not be set.
If the TAuthenticate shows success, the resulting TAuthSMSResultList indicates the number of SMS that were sent, the remaining SMS credit balance, and a List of TSMSResult that represents the status for each individual SMS message. Each TSMSResult contains the client code and/or mobile number and the status. The status will indicate if the client code does not exist or if a mobile number was not specified the client does not have a mobile number in VETtrak - meaning that a message was not sent for that client. Note that a status of "success" (1) 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 numbers, all specified mobile numbers will be attempted to be sent to. Use of an invalid mobile number will still incur the normal cost.
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.
[WebMethod(Description = "Sends an SMS text message to a number of clients or mobile numbers, using the VETtrak SMS service")] public TAuthSMSResultList SendSMSMessages(string token, string messageContent, string sender, List<TSMSRecipient> smsRecipients, bool isMarketing, string providerId, bool? acceptReplies, 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 each 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. |
List<TSMSRecipient> smsRecipients |
A List of TSMSRecipient indicating each person to send the SMS message to. Each one can contain a VETtrak client code and/or a mobile number. Refer to TSMSRecipient for details. |
bool isMarketing |
Boolean indicating whether this is a marketing message. If true specified, any smsRecipients that have a client code and have elected not to receieve marketing messages will not be sent the SMS (and will not be charged). If false, the SMS is sent to all smsRecipients regardless of their marketing messages preference. |
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 |
bool? acceptReplies |
Indicates whether to accept replies. If true, sender is ignored. If not specified, defaults to false. If true, every entry in smsRecipients must have a client code specified |
DateTime? scheduleDate |
Optional scheduled date/time at which to send the messages. If null or not specified, sends immediately |
A TAuthSMSResultList containing a TAuthenticate indicating the status of the overall operation. If successful, also contains the new SMS balance, and a List of TSMSResult indicating the status of each individual SMS message.
Copyright (c) VETtrak 2022. All rights reserved.
|