Overview

Skill Level: Any

Prerequisites

This interface supports programmatically creating a query of a Watson Campaign Automation database. A query can search for values within database columns and also filter by mailing activity.

Step-by-step

  1. Syntax of the request and response SOAP for CreateQuery

    Operation  <CreateQuery>         
    Elements QUERY_NAME  The name of the new query.       
      PARENT_LIST_ID  The ID of the database being queried.       
      VISIBILITY 

    Defining the visibility of the new query. Valid values are:

    0 ‚Äď Private

    1 ‚Äď Shared

     

         
      PARENT_FOLDER_ID Optional  The ID of the folder within which to save the query. If not specified, it will be stored in the root of Shared or Private based on VISIBILITY.     
    ¬† SELECT_COLUMNS Optional¬† A pipe‚Äźseparated list of fields available for
    personalization. 
       
      ALLOW_FIELD_CHANGE  Optional 

    Defines whether to allow users to change the fields available for personalization when editing or creating a
    new query from this query. If not specified, the default will be 1 (Allow Changes).Valid values are:

    0 ‚Äď Do not allow changes

    1 ‚Äď Allow Changes

     

       
    Child
    Element
    CRITERIA  Describes the expressions to perform on one or more columns in the database.       
      Child Element TYPE  Optional 

    Specifies if criteria are locked or editable. Valid values
    are:

    Locked

    Editable

    If not specified, the default will be marked Editable.

     

     
        EXPRESSION  Describes a single expression to perform on a column. One or more EXPRESSION elements can exist within the CRITERIA element.     
        Child Element TYPE 

    The type of evaluation. Valid values are:

    NE ‚Äď Numeric

    DE ‚Äď Date/Time

    TE ‚Äď Text

     

     
          COLUMN_NAME The name of the database field.   
          OPERATORS 

    The operator used for comparison. Valid values are:

    !=

    <

    >

    =

    IS NOT null

    IS null

    LIKE

    NOT like

    IN

    NOT in

    BETWEEN

     

     
          VALUES  Optional  The value being compared to the Watson campaign Automation database field. This can include text or a numeric or date value. It can also include a list of values or the name of a Column. If specifying a Database Column, surround with square brackets, such as: [My Text Column]. If specifying a list of values, use the pipe character ( | ) to separate values
    in a list. Required for all operators other
    than IS NOT null and IS null. 
          LEFT_PARENS  Optional  Used to specify one or more left
    parentheses when relating more than one
    expression. For example, two left
    parentheses would be indicated as: (( 
          RIGHT_PARENS  Optional  Used to specify one or more right
    parentheses when relating more than one
    expression. For example, two right
    parentheses would be indicated as: )) 
          AND_OR  Optional  Used to specify AND or OR when relating
    multiple expressions. 
    Child
    Element 
    BEHAVIOR  Optional  Optional; defines the Behavior section of the query. Filters mailing contacts by their activity.     
      Child Element  OPTION_OPERATOR 

    Specifies the operation or activity for which you are searching. Valid
    values are:

    100 ‚Äď Opened

    101 ‚Äď Clicked

    102 ‚Äď Bounced

    103 ‚Äď No Activity

     

       
        TYPE_OPERATOR 

    Specifies whether to search a particular mailing (or all mailings) for
    the database. Valid values are:

    110 ‚Äď For Any Mailing (only available if query is on the database
    designated to store Automated Behavior Updates)

    111 ‚Äď For One Mailing

     

       
        MAILING_ID  Optional  The ID of the mailing within which to search for contact
    activity. 
     
        REPORT_ID  Optional  The Report ID that identifies the mailing instance within
    which to search for contact activity. 
     
        LINK_NAME  Optional  The name of a link in a mailing. Used to include only contacts who clicked on a particular link in a mailing.   
          WHERE_OPERATOR  Optional 

    Specifies whether to compare to an activity count, date of activity, or number of days since activity. Valid values
    are:

    120 ‚Äď Days Since Activity

    121 ‚Äď Activity Date

    122 ‚Äď Activity Count

    Only used when you specify For One Mailing and you do NOT include a No Activity parameter.

     

          CRITERIA_OPERATOR  Optional 

    The operator used for comparison. Required if
    WHERE_OPERATOR is included. Valid values are:

    !=

    <

    >

    =

    >=

    <=

    BETWEEN

     

          VALUES  Optional  The value you are comparing to the contact activity count, date of activity, or number of days since activity. Could be numeric or date value. If operator is BETWEEN, two values must be provided delimited by a pipe. Required if WHERE_OPERATOR is included. 
    Example¬† <soapenv:Envelope xmlns:soapenv=”http://schemas.xmlsoap.org/soap/envelope/”
    xmlns:ses=”SilverpopApi:EngageService.SessionHeader”
    xmlns:user=”SilverpopApi:EngageService.ListMgmt.UserActions”>
    <soapenv:Header>
    <ses:sessionHeader>
    <ses:sessionid>16FE7B75445E6C704707025B1B7BBEE5</ses:sessionid>
    </ses:sessionHeader>
    </soapenv:Header>
    <soapenv:Body>
    <user:CreateQuery>
    <user:QUERY_NAME>Test_Query</user:QUERY_NAME>
    <user:PARENT_LIST_ID>24872</user:PARENT_LIST_ID>
    <user:VISIBILITY>0</user:VISIBILITY>
    <user:ALLOW_FIELD_CHANGE>0</user:ALLOW_FIELD_CHANGE>
    <user:SELECT_COLUMNS>EMAIL|First_Name</user:SELECT_COLUMNS>
    <user:CRITERIA>
    <user:TYPE>editable</user:TYPE>
    <user:EXPRESSION>
    <user:TYPE>TE</user:TYPE>
    <user:COLUMN_NAME>EMAIL</user:COLUMN_NAME>
    <user:OPERATORS><![CDATA[LIKE]]></user:OPERATORS>
    <user:VALUES><![CDATA[gmail.com]]></user:VALUES>
    <user:LEFT_PARENS>(</user:LEFT_PARENS>
    </user:EXPRESSION>
    <user:EXPRESSION>
    <user:AND_OR>AND</user:AND_OR>
    <user:TYPE>TE</user:TYPE>
    <user:COLUMN_NAME>First_Name</user:COLUMN_NAME>
    <user:OPERATORS><![CDATA[IS null]]></user:OPERATORS>
    <user:RIGHT_PARENS>)</user:RIGHT_PARENS>
    <user:VALUES/>
    </user:EXPRESSION>
    </user:CRITERIA>
    </user:CreateQuery>
    </soapenv:Body>
    </soapenv:Envelope> 
           
    Response  <RESULT>         
    Elements  SUCCESS  TRUE if successful       
      ListId  The ID of the query that was created.       
    Example¬† <envelope:Envelope xmlns=”SilverpopApi:EngageService.ListMgmt.UserActions”
    xmlns:envelope=”http://schemas.xmlsoap.org/soap/envelope/”>
    <envelope:Header/>
    <envelope:Body>
    <RESULT>
    <SUCCESS>TRUE</SUCCESS>
    <ListId>7835478</ListId>
    </RESULT>
    </envelope:Body>
    </envelope:Envelope> 
           

Join The Discussion

Your email address will not be published. Required fields are marked *