Receive message request XML

Modified on Tue, 19 Nov 2024 14:49 by FM — Categorized as: XML API

The reception of messages is similar to sending, except that the communication is initiated by the Gateway instead of the customer. There’s also less parameters and settings available for incoming messages. When setting up your account for incoming messages and would like to receive them using the XML interface, you must supply an IP/port-number or URL at your end. You will need to listen on this port for incoming TCP connections or HTTP POST from the Gateway.

The Gateway will deliver an XML document built on the following DTD:

<!-- PSWinCom DTD SMS Receive Request-->
<!ELEMENT ID (#PCDATA)>
<!ELEMENT SND (#PCDATA)>
<!ELEMENT RCV (#PCDATA)>
<!ELEMENT TEXT (#PCDATA)>
<!ELEMENT NET (#PCDATA)>
<!ELEMENT ADDRESS (#PCDATA)>
<!ELEMENT MSG (ID, TEXT, SND, RCV, NET?, ADDRESS?)>
<!ELEMENT MSGLST (MSG+)>

Please note that here’s no login information wrapped in a session element, but only a list of one or more message elements. A sample XML receive request from the Gateway may be formatted as follows:

<?xml version="1.0" encoding="iso-8859-1"?>
<MSGLST>
  <MSG>
    <ID>1</ID>
    <TEXT>Incoming message 1</TEXT>
    <SND>4512345678</SND>
    <RCV>4512345678</RCV>
  </MSG>
</MSGLST>

The text encoding is specified in the Content-Type header, e.g.:

Content-Type: application/xml; charset=iso-8859-1