2

I am trying to GET all Automations within a Marketing Cloud Environment by using a SimpleOperator on the Status field. The reason I am going through the trouble of adding a SimpleOperator Filter is due to the MC SOAP API requiring it in order to access the object.

Also to note in the Documentation: The only supported operators for the Automation object are: IN, EQUALS. Complex filter is not supported.

This is my Payload Request:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
   <s:Header>
        <fueloauth>{{accessToken}}</fueloauth>
   </s:Header>
   <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <RetrieveRequestMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
         <RetrieveRequest>
            <ObjectType>Automation</ObjectType>
            <Properties>ProgramID</Properties>
            <Properties>Name</Properties>
            <Properties>Description</Properties>
            <Properties>RecurrenceID</Properties>
            <Properties>CustomerKey</Properties>
            <Properties>IsActive</Properties>
            <Properties>CreatedDate</Properties>
            <Properties>ModifiedDate</Properties>
            <Properties>Status</Properties>
            <QueryAllAccounts>true</QueryAllAccounts>
             <Filter xsi:type="ns1:SimpleFilterPart" xmlns:ns1="http://exacttarget.com/wsdl/partnerAPI">
               <Property>Status</Property>
               <SimpleOperator>IN</SimpleOperator>
               <Value>1,2,3,4,5,6,7,8</Value>
            </Filter> 
         </RetrieveRequest>
      </RetrieveRequestMsg>
   </s:Body>
</s:Envelope>

The common error occuring is: "Error Message: No Rows were Found"

If I change it so that the Value = <Value>2</Value> I get results.

If I change the value so that it = <Value>5</Value> I get results... (can confirm that there are records that would meet the criteria)

This is what I have tried:

<Value>1,2,3,4,5,6,7,8</Value>
<Value>"1","2","3","4","5","6","7","8"</Value>
<Value>["1","2","3","4","5","6","7","8"]</Value>
<Value>("1","2","3","4","5","6","7","8")</Value>
  • Single Quote Marks produce a Syntax Error

How do I format the "Value" tag to retrieve all records?

1

SOLVED! (with a little help from luck!)

Most Important bit of Code below is the "FILTER". In order to grab all Automations from a Business Unit I needed a way to identify all of them. Since there are only 2 supported Operators (IN & Equals) for this Object, I used the "Status" attribute and added in all available status values.

Available Status Values:

-1 = (Program Errored Out)
0 = (Program Errored out during building)
1 = (Program building with activities, schedules, and other elements)
2 = (Program ready to start)
3 = (Program running)
4 = (Program paused from running state)
5 = (Program stopped)
6 = (Program scheduled)
7 = (Program waiting for a trigger)
8 = (Program trigger inactive)

Successful Payload:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
   <s:Header>
        <fueloauth>{{accessToken}}</fueloauth>
   </s:Header>
   <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <RetrieveRequestMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
         <RetrieveRequest>
            <ClientIDs>
                <ID>MID_OF_BUSINESS_UNIT</ID>
            </ClientIDs>
            <ObjectType>Automation</ObjectType>
            <Properties>ProgramID</Properties>
            <Properties>Name</Properties>
            <Properties>Description</Properties>
            <Properties>RecurrenceID</Properties>
            <Properties>CustomerKey</Properties>
            <Properties>IsActive</Properties>
            <Properties>CreatedDate</Properties>
            <Properties>ModifiedDate</Properties>
            <Properties>Status</Properties>
             <Filter xsi:type="ns1:SimpleFilterPart" xmlns:ns1="http://exacttarget.com/wsdl/partnerAPI">
                <Property>Status</Property>
                <SimpleOperator>IN</SimpleOperator>
                    <Value>-1</Value>
                    <Value>0</Value>
                    <Value>1</Value>
                    <Value>2</Value>
                    <Value>3</Value>
                    <Value>4</Value>
                    <Value>5</Value>
                    <Value>6</Value>
                    <Value>7</Value>
                    <Value>8</Value>
            </Filter> 
         </RetrieveRequest>
      </RetrieveRequestMsg>
   </s:Body>
</s:Envelope>

Cheers!

0

You can use the BETWEEN simple operator for values between 1 and 8 or greaterThan and lessThan. All are valid values for SimpleOperators under simple filter part.

<RightOperand xsi:type="SimpleFilterPart">
    <Property>Status</Property>
    <SimpleOperator>greaterThan</SimpleOperator>
    <Value>1</Value>
</RightOperand>

<RightOperand xsi:type="SimpleFilterPart">
    <Property>Status</Property>
    <SimpleOperator>lessThan</SimpleOperator>
    <Value>8</Value>
</RightOperand>
  • Hi Jackson, Thanks for the comment. When Posting to the ObjectType=Automation the documentation states that only "IN OR EQUALS" SimpleOperators are the only supported operators. (It also states ComplexFilters are also not supported) developer.salesforce.com/docs/… – Tim Greenwood Mar 31 at 0:27

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.