Template API

Easily Create Emails With Our Flexible API

CreateTemplate()

Use this method to create a new template.

  • apiKey (Required)

Your application authentication key. To get yours, click here.

  • name (Required)

Name of the template to be created.

  • subject (Required)

Subject line of the new template.

  • htmlbody (Required)

Html body of the new template.

  • textbody (Required)

Plain text body of the new template.

On success, this method returns a “success” response (code 0). Also unique ID of the newly created template will be provided in template_id field. On failure, an error code with description will be returned.


<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <CreateTemplate xmlns="http://api.directiq.com/">
      <apiKey>string</apiKey>
      <name>string</name>
      <subject>string</subject>
      <htmlbody>string</htmlbody>
      <textbody>string</textbody>
    </CreateTemplate>
  </soap:Body>
</soap:Envelope>


<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <CreateTemplateResponse xmlns="http://api.directiq.com/">
      <CreateTemplateResult>
        <success>boolean</success>
        <lastErr>string</lastErr>
        <errCode>int</errCode>
        <template_id>int</template_id>
      </CreateTemplateResult>
    </CreateTemplateResponse>
  </soap:Body>
</soap:Envelope>

GetTemplates()

Use this method to get a list of your email templates.

  • apiKey (Required)

Your application authentication key. To get yours, click here.

On success, this method returns the following information: template_id : unique ID of the template template_name : name of the template template_lastupdate : last update date of the template On failure, this method returns an error code and a description.


<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <GetTemplates xmlns="http://api.directiq.com/">
      <apiKey>string</apiKey>
    </GetTemplates>
  </soap:Body>
</soap:Envelope>


<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <GetTemplatesResponse xmlns="http://api.directiq.com/">
      <GetTemplatesResult>
        <success>boolean</success>
        <lastErr>string</lastErr>
        <errCode>int</errCode>
        <returnedLists>
          <getTemplateItem>
            <template_id>int</template_id>
            <template_name>string</template_name>
            <template_lastupdate>dateTime</template_lastupdate>
          </getTemplateItem>
          <getTemplateItem>
            <template_id>int</template_id>
            <template_name>string</template_name>
            <template_lastupdate>dateTime</template_lastupdate>
          </getTemplateItem>
        </returnedLists>
      </GetTemplatesResult>
    </GetTemplatesResponse>
  </soap:Body>
</soap:Envelope>