How to Activate a File Drop Automation via the API

I can create a file drop triggered automation through both SOAP and REST API’s but I cannot figure out how to switch them from “Inactive” to “Active”. Any help would be be greatly appreciate, thanks!

Answer

I have the same problem with a different type of automation (asked here), so I feel your pain. This probably won’t help you, but just in case: For the specific case of a file drop, if your application is dropping the file, it’s possible to create an import definition and perform it in a single SOAP call after the file has been placed in the FTP folder.

Here is an example of a payload we use for this purpose:

                 <Body>
                  <PerformRequestMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
                     <Action>start</Action>
                     <Definitions>
                        <Definition xsi:type="ImportDefinition" xmlns:ns1="http://exacttarget.com/wsdl/partnerAPI">
                           <Name>[IMPORT-NAME]</Name>
                           <Description></Description>
                           <AllowErrors>true</AllowErrors>
                           <SubscriberImportType>Email</SubscriberImportType>
                           <UpdateType>Overwrite</UpdateType>
                           <MaxFileAge>1</MaxFileAge>
                           <MaxFileAgeScheduleOffset>0</MaxFileAgeScheduleOffset>
                           <MaxImportFrequency>0</MaxImportFrequency>
                           <DestinationObject xsi:type="ns1:DataExtension">
                                <CustomerKey>[DE-EXTERNAL-KEY]</CustomerKey>
                                <ObjectID xsi:nil="true"/>
                           </DestinationObject>
                           <FieldMappingType>InferFromColumnHeadings</FieldMappingType>
                           <FileSpec>[FILENAME-INCLUDING-EXTENSION]</FileSpec>
                           <FileType>CSV</FileType>
                           <Notification>
                                <ResponseType>email</ResponseType>
                                <ResponseAddress>[EMAIL-ADDRESS-TO-SEND-NOTIFICATION]</ResponseAddress>
                           </Notification>
                           <RetrieveFileTransferLocation>
                                <CustomerKey>ExactTarget Enhanced FTP</CustomerKey>
                           </RetrieveFileTransferLocation>
                        </Definition>
                     </Definitions>
                  </PerformRequestMsg>
              </Body>

Good luck.

Attribution
Source : Link , Question Author : Brett , Answer Author : Rocky

Leave a Comment