0

I need to run query in Automation through soap api its Automation creating but Activity not Created when i click on that its showing Error like automation no longer exists this is my code

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
   <soapenv:Header>
      <wsse:Security soapenv:mustUnderstand="1">
         <wsse:UsernameToken>
            <wsse:Username>testuser@sfdc.com</wsse:Username>
            <wsse:Password>xxxxxxxx</wsse:Password>
         </wsse:UsernameToken>
      </wsse:Security>
   </soapenv:Header>
   <soapenv:Body>
      <CreateRequest xmlns="http://exacttarget.com/wsdl/partnerAPI">
         <Options/>
         <Objects xsi:type="Automation">
            <Client>
               <ID>7208433</ID>
            </Client>
            <Name>myautos</Name>
            <CustomerKey>7567544333</CustomerKey>
            <AutomationTasks>
               <AutomationTask>
                  <PartnerKey xsi:nil="true"/>
                  <ObjectID xsi:nil="true"/>
                  <Activities>
                     <Activity>
                        <PartnerKey xsi:nil="true"/>
                        <Name>Query</Name><!-- Name of Activity -->
                        <CustomerKey>5467777</CustomerKey>
                        <!--<Definition>
                           <PartnerKey xsi:nil="true"/>
                           <ObjectID xsi:nil="true"/>
                        </Definition>-->
                        <ActivityObject xsi:type="QueryDefinition">
                           <PartnerKey xsi:nil="true"/>
                           <CustomerKey>5467777</CustomerKey><!-- CustomerKey of Query -->
                           <Name>joinmultiple</Name><!-- Name of Query -->
                        </ActivityObject>
                     </Activity>
                  </Activities>
               </AutomationTask>
            </AutomationTasks>
            <AutomationType>Scheduled</AutomationType>
         </Objects>
      </CreateRequest>
   </soapenv:Body>
</soapenv:Envelope>
1

To perform Query Activity, you need to retrieve the ObjectID of the QueryDefinition first.

Check this Answer: Create and Perform a query with PHP SOAP API in ExactTarget

0

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.