4

I am running into issues attempting to create an Email Send Definition which has a suppression list / OptOutList using the SFMC SOAP API. However, I am able to create send definitions with source and exclusion lists just fine.

I may be making a simple syntax error, but I wasn't able to find any examples in the documentation for creating send definitions with suppression lists, so can't be certain.

I am able to create a send definition with the same suppression list in the SFMC UI just fine, and am able to successfully send an email with it.

Below is the XML envelope I am sending to SFMC (with certain information redacted in curly braces):

<?xml version="1.0" encoding="UTF-8"?>
<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <Header>
      <fueloauth>{{SFMC_TOKEN}}</fueloauth>
   </Header>
   <Body>
      <CreateRequest xmlns="http://exacttarget.com/wsdl/partnerAPI">
         <Objects xsi:type="EmailSendDefinition">
            <Client>
               <ID>{{BUSINESS_UNIT}}</ID>
            </Client>
            <PartnerKey xsi:nil="true" />
            <CustomerKey>JustATest</CustomerKey>
            <Name>JustATest</Name>
            <Description />
            <CategoryID>{{CATEGORY_ID}}</CategoryID>
            <SendClassification>
               <PartnerKey xsi:nil="true" />
               <ObjectID xsi:nil="true" />
               <CustomerKey>Default Commercial</CustomerKey>
            </SendClassification>
            <SenderProfile>
               <PartnerKey xsi:nil="true" />
               <ObjectID xsi:nil="true" />
               <CustomerKey>Default</CustomerKey>
            </SenderProfile>
            <SuppressTracking>false</SuppressTracking>
            <IsSendLogging>true</IsSendLogging>
            <SendDefinitionList>
               <PartnerKey xsi:nil="true" />
               <List>
                  <PartnerKey xsi:nil="true" />
                  <ID>95</ID>
                  <ObjectID xsi:nil="true" />
               </List>
               <SendDefinitionListType>SourceList</SendDefinitionListType>
               <CustomObjectID>{{CUSTOM_OBJECT_ID}}</CustomObjectID>
               <DataSourceTypeID>CustomObject</DataSourceTypeID>
               <IsTestObject>false</IsTestObject>
               <SalesForceObjectID />
               <Name />
            </SendDefinitionList>
            <SendDefinitionList>
               <List>
                  <ID>1331</ID>
               </List>
               <SendDefinitionListType>OptOutList</SendDefinitionListType>
               <DataSourceTypeID>OptOutList</DataSourceTypeID>
               <IsTestObject>false</IsTestObject>
            </SendDefinitionList>
            <Email>
               <PartnerKey xsi:nil="true" />
               <ID>4586</ID>
               <ObjectID xsi:nil="true" />
            </Email>
            <BccEmail />
            <AutoBccEmail />
            <TestEmailAddr />
            <EmailSubject>The Subject Line</EmailSubject>
            <DynamicEmailSubject>The Subject Line</DynamicEmailSubject>
            <IsMultipart>false</IsMultipart>
            <IsWrapped>true</IsWrapped>
            <DeduplicateByEmail>false</DeduplicateByEmail>
            <ExclusionFilter />
            <Additional />
            <CCEmail />
         </Objects>
      </CreateRequest>
   </Body>
</Envelope>

The following is the error I get back from SFMC:

<StatusMessage>Exception occurred during [CreateEmailSendDefinition] ErrorID = 1126290906</StatusMessage>
<OrdinalID>0</OrdinalID>
<ErrorCode>9999999</ErrorCode>

If anyone can point out a mistake with the XML envelope above, or point me in the direction of an example of creating a send definition with a suppression list using the SOAP API, that would be great.

1
  • I believe 'OptOutList' type is for Publication Lists. Try the Type of 'ExclusionList'. Aug 23, 2019 at 19:16

1 Answer 1

1

I believe 'OptOutList' SendDefinitionListType is for Publication Lists. Try the Type of 'ExclusionList' (src)

enter image description here

As for DataSourceTypeID, it would depend on if its a real list or a DE as to what value you put in: (src)

enter image description here

Here is a sample of an exclusion list I have successfully used in some of my calls:

<SendDefinitionList> 
    <SendDefinitionListType>ExclusionList</SendDefinitionListType> 
    <CustomerKey>DE_ExtKey</CustomerKey>
    <DataSourceTypeID>CustomObject</DataSourceTypeID>
</SendDefinitionList>

This is adding in the DE with key of DE_ExtKey as an exclusion list inside of my send definition.

1
  • Thanks for the response - the issue is that when you create a Send Definition via the UI with a suppression list, and then read the send definition via the API using a RetrieveRequest with the SendDefinitionList property, both the SendDefinitionListType and DataSourceTypeID in the response are set to OptOutList. I tried the CreateRequest call again with SendDefinitionListType set to ExclusionList, and DataSourceTypeID set to List, as I am using a real list, but this just added the suppression list to Excluded Recipients, rather than as a suppression list. Aug 27, 2019 at 10:35

You must log in to answer this question.

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