Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Note

The XML HTTP API has been deprecated.

Please ensure that all new customers us the Web Services API

The XML HTTP API is described here for customers who are already using it.

XML Document Format

The XML should be of this example format

Code Block

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE msg_core SYSTEM "msg_core.dtd">

<DOCUMENT id="amethon001" timestamp="2001-01-23 16:40:20" MODE="test">
	<SENDER password="xxxxx">
		<ADDRESS type="EMAIL" role="FROM"
		 value="name@company.com"></ADDRESS>
	</SENDER>

	<REPLYTO>
		<ADDRESS type="EMAIL" role="REPLYTO"
		 value="name@company.com"></ADDRESS>
	</REPLYTO>

	<SMS>
		<HEADER>Amethon.xml</HEADER>
		<FOOTER>SMS by HTTP/XML</FOOTER>
	</SMS>

	<MESSAGE id="amethon0101" priority="3">
		<ADDRESS type="SMS" role="TO"
		 value="0410507753"
		 status="INITIATOR" priority="1"></ADDRESS>
		<SUBJECT>
			Example
		</SUBJECT>

		<BODY type="TEXT">
			<PAYLOAD>
				Test SMS Message using XML.
			</PAYLOAD>
		</BODY>
	</MESSAGE>

</DOCUMENT>

Examples:

Single SMS

The following is an example of sending one message to a single person

Code Block

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE DOCUMENT SYSTEM "http://localhost:8080/gateway/msg_core.dtd">

<DOCUMENT mode="NORMAL">

	<SENDER password="xxxx">
		<ADDRESS type="EMAIL" role="FROM" value="account@company.com"/>
	</SENDER>

	<MESSAGE>
		<ADDRESS type="EMAIL" role="REPLYTO" value="mailto:sms@company.com?subject=SMS Reply ID#765"/>
		<ADDRESS type="SMS" role="TO" value="61410123123" status="INITIATOR" priority="1"/>
		<BODY type="TEXT">
			<PAYLOAD type="TEXT" encoding="ASCII">This is an SMS from the gateway.
			</PAYLOAD>
		</BODY>
	</MESSAGE>

</DOCUMENT>

One to Many

The following is an example of sending one message to many targets. This example will send the message "Test SMS Message using XML" to the following phone numbers: 0410507753, 0402469846 and 0418235612

Code Block

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE DOCUMENT SYSTEM "http://localhost:8080/gateway/msg_core.dtd">

<DOCUMENT mode="NORMAL">

	<SENDER password="xxxx">
		<ADDRESS type="EMAIL" role="FROM" value="account@company.com"/>
	</SENDER>

	<MESSAGE priority="3">
		<ADDRESS type="SMS" role="TO" value="0410507753" status="INITIATOR" priority="1"></ADDRESS>
		<ADDRESS type="SMS" role="TO" value="0402469846" status="INITIATOR" priority="1"></ADDRESS>
		<ADDRESS type="SMS" role="TO" value="0418235612" status="INITIATOR" priority="1"></ADDRESS>
		<SUBJECT>
			Multicast test
		</SUBJECT>

		<BODY type="TEXT">
			<PAYLOAD>
				Test SMS Message using XML.
			</PAYLOAD>
		</BODY>
	</MESSAGE>

</DOCUMENT>

Many to Many

The following is an example of sending many messages to many targets. This example will send "Test SMS Message using XML (Batch - 1)." to 0410507753 and "Test SMS Message using XML (Batch - 2)." to 0402469846.

Code Block

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE DOCUMENT SYSTEM "http://localhost:8080/gateway/msg_core.dtd">

<DOCUMENT mode="NORMAL">

	<SENDER password="xxxx">
		<ADDRESS type="EMAIL" role="FROM" value="account@company.com"/>
	</SENDER>

	<MESSAGE priority="3">
		<ADDRESS type="SMS" role="TO" value="0410507753" status="INITIATOR" priority="1"></ADDRESS>
		<SUBJECT>
			Batch Test
		</SUBJECT>

		<BODY type="TEXT">
			<PAYLOAD>
				Test SMS Message using XML (Batch - 1).
			</PAYLOAD>
		</BODY>
	</MESSAGE>
	
	<MESSAGE priority="2">
		<ADDRESS type="SMS" role="TO" value="0402469846" status="INITIATOR" priority="1"></ADDRESS>
		<SUBJECT>
			Batch Test
		</SUBJECT>

		<BODY type="TEXT">
			<PAYLOAD>
				Test SMS Message using XML (Batch - 2).
			</PAYLOAD>
		</BODY>
	</MESSAGE>

</DOCUMENT>