Connect XML DTD

Connect requires events to be formatted using Connect XML. The following code is a sample Connect XML document:

<?xml version="1.0" encoding="ISO-8859-1"?>
<kanaRoot>
    <EventRequest Id="12345" CompanyName="Default">
        <Customer E-mailAddress="[email protected]" BirthDate="111">
            <CustomerAttribute Name="First Name">John</CustomerAttribute>
            <CustomerAttribute Name="Last Name">Smith</CustomerAttribute>
            <CustomerPreference Name="Favorite River">
                <CustomerPreferenceValue>Amazon</CustomerPreferenceValue>
                <CustomerPreferenceValue>Yangtze</CustomerPreferenceValue>
            </CustomerPreference>
        </Customer>
        <Event CampaignName="EToy Event">
            <EventAttribute Name="Product">Dell Computer</EventAttribute>
            <EventAttribute Name="Price">300</EventAttribute> 
            <EventAttribute Name="DateOfPurchase">802390</EventAttribute>
            <ExternalXML>
                <ORDER NO="1" >
                    <SHIPPING TYPE="UPGRADE" CARRIER="FEDEX" TRACKNUMBER="8201280912"> 
                        <DATE DAY="15" MONTH="05" YEAR="2000" /> 
                    </SHIPPING>
                    <ITEMLIST>
                        <ITEM NUMBER="1" QTY="2" PRODUCTDESC="TT pink" STATUS="CA" />
                        <ITEM NUMBER="2" QTY="4" PRODUCTDESC="TT blue" STATUS="NONFINAL" />
                        <ITEM NUMBER="3" QTY="1" PRODUCTDESC="GI Joe" STATUS="SH" />
                        <ITEM NUMBER="4" QTY="1" PRODUCTDESC="B Baby" STATUS="CA" />
                        <ITEM NUMBER="5" QTY="5" PRODUCTDESC="Bi Baby" STATUS="NONFINAL" />
                    </ITEMLIST>
                </ORDER>
            </ExternalXML>
        </Event>
    </EventRequest>
</kanaRoot>
            

The following is the document type definition (DTD) for a Connect XML document:

 
<!ELEMENT kanaRoot (EventRequest | EventResponse | StatusRequest | StatusResponse)>
<!ELEMENT EventRequest (Customer?, Event?)>
<!ATTLIST EventRequest Id CDATA #IMPLIED> 
<!ATTLIST EventRequest CompanyName CDATA #REQUIRED>
<!ATTLIST EventRequest CampaignName CDATA #IMPLIED>
<!ELEMENT EventResponse (Description?, OriginalRequest?, EventStatus*)>
<!ELEMENT Description (#PCDATA)>
<!ELEMENT OriginalRequest (#PCDATA)>
<!ELEMENT StatusRequest (CustomerStatusRequest*, EventStatusRequest*, SubscriptionStatusRequest*)>
<!ATTLIST StatusRequest CompanyName CDATA #REQUIRED>
<!ELEMENT CustomerStatusRequest (#PCDATA)>
<!ATTLIST CustomerStatusRequest EmailAddress CDATA #IMPLIED>
<!ELEMENT EventStatusRequest (#PCDATA)> 
<!ATTLIST EventStatusRequest EventQueueId CDATA #REQUIRED> 
<!ELEMENT SubscriptionStatusRequest (#PCDATA)> 
<!ATTLIST SubscriptionStatusRequest EmailAddress CDATA #IMPLIED> 
<!ATTLIST SubscriptionStatusRequest CampaignName CDATA #REQUIRED> 
<!ELEMENT StatusResponse (CustomerStatus*, EventStatus*, SubscriptionStatus*)>
<!ELEMENT CustomerStatus (StatusCode?, Description)> 
<!ATTLIST CustomerStatus EmailAddress CDATA #REQUIRED> 
<!ELEMENT EventStatus (StatusCode?, Description, CustomerKey)> 
<!ATTLIST EventStatus EventQueueId CDATA #REQUIRED> 
<!ELEMENT StatusCode (#PCDATA)>
<!ELEMENT CustomerKey (#PCDATA)> 
<!ATTLIST CustomerKey Name CDATA #REQUIRED>
<!ELEMENT SubscriptionStatus (StatusCode?, Description)> 
<!ATTLIST SubscriptionStatus EmailAddress CDATA #REQUIRED>
<!ATTLIST SubscriptionStatus CampaignName CDATA #REQUIRED> 
<!ELEMENT Customer (CustomerAttribute*, CustomerPreference*)> 
<!ATTLIST Customer EmailAddress CDATA #REQUIRED>
<!ATTLIST Customer KeyField CDATA #IMPLIED>
<!ATTLIST Customer Alt_Customer_Id CDATA #IMPLIED> 
<!ATTLIST Customer SendEmail (true | false) #IMPLIED> 
<!ATTLIST Customer Subscription (subscribe | unsubscribe | ignore) #IMPLIED> 
<!ATTLIST Customer First_Name CDATA #IMPLIED>
<!ATTLIST Customer Middle_Name CDATA #IMPLIED>
<!ATTLIST Customer Last_Name CDATA #IMPLIED>
<!ATTLIST Customer Salutation CDATA #IMPLIED> 
<!ATTLIST Customer Address_Line1 CDATA #IMPLIED>
<!ATTLIST Customer Address_Line2 CDATA #IMPLIED> 
<!ATTLIST Customer City CDATA #IMPLIED>
<!ATTLIST Customer State CDATA #IMPLIED>
<!ATTLIST Customer Postal_Code CDATA #IMPLIED>
<!ATTLIST Customer Country CDATA #IMPLIED>
<!ATTLIST Customer Organization CDATA #IMPLIED>
<!ATTLIST Customer Birthdate CDATA #IMPLIED>
<!ATTLIST Customer Phone CDATA #IMPLIED>
<!ATTLIST Customer Fax CDATA #IMPLIED> 
<!ATTLIST Customer Email_Client_Id CDATA #IMPLIED>
<!ELEMENT CustomerAttribute (#PCDATA)>
<!ATTLIST CustomerAttribute Name CDATA #REQUIRED> 
<!ATTLIST CustomerAttribute DataType CDATA #IMPLIED>
<!ATTLIST CustomerAttribute Format CDATA #IMPLIED>
<!ELEMENT CustomerPreference (CustomerPreferenceValue+)>
<!ATTLIST CustomerPreference Name CDATA #REQUIRED>
<!ELEMENT CustomerPreferenceValue (#PCDATA)>
<!ELEMENT Event (EventAttribute*, ExternalXML?)> 
<!ATTLIST Event CampaignName CDATA #IMPLIED>
<!ELEMENT EventAttribute (#PCDATA)>
<!ATTLIST EventAttribute Name CDATA #REQUIRED>
<!ATTLIST EventAttribute DataType CDATA #IMPLIED> 
<!ATTLIST EventAttribute Format CDATA #IMPLIED>
<!ELEMENT EventAttachments (EventAttachment+)>
<!ELEMENT EventAttachment (#PCDATA)>
<!ATTLIST EventAttachment Name CDATA #REQUIRED>
<!ATTLIST EventAttachment URL CDATA #IMPLIED>
<!ATTLIST EventAttachment Encoding (base64) #IMPLIED> 
<!ATTLIST EventAttachment Purge (yes | no) #IMPLIED> 
<!ELEMENT ExternalXML ANY>
        

Elements and Attributes

The custom elements and attributes were successfully tested against ISO-8859-1 and UTF-8.


Element Attribute Description
<?xml version>  

The XML version number is 1.0. The XML encoding type must be supported by Java 1.2 or later.

<Customer> EmailAddress

Specifies the customer's email address. Mandatory.

KeyField

This can be the EmailAddress or an alternate Customer ID. Any other attribute must match the column name in CUSTOMER_MASTER. Optional.

Note: Connect does not use other attributes if specified in a <customer tag>.

SendEmail Indicates whether to send an email to the customer. Can be true or false.
Subscription Indicates the subscription action to take for the customer. Can be subscribe, unsubscribe or ignore.
<CustomerAttribute>  

This is a name-value pair where name represents the customer attribute name and value is the attribute value.

<CustomerKey> Name Identifies the customer and is similar to the KeyField attribute in the <Customer> element.
<CustomerPreference>  

Represents customer preference data. There can be many possible values for a single customer preference.

<CustomerStatusRequest>   Represents a request for customer status.
EmailAddress See the description for this attribute in the <Customer> element.
<CustomerStatus>   Holds the status details for a customer.
EmailAddress See the description for this attribute in the <Customer> element.
<Description>   A description as required by context.
<Event>  

Event specific data.

CampaignName

Value must match the campaign name as defined in the Connect system.

<EventAttachments>  

Represents a container for the list of EventAttachment definitions.

<EventAttachment> Name

Specifies the name of the attachment within the email sent from Connect. Mandatory.

URL URL where the attachment content resides. Must be accessible from Connect Mail Sender.
Encoding Specifies the element content encoding (the attachment content). Only Base64 is accepted anything else is ignored, including element content.
Purge Purges the binary attachment after the message has been sent when set to Yes or yes.
<EventAttribute>  

A name-value pair for an event parameter name and its value.

<EventRequest> CompanyName

Specifies the company name and must match a company name in the COMPANY_MASTER table in the Connect database. Mandatory

Id

The unique value for an event request. If an ID is repeated in an event request, it is discarded by Connect as a duplicate. Optional.

An EventRequest has zero or one <customer> element.

An EventRequest has zero or one <Event> element.

<EventResponse>   Contains the response for an <EventRequest>.
<EventStatus>   Provides the event status for a customer.
EventQueueId Event identification created for the customer by EVENT_QUEUE.event_queue_id.
<EventStatusRequest>   Event status request.
EventQueueId Identifies an event in the event queue.
<ExternalXML>  

Connect saves this entity as an XML blob. When Conversation Manager processes this event, it marks the email as having external XML. Mail Composer applies the XML to an XSL file specified in the campaign definition and creates the email content.

<kanaRoot>  

The Connect XML document root node.

<OriginalRequest>   When request processing fails, the response contains this element. This element includes the original Connect XML request.
<StatusCode>   Can be a child element of any Status element.
<StatusRequest> CompanyName See <EventRequest> for a definition.
<StatusResponse>   Contains the response for a <StatusRequest>.
<SubscriptionStatus>   Customer's subscription status .
EmailAddress See <Customer> for a description of this element.
CampaignName See <Event> for a description of this element.
<SubscriptionStatusRequest>   Request for the status of a customer’s subscription.
EmailAddress See <Customer> for a description of this element.
CampaignName See <Event> for a description of this element.