The 'UserID' and 'Password' elements identify the account.
The 'ServiceName' element must be set to 'SendMessage'.
The 'SoftwareVersion' element is for internal 2SMS use only and should not be set.
1 Message Types
The 'ServiceDetail' element should contain child elements of one of the following types:
1.1 SingleMessage elements
Each element is used to send a single message to a single SMS destination.
By using multiple elements it is possible to customize a message text for different destinations.
Up to 500 'SingleMessage' elements may be supplied.
Each element should contain the following children:
- A 'Destination' element that contains the SMS number to receive the message (email destinations are not allowed).
- A 'Text' element that holds the message to be sent
(messages over 160 characters are sent in a number of parts).
- A set of optional elements as described in Section 2 below.
The advantage of this method is the flexibility to set different text, destination and send options in multiple elements
(e.g. to provide different message text including recipient names).
The disadvantage is that only one destination is allowed per 'SingleMessage' element.
1.2 BulkMessage elements
This method is used to send the same SMS message to multiple recipients.
Only a single 'BulkMessage' element may be supplied.
The element should contain the following children:
- A 'DestinationList' element with up to 1000 'Destination' children
which contain the SMS numbers to receive the message (email destinations are not allowed).
- A 'Text' element that holds the message to be sent
(messages over 160 characters are sent in a number of parts).
- A set of optional elements as described in Section 2 below.
1.3 GroupMessage elements
This method is used to send the same SMS message to one or more groups of contacts defined on the account.
Only a single 'GroupMessage' element may be supplied.
The element should contain the following children:
- A 'GroupList' element with up to 100 'GroupID' children which detail the groups to receive the message
(see schema code 0140 for info on obtaining GroupID values).
Note that messages will be sent only to SMS destinations in the groups as this method does not support email.
If a destination occurs multiple times within different groups only a single message will be sent to that destination.
- A 'Text' element that holds the message to be sent
(messages over 160 characters are sent in a number of parts).
- A set of optional elements as described in Section 2 below.
1.4 CombiMessage elements
This method is used to send a message to both individual and group destinations,
and is the only method that provides support for email.
Either one or two 'CombiMessage' elements may be sent.
Each element should contain the following children:
- A 'CombiList' element which may hold up to 1000 'Individual' children, the text content of which identify
single email or SMS destinations as specified by the 'type' attribute.
- The same 'CombiList' element may also hold up to 100 'GroupID' children, the text content of which identify
groups of individuals to receive the message
(see schema code 0140 for info on obtaining GroupID values).
The type attribute determines whether only email, only SMS or both email and SMS destinations receive the message.
If a destination occurs in multiple groups (and possibly 'Individual' elements) only a single message will be sent to that destination.
- A 'Text' element that holds the message to be sent
(messages over 160 characters are sent in a number of parts).
- An optional 'EmailDetails' element may be supplied when emails are being sent (see Section 3 below).
- A set of optional elements as described in Section 2 below.
2. Optional Elements and their Defaults
Any combination of the following optional elements may be supplied:
- A 'GUID' element to assign a reference to the message batch for identification purposes.
If not set a default value is assigned based on when the request was received.
- A 'DateToSend' element containing a future time at which the messages will be sent. The format must be MM/dd/yyyy hh:mm:ss.
If not set the messages will be sent immediately.
- A 'Header' element to specify which header to employ when additional SMS headers have been purchased
(see here for more details on headers).
If not set the default header for the account is used.
- A 'Repeat' element may be used to schedule repeating messages.
The first message will go out at a time determined by the 'DateToSend' element (default is immediately).
The message is then sent again at time intervals of 'Frequency' minutes for a further 'Repetitions' times
(thus the message will be sent a total of (repetitions + 1) times including the initial send).
- The 'SoftwareVersion' element is present to support legacy code and should not be used.
3. Setting Email options
Sending of emails and hence email options are only available for CombiMessage requests. An 'EmailDetails'
child of 'ServiceDetail' may be supplied containing any of the following optional children:
- A 'Subject' element containing the email subject. The default is an empty subject string.
- A 'FromName' element containing the email sender's name. The default is the first and last names registered for the account.
- A 'FromAddress' element containing the email address to supply as the sender. The default is 'support@2sms.us'.
- A 'ReplyTo' element containing the email address to which email replies will be directed.
The default is the current username of the account or 'support@2sms.us' if this is not recognised as an email address.
- A 'MessageType' element to identify if the email should be sent in the default 'Email' (plain text) or alternative 'HTML' format.