3

I am trying to access email objects defined within a folder using the soap API but I get an empty response. I have tried using a simple filter on the CategoryID with no success. Has anyone successfully done this in the past? Below is a sample soap envelope for my request.

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <SOAP-ENV:Header>
      <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
         <wsse:UsernameToken>
            <wsse:Username>*</wsse:Username>
            <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">*</wsse:Password>
         </wsse:UsernameToken>
      </wsse:Security>
   </SOAP-ENV:Header>
   <SOAP-ENV:Body>
      <Client><ClientID>place_holder</ClientID></Client>
      <RetrieveRequestMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
         <RetrieveRequest>
            <ObjectType>Email</ObjectType>
            <Properties>ID</Properties>
            <Properties>CustomerKey</Properties>
            <Properties>Name</Properties>
            <Filter xsi:type="SimpleFilterPart">
               <Property>CategoryID</Property>
               <SimpleOperator>equals</SimpleOperator>
               <Value>place_holder</Value>
            </Filter>
         </RetrieveRequest>
      </RetrieveRequestMsg>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
0

The following request will retrieve all emails contained in a folder named 'place_holder' and return the email ID, name and subject line in the response.

<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soapenv:Header>
      <wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
         <wsse:UsernameToken wsu:Id="UsernameToken-32259181" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
            <wsse:Username>username</wsse:Username>
            <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">password</wsse:Password>
         </wsse:UsernameToken>
      </wsse:Security>
   </soapenv:Header>
   <soapenv:Body>
      <RetrieveRequestMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
         <RetrieveRequest>
            <ObjectType>Email</ObjectType>
            <Properties>ID</Properties>
            <Properties>Name</Properties>
            <Properties>Subject</Properties>
            <Filter xsi:type="SimpleFilterPart">
                <Property>Email.Folder</Property>
                <SimpleOperator>equals</SimpleOperator>
                <Value>place_holder</Value>
            </Filter>
         </RetrieveRequest>
      </RetrieveRequestMsg>
   </soapenv:Body>
</soapenv:Envelope>
  • Thanks for the prompt response @Eliot. This doesn't seem to be helping either. Do you have any other ideas as to what might be wrong or any other suggestions on how to approach the problem? – bitmill Apr 10 '15 at 17:55
  • When you say it's not helping, do you get any response back? This request works for me. Perhaps it's the method you are using to make the request. Try saving this file as 'request.xml', update the username and password, then use curl (install it if you don't already have it) to make the request using the command curl -XPOST -H "Content-type: text/xml; charset=utf-8" -H "SOAPAction: Retrieve" -d @request.xml https://webservice.s6.exacttarget.com/Service.asmx — you will need to replace 's6' to the endpoint of your account. – Eliot Harper Apr 12 '15 at 22:58
0

Have you tried adding these to your call:

<QueryAllAccountsSpecified>true</QueryAllAccountsSpecified>
<QueryAllAccounts>true</QueryAllAccounts>

These helped me get content back in the response from Marketing Cloud.

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.