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.