SendTemplatedBulkMessageWithOptions
Sends an SMS message to all the cell numbers provided (maximum of 5000). Message can contain parameters arrays in a format (eg. <1>, or <2>). Args is an array of arrays with each row having the same number of columns as cell numbers. Supported options are the following MsgContentType=Unicode | Ascii.
Returns the number of messages successfully queued, or an error message on failure.
// uses JQuery library/** NOT CURRENTLY AVAILABLE **/<?php /** Please contact support@swiftsmsgateway.com for sample **/?>Const templateBody As String = "Hello <1>, you have an appointment at <2>"
Dim numbers = New ArrayOfString()numbers.AddRange({destinationNumber, destinationNumber})
Dim args(2) As ArrayOfStringargs(0) = New ArrayOfString()args(0).AddRange({"John", "10:30am"})args(1) = New ArrayOfString()args(1).AddRange({"Linda", "3:45pm"})
Dim options = New ArrayOfString()options.Add("MsgContentType=ASCII")options.Add("SenderId=" & senderNumber)
' Service Reference (SOAP)Using client = New SwiftSMS.SendSMSSoapClient Dim response = client.SendTemplatedBulkMessageWithOptions(accountKey, _ templateBody, reference, numbers, args, options)End Using
' WebClient (REST)' NOT CURRENTLY AVAILABLEHTTP POST:# NOT CURRENTLY AVAILABLE #var numbers = new SwiftSMS.ArrayOfString { destinationNumber, destinationNumber };
var options = new SwiftSMS.ArrayOfString { "MsgContentType=Unicode", "SenderID=" + senderNumber };var templateBody = "Hello <1>, you have an appointment at <2>";SwiftSMS.ArrayOfString[] args = new ArrayOfString[2];args[0] = new ArrayOfString {"John", "10:30am"};args[0] = new ArrayOfString {"Linda", "3:45am"};// Service Reference / SOAPusing (var client = new SwiftSMS.SendSMSSoapClient()){ var response = client.SendTemplatedBulkMessageWithOptions(accountKey, templateBody, reference, numbers, args, options);}
// Web Client / REST/** NOT CURRENTLY AVAILABLE **/HTTP Request
| Parameter | Description | Location |
|---|---|---|
| AccountKey | Your Swift SMS Gateway account key | BODY |
| Reference | Internal Reference ID | BODY |
| TemplateBody | The template to use when sending the message. Using <1>, <2>, etc in the template will use values from Args | BODY |
| CellNumbers | Array of cell numbers to deliver SMS messages to | BODY |
| Args | Array of ArrayOfString objects with values for the parameters in the template body | BODY |
| Options | Array of strings with each containing [key]=[value] | BODY |
Options
| Parameter | Value | Description | Is Default |
|---|---|---|---|
| MsgContentType | Send message as ASCII or Unicode | ||
| Unicode | Send Unicode Message (allowing the extended character set) | ||
| ASCII | Send messages using only ASCII characters | Yes | |
| SenderId | Phone number of dedicated long code to send your messages from | ||
| Reference2 | Secondary Reference field. | ||
If this is an email address, any replies will be send to this address. This OVERRIDES account settings. |
Returns
string
If successful, will return x messages queued successfully
If unsuccessful, will return an error message: (See (SendMessage))