bus_facade_campaign_filter


**Description :** Used in the management of filters applied to a contact list within the platform
**Default Methods** Please ensure you're familiar with... - [**Introduction to Beans**](/documentation/soap/gettingstarted/beans) - [**Requests and Responses**](/documentation/soap/gettingstarted/requests) - [**Anatomy of a session**](/documentation/soap/gettingstarted/session)

Example Process - Creating a Filter

[**WSDL**](http://paint.pure360.com/paint.pure360.com/ctrlPaint.wsdl) *Our WSDL defines our web service and where to locate our web service. In understanding these examples please familiarise yourself with the handleRequest (paintRequest / paintResponse)*
**Step 1 :** Begin by searching for the list entity to apply the filter to and obtain the listId... * Use the contextId to reference the current session in progress (generated during a login request - [bus_facade_context](/documentation/soap/gettingstarted/references/context) ) * To access the list entities use the campaign list entry point/gateway * Perform a search process with the writeable parameters that make up the list search process, ideally the name of the list. **Example Request / Response**
paintRequest:
contextId   string  :   C-KFDsCMMHXpDUi0ltN0p3FvF
className   string  :   bus_facade_campaign_list
processName string  :   search
entityData  array   :   'listName' => "Master List"
processData array   :   null
paintResponse:
Result   array :
         'result'     => "success"
		 'resultData' => array : 
		 'bus_search_campaign_list_' => array
                                        '...'    => '....'
										'idData' =>  array : 
              							            'listId' => 123456

**Step 2 :** Create an empty filter entity in the bean store loading the listId on to the entity, we want to store the beanId reference returned but also the keys to the associative array (map) filterItems, each of these keys is a filterItemId and will need to be referenced in populating these... * Use the contextId to reference the current session in progress (generated during a login request - [bus_facade_context](/documentation/soap/gettingstarted/references/context) ) * To access the filter entities use the campaign filter entry point / gateway. * Perform a create process with the listId entity field to generate the new filter entity bean in the bean store. **Example Request / Response:**
paintRequest:
contextId   string  :   C-KFDsCMMHXpDUi0ltN0p3FvF
className   string  :   bus_facade_campaign_filter
processName string  :  create
entityData  array   :  'listId' => "123456"
processData array   :	null
paintResponse:
Result   array :   
         'result'     => "success"
		 'resultData' => array : 
						'bus_entity_campaign_filter' => array :
                                           				 ... => ...
														 ...  variables  ...
          												 ... => ...
														 'filterItems' => array :
 																		  '_123548' => array :
										  								               'filterItemId' => "_123548"
																		  '_689565' => array : 
										   								 			   'filterItemId' => "_689565"
													     'beanId' => ID for new empty filter bean in bean store

**Step 3 :** Next, choose the writeable attributes, both required and optional and update the new filter entity bean in the bean store, where each array (map) in filterItems contains a filterItemId returned during the CREATE process. * Use the contextId to reference the current session in progress (generated during a login request - [bus_facade_context](/documentation/soap/gettingstarted/references/context) ) * To access the filter entities use the campaign filter entry point/gateway * Perform an update process with the writeable parameters that make up the filter creation process, and the bean id of the new bean entity in the bean store returned from the create request, plus any optional parameters. **Example Request / Response**
paintRequest:
contextId   string  :   C-KFDsCMMHXpDUi0ltN0p3FvF
className   string  :   bus_facade_campaign_filter
processName string  :   update
entityData  array   : 	 
			'beanId'  		=> ID of the empty bean returned during the create
            ... 			=> ...
			... Required & optional variables  ...
            ... 			=> ...
			'filterItems'   => array :
							   '0'   => array
                    					'filterItemId'     => "_123548"
                    					'fieldName'        => "__EMAIL__"
                    					'conditionType'    => "CONTAIN"
                    					'matchValue'       => "gmail",
processData array   :   null
paintResponse:
Result   array :
         'result' 	  => "success"
		 'resultData' => array :
          				 'bus_entity_campaign_filterKey' => ""
            			 'filterId' => 99587
            			 'beanName' => "bus_entity_campaign_filter"

**Step 4 :** Finally complete a store request with the bean id of the new entity in the bean store to write this back to the platform and remove the bean from the bean store... * Use the contextId to reference the current session in progress (generated during a login request - [bus_facade_context](/documentation/soap/gettingstarted/references/context) ) * To access the filter entities use the campaign filter entry point/gateway * Perform a store process with the entity data parameter as the bean id of the new entity that has been created and updated. **Example Request / Response**
paintRequest:
contextId   string  :   C-KFDsCMMHXpDUi0ltN0p3FvF
className   string  :   bus_facade_campaign_filter
processName string  :   store
entityData  array   :   'beanId'  => ID of the newly created, updated entity bean in the bean store 
processData array   :   null
paintResponse:
Result   array :
      	 'result' => "success"

bus_entity_campaign_filter

Writeable Variables : STORE / UPDATE (Required)

Name Example Description
filterItems
array(
  array(
    "fieldName" =>  "__EMAIL__",
    "conditionType"  => "CONTAIN",
    "matchValue" => "pure360",
    "filterItemId" => "_123468"
  )
)
Use this variable as the array of filter items for this filter. Each filter item is an associative array containing the name of the filter, the type of condition and the match value. With field names in the filter items custom fields are referred to by their custom field index in the parent list, i.e. field_#_data where # is the custom field index. The usable system fields are:
  • __EMAIL__, __MOBILE__
  • __DEVICE_TYPE__, __DEVICE_OS__, __DEVICE_BROWSER__
  • __LAST_OPENED_DATE__, __LAST_CLICKED_DATE__
  • __DAYS_SINCE_SIGNUP__, __DATE_OF_SIGNUP__
The condition type is one of the following reserved for non date fields:
  • EQUAL, NOT_EQUAL
  • CONTAIN, NOT_CONTAIN
  • IN, NOT_IN
  • BEGIN_WITH, NOT_BEGIN_WITH
  • END_WITH, NOT_END_WITH
  • GREATER_THAN, LESS_THAN
  • EMPTY, NOT_EMPTY
For date fields:
  • TODAY, BEFORE_TODAY, AFTER_TODAY
  • DAYS_BEFORE_TODAY, DAYS_AFTER_TODAY
  • WEEKS_BEFORE_TODAY, WEEKS_AFTER_TODAY
  • MONTHS_BEFORE_TODAY, MONTHS_AFTER_TODAY
  • LESS_THAN_DAYS_OLD, LESS_THAN_WEEKS_OLD
  • LESS_THAN_MONTHS_OLD, MORE_THAN_DAYS_OLD
  • MORE_THAN_WEEKS_OLD, MORE_THAN_MONTHS_OLD
  • ANNUALLY_ROLLING
  • EMPTY, NOT_EMPTY
The match value is only applicable to conditions that require this, for instance __DATE_OF_SIGNUP__ -> DAYS_BEFORE_TODAY -> 5 where 5 is the match value. The filterItemId is generated during creating a new filter entity bean (please see the example at the top of the page).
filterName_base64
"T25seV9QdXJlMzYwX0FkZHJlc3Nlcw=="
The recommended way to send string data, base 64 encoded. This variable is the unique name of filter for use within the profile on the system
filterName
"Only_Pure360_Addresses"
If you are unable to base 64 encode strings then use this variable as the unique name of filter for use within the profile on the system
listId
123456
Unique identity of the list within the account that this filter is to be applied to.
matchAllInd
"Y"
Indicator as to whether all filter item rules must be matched or any of them must match

Read-Only Variables : CREATE / LOAD / RELOAD

Name Example Description
listId
123456
Unique identity of the list within the account that this filter applies to
filterId
99897
Unique identity of the filter within the account (not populated during a CREATE process)
filterCount
154
The amount of records that fall into this filter (not populated during a CREATE process)
amendedDtTm
"02/02/2014 00:00:00"
The last date the filter was amended on
amendedBy
"test.sys"
The last user that amended the filter
conditionList
array(
  "EQUAL"=>"equals"
)
An array (map) of all the condition types (as keys) and descriptions as values
fieldNameList
array(
  "field_1_data"=>
              "first_name"
    )
An array (map) of all the field names as the system sees them (represented as keys) and descriptions the user sees (as values). Custom fields are stored by their custom field index in the parent list, i.e. first_name in the list is the first custom field
pendingDeliveryInd
"Y"
Indicates if there is a pending delivery associated with this filter

bus_search_campaign_filter

Writeable Variables : SEARCH

Name Example Description
listId
254707
Loads the listId of a valid list on to the search bean, the IdData returned consists of a map of all the child filterIds associated with this list, ideal for loading and looping through all the filters on a spcecific list for updating, replacing or removing these
filterName
"Pure360 Addresses"
Loads the filterName of a valid filter on to the search bean, the IdData returned consists of a map, and a single filterId identified by the filterName