Follow

Code Examples

The XML FTP API requires two separate files to execute the commands.    The following example provides basic contents for each file.  

File Examples

The following XML sample demonstrates a request to send email to a Subscriber using list id ‘123’ and template id ‘456’.  In the example the realm is ‘myrealm’ and its password is ‘mypass’.  At the completion of processing a confirmation message will be sent to ‘mymail@ domain.com’.

XML Data File (name: myrealm_201205.xml)

The Data File contains the Header and the Commands to run.  It must be saved with a .xml extension, for example myrealm_201205.xml:

<?xml version="1.0" encoding="UTF-8"?>
<transaction>
  <realm>myrealm</realm>
  <password>mypass</password>
  <confirmation_email>mymail@domain.com</confirmation_email>

  <!--  BEGIN BODY OF COMMANDS  -->
  <command>
    <!--  BEGIN SEND ONE-OFF MESSAGE -->
    <type>send</type>
    <list_id>123</list_id>
    <template_id>456</template_id>
    <campaign>
      <name>123 One_Off</name>
    </campaign>
    <!--  BEGIN SUBSCRIBER RECORD  -->

    <record>
      <!--  BEGIN SUBSCRIBER DATA  -->
      <email>mary@domain.com</email>
      <first>Mary</first>
      <last>Richards</last>
      <custom_age>39</custom_age>
      <format>HTML</format>
      <!--  END SUBSCRIBER DATA  -->

      <!--  BEGIN REPEATING DATA -->
      <items name="duties">
        <row>
          <column name="duty">Copy writing</column>
          <column name="description">
            <![CDATA[
            <li>Edit the news
            <li>Prepare the weather for Ted
            <li>Review Mr. Grant's changes
            ]]>
          </column>
        </row>
        <row>
          <column name="duty">Story selection</column>
          <column name="description">
            <![CDATA[
            <li>Review current news
            <li>Talk with city officials
            <li>Bounce ideas off Rhoda
            ]]>
          </column>
        </row>
      </items>
      <!--  END REPEATING DATA -->
    </record>
    <!--  END SUBSCRIBER RECORD  -->
    <!--  END SEND ONE-OFF MESSAGE  -->
  </command>
  <!--  END BODY OF COMMANDS  -->
</transaction>
 

Signal File (name: myrealm_201205.sig)

The Signal File should be empty.  It must be named the same as the Data file, but be save with the extention .sig, for example  myrealm_201205.sig:

<Empty File>

XML Schema Template

Use the following as a template for your .xml file.

<?xml version="1.0" encoding="utf-8"?>
<transaction>
<!--  BEGIN TRANSACTION DATA  -->
  <realm></realm>
  <password></password>
  <confirmation_email></confirmation_email>
  <optout>1</optout>
  <universal>0</universal>
  <force_subscribe>0</force_subscribe>
<!--  END TRANSACTION DATA  -->
<!--  BEGIN COMMAND BLOCK: SEND -->
  <command>
    <type>send</type>
    <list_id></list_id>
    <template_id></template_id>
    <campaign>
      <name></name>
    </campaign>
    <realm></realm>
      <sender></sender>
    <record>
      <first></first>
      <last></last>
      <email></email>
      ...
      <custom_></custom_>
      ...
      <format></format>
      <custom_Friendly_From></custom_Friendly_From>
      <custom_From_Email_Address></custom_From_Email_Address>
      <items name="">
        <row>
          <column name=""></column>
        </row>
      </items>
    </record>
  </command>
<!--  END COMMAND BLOCK: SEND -->
<!--  BEGIN COMMAND BLOCK: LAUNCH -->
  <command>
    <type>launch</type>
    <list_id></list_id>
    <segmentation_id></segmentation_id>
    <template_id></template_id>
    <subject></subject>
    <realm></realm>
    <format></format>
    <campaign_alias></campaign_alias>
    <target_rss></target_rss>
    <notify_email></notify_email>
  </command>
<!--  END COMMAND BLOCK: LAUNCH -->
</transaction>
 

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

Powered by Zendesk