0

We are currently working on creating a user-initiated email send using the SOAP API. Our payload is functioning as expected, but we need assistance with the following:

  1. How can we add a data extension to exclude from this email send?

  2. How can we select multiple data extensions for sending this campaign?

    <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xs d"> <s:Header> <a:Action s:mustUnderstand="1">Create</a:Action> <a:To s:mustUnderstand="1">https://{{Subdomain}}.soap.marketingcloudapis.com/Service.asmx</a:To> {{auth token}} </s:Header> <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"> 514012455 esd_cust_key ESD Name ESD Description 258891 --> Default Commercial default --> EB45D75F-E151-444B-B1CA-BE9DAF078BC3 CustomObject 54592 </s:Body> </s:Envelope>

Any guidance or examples would be greatly appreciated. Thank you!

1 Answer 1

1

Excluding Data Extensions

To exclude a data extension from an email send, you need to specify the data extension in the exclusion list within your SOAP request. Here’s an example of how to structure your SOAP request to include an exclusion:

xml
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
  <s:Header>
    <a:Action s:mustUnderstand="1">Create</a:Action>
    <a:To s:mustUnderstand="1">https://{{Subdomain}}.soap.marketingcloudapis.com/Service.asmx</a:To>
    {{auth token}}
  </s:Header>
  <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <CreateRequest xmlns="http://exacttarget.com/wsdl/partnerAPI">
      <Objects xsi:type="EmailSendDefinition">
        <CustomerKey>esd_cust_key</CustomerKey>
        <Name>ESD Name</Name>
        <Description>ESD Description</Description>
        <SendClassification>
          <CustomerKey>Default Commercial</CustomerKey>
        </SendClassification>
        <ExclusionFilter>
          <FilterDefinition>
            <DataSource>
              <CustomerKey>ExcludeDE</CustomerKey>
            </DataSource>
            <FilterPart>
              <SimpleFilterPart>
                <Property>EmailAddress</Property>
                <SimpleOperator>equals</SimpleOperator>
                <Value>[email protected]</Value>
              </SimpleFilterPart>
            </FilterPart>
          </FilterDefinition>
        </ExclusionFilter>
      </Objects>
    </CreateRequest>
  </s:Body>
</s:Envelope>

In this example, replace ExcludeDE with the CustomerKey of the data extension you want to exclude.

To select multiple data extensions for sending the campaign, you need to include each data extension in the SendDefinitionList within your SOAP request. Here’s an example:

xml
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
  <s:Header>
    <a:Action s:mustUnderstand="1">Create</a:Action>
    <a:To s:mustUnderstand="1">https://{{Subdomain}}.soap.marketingcloudapis.com/Service.asmx</a:To>
    {{auth token}}
  </s:Header>
  <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <CreateRequest xmlns="http://exacttarget.com/wsdl/partnerAPI">
      <Objects xsi:type="EmailSendDefinition">
        <CustomerKey>esd_cust_key</CustomerKey>
        <Name>ESD Name</Name>
        <Description>ESD Description</Description>
        <SendClassification>
          <CustomerKey>Default Commercial</CustomerKey>
        </SendClassification>
        <SendDefinitionList>
          <SendDefinitionListType>SourceList</SendDefinitionListType>
          <CustomerKey>DataExtension1</CustomerKey>
        </SendDefinitionList>
        <SendDefinitionList>
          <SendDefinitionListType>SourceList</SendDefinitionListType>
          <CustomerKey>DataExtension2</CustomerKey>
        </SendDefinitionList>
      </Objects>
    </CreateRequest>
  </s:Body>
</s:Envelope>

In this example, replace DataExtension1 and DataExtension2 with the CustomerKeys of the data extensions you want to include in the send.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .