2

I am looking for a way to use the Marketing Cloud API to activate an Automation in a manner that is equivalent to pressing the "Active" button in the UI (next to the "Paused" button).

Eliot Harper has provided great instructions for "Activating" an Automation here: https://github.com/sfmcdg/Salesforce-Marketing-Cloud-Developer-Edition-Recipes/blob/master/starting-an-automation.md#start-automation

However, Eliot explains that "This is equivalent to using the 'Run Once' button in Automation Studio to start an Automation."

Is there a process similar to what Eliot presents but that is equivalent to pressing "Active" instead?

0

After a lot of back and forth with Salesforce support, I was able to get this working. A couple notes:

  1. The ObjectID and CustomerKey are obtained through a separate SOAP call.

  2. For some reason, it seems it's necessary to specify the schedule in this call, even though the schedule was already specified when the automation was created.

  3. The SOAPAction to include in the header is Schedule.

  4. So far I have only been able to get this to work with a Schedule as a starting source, not with a File Drop.

Here is an example of a SOAP envelope that worked for me that is the equivalent of hitting Active rather than Run Once:

    <Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <Header>
                <fueloauth>API_TOKEN</fueloauth>
        </Header>
        <Body xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <ScheduleRequestMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
                <Options>
                    <ScheduledTime>2019-08-28T20:53:23.2236156-03:00</ScheduledTime>
                </Options>
                <Action>start</Action>
                <Schedule>
                    <PartnerKey xsi:nil="true" />
                    <ObjectID xsi:nil="true" />
                    <Recurrence xsi:type="HourlyRecurrence">
                        <HourlyRecurrencePatternType>Interval</HourlyRecurrencePatternType>
                        <HourInterval>1</HourInterval>
                    </Recurrence>
                    <RecurrenceType>Hourly</RecurrenceType>
                    <RecurrenceRangeType>EndOn</RecurrenceRangeType>
                    <StartDateTime>2019-08-28T20:53:23.2236156-03:00</StartDateTime>
                    <EndDateTime>2039-08-29T20:53:23.2236156-03:00</EndDateTime>
                    <TimeZone>
                        <PartnerKey xsi:nil="true" />
                        <ID>86</ID>
                        <ObjectID xsi:nil="true" />
                    </TimeZone>
                </Schedule>
                <Interactions>
                    <Interaction xsi:type="Automation">
                        <PartnerKey xsi:nil="true" />
                        <ObjectID>RETRIEVED_OBJECT_ID</ObjectID>
                        <CustomerKey>RETRIEVED_CUSTOMER_KEY</CustomerKey>
                    </Interaction>
                </Interactions>
            </ScheduleRequestMsg>
        </Body>
    </Envelope>
  • Did you ever get this to work with a file drop triggered Automation? – Brett Nov 29 '19 at 22:02
  • @Brett, sorry, no I didn't. – Rocky Dec 10 '19 at 12:42

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.