Message Dispatcher

The Message Dispatcher resource can be used to send one or more SMS and Voice messages either straight away or scheduled in the future at a later point. The XML request object will contain the details of the message(s) to be sent and will generate a message batch response containing a URI to allow future queries to discover the status of the message(s).

Send message

URL
https://api.esendex.com/v1.0/messagedispatcher
HTTP Method
POST
Authentication
Basic / Session
Example request
<?xml version='1.0' encoding='UTF-8'?>  
<messages>  
 <accountreference>EX0000000</accountreference>
 <message>
  <to>447700900123</to>
  <body>Every message matters!</body>
 </message>  
</messages>
Response
Content Type: application/xml
HTTP Status Code: 200
Response Data
<?xml version="1.0" encoding="utf-8"?> 
<messageheaders batchid="F8BF9867-FF81-49E4-ACC5-774DE793B776" 
xmlns="http://api.esendex.com/ns/"> <messageheader uri="https://api.esendex.com/v1.0/MessageHeaders/1183C73D-2E62-4F60-B610-30F160BDFBD5" id="1183C73D-2E62-4F60-B610-30F160BDFBD5" /> </messageheaders>

Example Requests

Send SMS message with a From address

<?xml version='1.0' encoding='UTF-8'?>  
<messages>  
 <accountreference>EX0000000</accountreference>
 <message>
  <from>07700900654</from>
  <to>07700900123</to>
  <type>SMS</type>
  <body>This is an SMS message</body>
 </message>  
</messages>

Send scheduled SMS message

<?xml version='1.0' encoding='UTF-8'?>  
<messages>  
 <accountreference>EX0000000</accountreference> 
 <sendat>2012-01-01T14:31:00</sendat>
 <message>  
  <to>07700900123</to>  
  <type>SMS</type>  
  <body>This is an SMS message </body>
 </message>  
</messages>

Send multiple SMS messages with default From address

<?xml version='1.0' encoding='UTF-8'?>  
<messages>  
 <accountreference>EX0000000</accountreference> 
 <from>07700900654</from>
 <message>  
  <to>07700900123</to>  
  <type>SMS</type>  
  <body>Hello Mr Sands.</body>
 </message>  
 <message>  
  <to>07700900124</to>  
  <type>SMS</type>  
  <body>Hello Mr Mayo.</body>
 </message>  
</messages>

Send Voice message

<?xml version='1.0' encoding='UTF-8'?>  
<messages>  
 <accountreference>EX0000000</accountreference> 
 <message>  
  <to>0123456789</to>  
  <type>Voice</type>  
  <body>This is a Voice message</body>  
  <lang>en-GB</lang>  
  <retries>3</retries>  
 </message> 
</messages>

Send SMS messages with specified character set

<?xml version='1.0' encoding='UTF-8'?>  
<messages>  
 <accountreference>EX0000000</accountreference>
 <characterset>Auto</characterset>
 <message>
  <type>SMS</type>
  <body>This is an SMS message</body>
  <characterset>GSM</characterset>
 </message>
 <message>
  <type>SMS</type>
  <body>This is an SMS message</body>
  <characterset>Unicode</characterset>
 </message>
 <message>
  <type>SMS</type>
  <body>This is an SMS message</body>
 </message>
</messages>

Request Elements

<messages> elements

Element name Description
<accountreference> Required: The Esendex Account reference that the messages should be sent from. This is a required element.
<from> The default alphanumeric originator that the message appears to originate from. Can be overridden on a per message basis. 
This must be either a valid phone number or an alphanumeric value with a maximum length of 11 characters, that may contain letters, numbers and the following special characters: 
* $ ? ! ” # % & _ - , @ ' +
<type> The default type of all messages to be sent: either SMS or Voice. Can be overridden on a per-message basis.
<lang> Voice only: The default language to use for all Voice SMS messages in this request. Currently supports: en-GB (English UK), en-AU(English-Australian), fr-FR (French), es-ES (Spanish) and de-DE (German).
<retries> Voice only: The default number of times for all messages in this request to attempt to call and deliver a Voice SMS message.
<validity> SMS only: The default validity period in hours for all messages in this request (defaults to 0 which indicates the MAX allowed).
<sendat> The time to schedule the messages for delivery for all messages in this request. It cannot be overridden on a per-message basis. 
The format is yyyy-MM-ddThh:mm:ssZ where y=year, M=month, d=day, T=separator, h=hour, m=min and s=seconds. The value is treated as per ISO 8601 semantics, e.g. without time zone information the value is assumed to be the local time of the server, otherwise as an offset from UTC with Z representing a UTC time
<characterset> The default character set of the messages to be used when not specified within each message. Valid values are: GSM, Unicode and Auto.
When using Auto the most appropriate character set is automatically detected. The default value is GSM.

One or more <message> elements

Element name Description
<from> The alphanumeric originator for the message to appear to originate from. This will override any <from> value set in the <messages> section.
This must be either a valid phone number or an alphanumeric value with a maximum length of 11 characters, that may contain letters, numbers and the following special characters: 
* $ ? ! ” # % & _ - , . @ ' +
<to> Required: The telephone number or numbers to send this message to. Multiple telephone numbers must be comma separated.
<type> The type of the message to be sent: either SMS or Voice. If no type is specified, the default is SMS.
<body> Required: The message content.
<lang> Required for Voice only: The language to use for this Voice SMS message. Currently supports: en-GB (English UK), en-AU (English Australian), fr-FR(French), es-ES (Spanish) and de-DE (German).
<retries> Voice only: The number of times to attempt to call and deliver a Voice SMS message.
<validity> SMS only: The validity period for this message in hours (defaults to 0 which indicates the MAX allowed).
<characterset> The character set of the message to be used. Valid values are: GSM, Unicode and Auto.
When using Auto the most appropriate character set is automatically detected. The default value is GSM, unless specified in the messages element.