1

I'm receiving 400's when trying to set up a Data Extract Activity.

Request:

curl -v -X POST -H "Content-Type: text/xml" -H "SOAPAction: Create" -d "$(cat dataextract.txt)" "https://webservice.s6.exacttarget.com/Service.asmx"

The contents of dataextract.txt are:

<?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>
      <security xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
         <usernametoken>
            <username>jared@lytics.io</username>
            <password>#OUR_VALID_PASSWORD#</password>
         </usernametoken>
      </security>
   </header>
   <body>
      <extractrequestmsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
         <requests>
            <id>c7219016-a7f0-4c72-8657-1ec12c28a0db</id>
            <parameters>
               <parameter>
                  <name>StartDate</name>
                  <value>01/22/2015 12:00:00 AM</value>
               </parameter>
               <parameter>
                  <name>EndDate</name>
                  <value>01/23/2015 12:00:00 AM</value>
               </parameter>
               <parameter>
                  <name>OutputFileName</name>
                  <value>Example.zip</value>
               </parameter>
               <parameter>
                  <name>AccountIDs</name>
                  <value />
               </parameter>
               <parameter>
                  <name>Attributes</name>
                  <value />
               </parameter>
               <parameter>
                  <name>CharacterEncoding</name>
                  <value>Default</value>
               </parameter>
               <parameter>
                  <name>ColumnDelimiter</name>
                  <value>Default</value>
               </parameter>
               <parameter>
                  <name>EmailSendDefinitionExternalKey</name>
                  <value />
               </parameter>
               <parameter>
                  <name>ExtractAttributes</name>
                  <value>false</value>
               </parameter>
               <parameter>
                  <name>ExtractBounces</name>
                  <value>true</value>
               </parameter>
               <parameter>
                  <name>ExtractClickImpressions</name>
                  <value>false</value>
               </parameter>
               <parameter>
                  <name>ExtractClicks</name>
                  <value>true</value>
               </parameter>
               <parameter>
                  <name>ExtractConversions</name>
                  <value>true</value>
               </parameter>
               <parameter>
                  <name>extractListMembershipChanges</name>
                  <value>false</value>
               </parameter>
               <parameter>
                  <name>extractLists</name>
                  <value>false</value>
               </parameter>
               <parameter>
                  <name>ExtractNotSent</name>
                  <value>false</value>
               </parameter>
               <parameter>
                  <name>ExtractOpens</name>
                  <value>true</value>
               </parameter>
               <parameter>
                  <name>ExtractSendImpressions</name>
                  <value>false</value>
               </parameter>
               <parameter>
                  <name>ExtractSendJobImpressions</name>
                  <value>false</value>
               </parameter>
               <parameter>
                  <name>ExtractSendJobs</name>
                  <value>true</value>
               </parameter>
               <parameter>
                  <name>ExtractSent</name>
                  <value>true</value>
               </parameter>
               <parameter>
                  <name>extractStatusChanges</name>
                  <value>false</value>
               </parameter>
               <parameter>
                  <name>ExtractSubscribers</name>
                  <value>false</value>
               </parameter>
               <parameter>
                  <name>ExtractSurveyResponses</name>
                  <value>true</value>
               </parameter>
               <parameter>
                  <name>ExtractUnsubs</name>
                  <value>true</value>
               </parameter>
               <parameter>
                  <name>Format</name>
                  <value>csv</value>
               </parameter>
               <parameter>
                  <name>IncludeAllListMembers</name>
                  <value>false</value>
               </parameter>
               <parameter>
                  <name>IncludeAllSubscribers</name>
                  <value>false</value>
               </parameter>
               <parameter>
                  <name>IncludeInferredOpens</name>
                  <value>false</value>
               </parameter>
               <parameter>
                  <name>IncludeMilliseconds</name>
                  <value>false</value>
               </parameter>
               <parameter>
                  <name>IncludeTestSends</name>
                  <value>true</value>
               </parameter>
               <parameter>
                  <name>IncludeUnsubReason</name>
                  <value>false</value>
               </parameter>
               <parameter>
                  <name>IncludeUserAgentInformation</name>
                  <value>false</value>
               </parameter>
               <parameter>
                  <name>QuoteText</name>
                  <value>false</value>
               </parameter>
               <parameter>
                  <name>SendIDs</name>
                  <value />
               </parameter>
               <parameter>
                  <name>TextQualifier</name>
                  <value />
               </parameter>
               <parameter>
                  <name>Timezone</name>
                  <value>1</value>
               </parameter>
               <parameter>
                  <name>UnicodeOutput</name>
                  <value>false</value>
               </parameter>
               <parameter>
                  <name>UseIDs</name>
                  <value>false</value>
               </parameter>
               <parameter>
                  <name>UseLocalTZinQuery</name>
                  <value>false</value>
               </parameter>
            </parameters>
         </requests>
      </extractrequestmsg>
   </body>
</envelope>

I have three questions about this...

  • How can I correct my API call?
  • Does creating a Data Extract also start it? (In the UI it's a separate step.)
  • How do I select which FTP site I'd like to send the file to?

Thank you!

0

You are getting a 400 because of the SOAPAction. You should be able to use SOAPAction: Extract -

curl -v -X POST -H "Content-Type: text/xml" -H "SOAPAction: Extract" -d "$(cat dataextract.txt)" "https://webservice.s6.exacttarget.com/Service.asmx"

This will perform the data extract, and create a file on the EFTP server. If you need to transfer the file, you follow this call with a FileTransferActivity to move from one location to another, and specify the location there.

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.