0

I am trying to add a Subscriber to an Auto suppression list using SOAP API. Here is the envelope I am using :

<?xml version="1.0" encoding="UTF-8"?>
<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:MessageID>urn:uuid:7e0cca04-57bd-4481-864c-6ea8039d2ea0</a:MessageID>
      <a:ReplyTo>
         <a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address>
      </a:ReplyTo>
      <a:To s:mustUnderstand="1">{{soapEndPoint}}</a:To>
      <o:Security xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" s:mustUnderstand="1">
         <o:UsernameToken>
            <o:Username>{{soapUsername}}</o:Username>
            <o:Password><![CDATA[{{soapPassword}}]]></o:Password>
         </o:UsernameToken>
      </o:Security>
   </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">
        <Options>
        </Options>
            <Objects xsi:type="DataExtensionObject">
                <CustomerKey>REC5_AG_85</CustomerKey>
            <Properties>
               <Property>
                  <Name>Email Address</Name>
                  <Value>eljazouli@dd.fr</Value>
               </Property>
            </Properties>
            </Objects>
        </CreateRequest>
    </s:Body>
</s:Envelope>

But I receive an error Unable to retrieve Data Extension using CustomerKey

At the same time, I am using WSProxy methods in SSJS to add/remove subscribers to the Auto Supression List witn the same CustumerKey and It is working just fine.

Here is the example of SSJS code that deletes a Subscriber

<script type="javascript" runat="server">

Platform.Load("core","1.1.5");


 var api = new Script.Util.WSProxy();

    /* Build DE Object */
    var deleteObject = {
        CustomerKey: 'REC5_AG_85',
        Keys: [
             {
                Name: 'Email Address',
                Value: 'kkk@dd.fr'
            }
        ]
    };


    var res = api.deleteItem('DataExtensionObject', deleteObject);
</script>

Am I missing something ?

2
1

Your SOAP request envelope looks OK to me. The only issue that I can think of is that you have multiple business units on your account. If this is the case, then you will need to define the MID of the BU containing the Auto-suppression list as a Client ID.

Also, I would recommend you consider replacing the legacy Basic Auth username/password with OAuth (which trumps Basic Auth on so many levels).

A sample request is provided below (which I've tested). Replace 12345678 with the MID of the Business Unit where your auto-suppression list exists.

POST {{soapEndpoint}}
Content-Type: text/xml

<?xml version="1.0" encoding="UTF-8"?>
<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:MessageID>urn:uuid:7e0cca04-57bd-4481-864c-6ea8039d2ea0</a:MessageID>
      <a:ReplyTo>
         <a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address>
      </a:ReplyTo>
      <a:To s:mustUnderstand="1">{{soapEndpoint}}</a:To>
      <fueloauth xmlns="http://exacttarget.com">{{accessToken}}</fueloauth>
   </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="DataExtensionObject">
            <Client>
               <ID>12345678</ID>
            </Client>
            <PartnerKey xsi:nil="true"/>
            <ObjectID xsi:nil="true"/>
            <CustomerKey>REC5_AG_85</CustomerKey>
            <Properties>
               <Property>
                  <Name>Email Address</Name>
                  <Value>sam@sample.com</Value>
               </Property>
            </Properties>
         </Objects>
      </CreateRequest>
   </s:Body>
</s:Envelope>
2
  • Thanks Eliott ! By the way, this feature is not available with field level encryption. I tested in another account and it worked.
    – zeljazouli
    Jul 31 '18 at 14:29
  • That's good to know, thanks for the additional information. Jul 31 '18 at 16:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.