1

I have a question on how to update Data Extract Activity using SOAP API. I found a document about the Supported Methods of SOAP API in Marketing Cloud: https://developer.salesforce.com/docs/atlas.en-us.noversion.mc-apis.meta/mc-apis/supported_operations_for_objects_and_methods.htm

I've noticed that Data Extract Activity is capable of using "UPDATE" Method but cannot find any example codes or reference regarding this matter. Does anyone know what properties I should use to make this SOAP API method work?

Thanks

4
  • What type of extract and what are you trying to update?
    – Macca
    Jun 9, 2020 at 5:43
  • I am trying to make an extract activity for data extension extract. At first, I was trying to create one but failed. After, I found out in above document that CREATE method isn't supported. So, I was wondering up to which properties UPDATE method is capable of manipulating to find out if UPDATE method is enough for me to replace CREATE method.
    – Jaewon Lee
    Jun 9, 2020 at 6:34
  • Are you trying to actually update an extract activity or just run a Data Extension extract activity dynamically... ie change define the the data extension to extract, file name, delimiter etc?
    – Macca
    Jun 9, 2020 at 8:46
  • I want to actually update an extract activity. I am curious if I can change Column Delimiter, DECustomer key, Has column headers, text qualified, users line feed, output filename pattern, or more.
    – Jaewon Lee
    Jun 9, 2020 at 9:02

1 Answer 1

3

I've never managed to do this with the SOAP API. However, you can hack the internal route pretty easily. Get the Data Extension Extract ID by inspecting the traffic in your browser while opening the Data Extract Activity in Automation Studio.

PATCH: {{tsRestEndpoint}}automation/v1/dataextracts/{{DataExtractId}}
{
  "name": "Test Extract",
  "key": "Test Extract",
  "description": "",
  "fileSpec": "myfilefoo.txt",
  "dataFields": [{
    "name": "ColumnDelimiter",
    "type": "string",
    "value": ","
  }, {
    "name": "DECustomerKey",
    "type": "string",
    "value": "8B1EBE01-4364-43FE-9407-A79E169546F5"
  }, {
    "name": "HasColumnHeaders",
    "type": "bool",
    "value": "True"
  }, {
    "name": "TextQualified",
    "type": "bool",
    "value": "True"
  }, {
    "name": "UsesLineFeed",
    "type": "bool",
    "value": "True"
  }],
  "dataExtractDefinitionId": {{DataExtractId}},
  "dataExtractTypeId": "bb94a04d-9632-4623-be47-daabc3f588a6",
  "createdBy": 111111111,
  "modifiedBy": 111111111,
  "intervalType": 0,
  "extractTypeName": "Data Extension Extract"
}

Standard REST authentication can be used to generate the bearer token and the solution comes without warranty.

If you just want to perform a Data Extract Activity using parameters you decide at runtime, the SOAP extract request may be what you actually need:

<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>
       <fueloauth>{{_token}}</fueloauth>
   </s:Header>
   <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <ExtractRequestMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
         <Requests>
            <ID>bb94a04d-9632-4623-be47-daabc3f588a6</ID>
            <Parameters>
               <Parameter>
                  <Name>DECustomerKey</Name>
                  <Value>8B1EBE01-4364-43FE-9407-A79E169546F5</Value>
               </Parameter>
               <Parameter>
                  <Name>HasColumnHeaders</Name>
                  <Value>true</Value>
               </Parameter>
               <Parameter>
                  <!--This parameter is required, always pass a value of 0-->
                  <Name>_AsyncID</Name>
                  <Value>0</Value>
               </Parameter>
               <Parameter>
                  <Name>OutputFileName</Name>
                  <Value>MyExtractFile.csv</Value>
               </Parameter>
               <Parameter>
                  <!--This parameter is required, always pass value shown below-->
                  <Name>StartDate</Name>
                  <Value>1/1/1900 1:00:00 AM</Value>
               </Parameter>
               <Parameter>
                  <!--This parameter is required, always pass value shown below-->
                  <Name>EndDate</Name>
                  <Value>1/1/1900 1:00:00 AM</Value>
               </Parameter>
            </Parameters>
         </Requests>
      </ExtractRequestMsg>
   </s:Body>
</s:Envelope>

You must log in to answer this question.

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