0

I am looking for documentation or an example for how to create a SOAP request for the following Automation Studio tasks:

  • Data Extract
  • SQL Query
  • Send Email
  • Transfer File

I've been able to work through creating send email task using example sample SOAP request documented here.

I have also attempted to request definition of tasks (from an existing Automation created in Automation Canvas) using the following SOAP envelope request. The issue is that the response does not include an ActivityObject element identifying the type of task.

<soap:Body>
  <RetrieveRequestMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
     <RetrieveRequest>
        <ObjectType>Automation</ObjectType>
        <Properties>ProgramID</Properties>
        <Properties>Name</Properties>
        <Properties>Description</Properties>
        <Properties>CustomerKey</Properties>
        <Properties>IsActive</Properties>
        <Properties>CreatedDate</Properties>
        <Properties>ModifiedDate</Properties>
        <Properties>Status</Properties>
        <Filter xsi:type="SimpleFilterPart">
           <Property>CustomerKey</Property>
           <SimpleOperator>equals</SimpleOperator>
           <Value>SOMEKEYHERE</Value>
        </Filter>
     </RetrieveRequest>
  </RetrieveRequestMsg>
</soap:Body>
  • I agree there need to be better automation studio examples. I'll see if I can track down any better information. – Kelly J Andrews Feb 23 '15 at 17:24
0

2 things:

  1. Data Extracts and File Transfer APIs are not exposed. So, you cannot create these from the API.
  2. The Query and SendEmail Objects can be found here. Note there are no examples here, and there are several different objects you will need to consider.

Good luck!

EDIT: In addition for some related examples, have a look at the technical articles.

  • thanks for the response, documentation here has example of EmailSendDefinition ActivityObject request. Issue that I am working through is about how to construct the ActivityObject requests for other tasks. For example how do you construct the ActivityObject request for doing a “SQL Query”? – mattcameron Feb 25 '15 at 3:10
  • @mattcameron did you ever figure this out? I, too, am interested in creating a SQL Query step in an Automation via the API, but the documentation is so unbelievable bad and incomplete, i'm left with trial and error for hours and hours. – EvilJordan Mar 21 '16 at 8:05
  • @EvilJordan no I didn't find solution for this. Very interested in any findings you are able to share. – mattcameron Mar 22 '16 at 22:49
  • @mattcameron I almost got it working completely. I'll add a new comment to this question so I can include code. – EvilJordan Mar 23 '16 at 5:09
0

I almost got this process working completely to create a SQL Query Activity within an Automation. Where this fails is "selecting" the actual query you want to use for the Step. Once this runs, I went in via the GUI, to the "Workflow" tab, picked the SQL Query Task that was created and manually clicked on the appropriate SQL Query Definition. Hit "Save", and you're good to go. Not ideal, but way further along than anything else I've been able to find. I welcome help to complete the process!

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://exacttarget.com/wsdl/partnerAPI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Body>
    <ns1:CreateRequest>
        <ns1:Options/>
        <ns1:Objects xsi:type="ns1:Automation">
            <ns1:Client>
                <ns1:ID>YOUR MID HERE</ns1:ID>
            </ns1:Client>
            <ns1:Name>Automation Name</ns1:Name>
            <ns1:Description>Automation Description</ns1:Description>
            <ns1:AutomationTasks>
                <ns1:AutomationTask>
                    <ns1:Name>Automation Task Annotations</ns1:Name>
                    <ns1:Activities>
                        <ns1:Activity>
                            <ns1:ObjectID>RANDOMLY GENERATED UUID</ns1:ObjectID>
                            <ns1:Name>Automation Activity Name</ns1:Name>
                            <ns1:IsActive>true</ns1:IsActive>
                            <ns1:ActivityObject xsi:type="ns1:QueryDefinition">
                                <ns1:ObjectID>SQL Query Definition Object ID</ns1:ObjectID>
                                <ns1:Name>SQL Query Definition Name</ns1:Name>
                            </ns1:ActivityObject>
                        </ns1:Activity>
                    </ns1:Activities>
                </ns1:AutomationTask>
            </ns1:AutomationTasks>
            <ns1:AutomationType>scheduled</ns1:AutomationType>
        </ns1:Objects>
    </ns1:CreateRequest>
</SOAP-ENV:Body>

You would think, this block:

<ns1:ActivityObject xsi:type="ns1:QueryDefinition">
    <ns1:ObjectID>SQL Query Definition Object ID</ns1:ObjectID>
    <ns1:Name>SQL Query Definition Name</ns1:Name>
</ns1:ActivityObject>

is where you use the same ObjectID that your already-created Query Definition owns. Unfortunately, that does absolutely nothing for you and you end up with the issue I described at the beginning.

It's also worth mentioning that any attempt to automate the Scheduling of an Automation via the API will fail (though the API will happily return a Success message), almost certainly because of the aforementioned issue with the SQL Query Definition not being selected. I discovered, with SFMC help, that unless an Automation is "complete," which includes have everything selected properly, even though there is no GUI feedback that something isn't right, one cannot add a schedule.

  • 1
    An update, almost a year later, not that anyone will see this, least of all anyone that actually works for SF or cares. Salesforce is a garbage company that ruins products and can't document or create products worth a damn. They ruined ExactTarget and will probably do the same with Demandware. Your support is garbage and your documentation is the worst in the industry. I have no idea how you've become as big as you have, and I hope you fail. For anyone considering using SF that stumbles upon this comment: Save yourself from the headaches and failures. STAY AWAY!! – EvilJordan Dec 12 '16 at 21:18

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.