3

I am getting a timeout when trying to retrieve the status of a Query Activity. I have followed the SOAP example here: http://help.exacttarget.com/en-US/technical_library/web_service_guide/technical_articles/performing_a_query_activity_using_the_soap_web_service_api/#section_5

Here is an example of my SOAP call. I am using the TaskID returned by the API after starting the query. My timeout is set to 90 seconds.

<ns1:Body>
  <ns0:RetrieveRequestMsg>
     <ns0:RetrieveRequest>
        <ns0:ObjectType>AsyncActivityStatus</ns0:ObjectType>
        <ns0:Properties>Status</ns0:Properties>
        <ns0:Properties>StatusMessage</ns0:Properties>
        <ns0:Properties>TaskID</ns0:Properties>
        <ns0:Filter xsi:type="ns0:SimpleFilterPart">
           <ns0:Property>TaskID</ns0:Property>
           <ns0:SimpleOperator>equals</ns0:SimpleOperator>
           <ns0:Value>13646734</ns0:Value>
        </ns0:Filter>
     </ns0:RetrieveRequest>
  </ns0:RetrieveRequestMsg>

For reference here is the response XML after starting the query via the API, so you can see where I am getting the TaskID.

<soap:Body>
  <PerformResponseMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
     <Results>
        <Result>
           <StatusCode>OK</StatusCode>
           <StatusMessage>QueryDefinition perform called successfully</StatusMessage>
           <Object xsi:type="QueryDefinition">
              <PartnerKey xsi:nil="true" />
              <ObjectID>b001ea05-e93b-4ab8-88b7-06f7a48292ee</ObjectID>
           </Object>
           <Task>
              <StatusCode>OK</StatusCode>
              <StatusMessage>OK</StatusMessage>
              <ID>13646734</ID>
              <InteractionObjectID>abe92d6d-38a6-4ea9-a84f-18b6b6335eb4</InteractionObjectID>
           </Task>
        </Result>
     </Results>
     <OverallStatus>OK</OverallStatus>
     <OverallStatusMessage />
     <RequestID>6bc2105b-b9a5-4173-89c0-c131ef6a8878</RequestID>
  </PerformResponseMsg>

1
  • Do you have the error log print out? Jan 21, 2014 at 11:41

2 Answers 2

3

I was able to get the results back by adding in StartDate as a filter option. This was based on a response from ExactTarget's support team:

The issue here is that you're trying to filter on the InteractionID against the AsyncActivityStatus object. The AsyncActivityStatus is a special type of object and doesn't play by the same rules as other objects. For example, with this object, you can only filter on ParentInteractionID, TaskID, StartTime, and EndTime.

Here is the updated SOAP call I used that ran successfully:

<ns0:RetrieveRequestMsg>
  <ns0:RetrieveRequest>
    <ns0:ObjectType>AsyncActivityStatus</ns0:ObjectType>
    <ns0:Properties>Status</ns0:Properties>
    <ns0:Properties>TaskID</ns0:Properties>
    <ns0:Properties>StatusMessage</ns0:Properties>
    <ns0:Filter xsi:type="ns0:ComplexFilterPart">
      <ns0:LeftOperand xsi:type="ns0:SimpleFilterPart">
        <ns0:Property>TaskID</ns0:Property>
        <ns0:SimpleOperator>equals</ns0:SimpleOperator>
        <ns0:Value>14307763</ns0:Value>
      </ns0:LeftOperand>
      <ns0:LogicalOperator>AND</ns0:LogicalOperator>
      <ns0:RightOperand xsi:type="ns0:SimpleFilterPart">
        <ns0:Property>StartTime</ns0:Property>
        <ns0:SimpleOperator>greaterThan</ns0:SimpleOperator>
        <ns0:Value>2014-03-09</ns0:Value>
      </ns0:RightOperand>
    </ns0:Filter>
  </ns0:RetrieveRequest>
</ns0:RetrieveRequestMsg>

Here is the response I received stating the query had completed.

<RetrieveResponseMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
  <OverallStatus>OK</OverallStatus>
  <RequestID>c20413b5-5a05-4fe9-a4b2-0cddb1071d7d</RequestID>
  <Results xsi:type="ObjectExtension">
    <PartnerKey xsi:nil="true" />
    <ObjectID xsi:nil="true" />
    <Type>AsyncActivityStatus</Type>
    <Properties>
      <Property>
        <Name>TaskID</Name>
        <Value>14307763</Value>
      </Property>
      <Property>
        <Name>Status</Name>
        <Value>Complete</Value>
      </Property>
      <Property>
        <Name>StatusMessage</Name>
        <Value>QueryDefinition perform called successfully</Value>
      </Property>
    </Properties>
  </Results>
</RetrieveResponseMsg>
1

I noticed it did take a rather long time when only filtering by TaskID but if you also filter on Interaction then it comes back much quicker:

<ns0:RetrieveRequestMsg>
    <ns0:RetrieveRequest>
        <ns0:ObjectType>AsyncActivityStatus</ns0:ObjectType>
        <ns0:Properties>Status</ns0:Properties>
        <ns0:Properties>StatusMessage</ns0:Properties>
        <ns0:Properties>TaskID</ns0:Properties>
        <ns0:Filter xsi:type="ns0:ComplexFilterPart">
            <ns0:LeftOperand xsi:type="ns0:SimpleFilterPart">
                <ns0:Property>TaskID</ns0:Property>
                <ns0:SimpleOperator>equals</ns0:SimpleOperator>
                <ns0:Value>13646734</ns0:Value>
            </ns0:LeftOperand>
            <ns0:LogicalOperator>AND</ns0:LogicalOperator>
            <ns0:RightOperand xsi:type="ns0:SimpleFilterPart">
                <ns0:Property>InteractionID</ns0:Property>
                <ns0:SimpleOperator>equals</ns0:SimpleOperator>
                <ns0:Value>abe92d6d-38a6-4ea9-a84f-18b6b6335eb4</ns0:Value>
            </ns0:RightOperand>
        </ns0:Filter>
    </ns0:RetrieveRequest>
</ns0:RetrieveRequestMsg>
5
  • Welcome to SFSE @mac Jan 21, 2014 at 14:53
  • @Mac what kind of response times are you seeing? I'm still getting timeouts, even with timeout set to 1000 seconds (~16 mins). I am using Python and Suds.
    – Jon Sakas
    Jan 21, 2014 at 18:21
  • I was able to get it to come back sub-second. How long ago did you start the QueryDefinition where you got the TaskID and InteractionID from? If you are using old values from a couple days ago, try starting a new one. The Retrieve on AsyncActivityStatus is much quicker when dealing with recent data.
    – Mac
    Jan 21, 2014 at 23:01
  • I am calling it immediately after I get the success response from performing the QueryDefinition.
    – Jon Sakas
    Jan 27, 2014 at 18:35
  • ET Support has responded letting me know you cannot filter based on InteractionID. See my answer below.
    – Jon Sakas
    Mar 10, 2014 at 18:21

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.