Creating a FilterDefinition Object
Use the FilterDefinition object to separate out information for a data source, such as a subscriber list or a data extension. Use the sample code below as a model for creating your own API call.
All date values for a simple filter part must go into the DateValue collection.
The FilterDefinition object contains these properties.
ObjectIDA unique identifier for the property.
CustomerKeyA client-supplied identifier for the filter. This must be unique across all FilterDefinitions owned by the client.
NameA unique name for the filter. Don’t use the name for lookup purposes.
DescriptionA description of the filter.
DataSourceSpecifies whether the filter is list-based or data-extension-based. If the filter is based on a data extension, supply a DataExtension object. Otherwise, leave this value null and the filter uses profile attributes.
DataFilterThis property specifies the rules associated with the filter. You can include measures here.
| Data Type | Valid Values |
|---|---|
| Boolean | True or False |
| Date | ShortDate (date with no time) |
| List | Not supported |
| Numeric | Bigint |
| Data Type | Valid Values |
|---|---|
| Boolean | Equals |
| Date |
|
| List |
|
| Numeric |
|
| Text |
|
This code example creates a filter definition with a complex filter.
Using these criteria, the API performs the call on the test_subject_line data extension:
The update call supports both CustomerKey and ObjectID as identifiers to specify which FilterDefinition to update. The API requires both the DataExtension and DataFilter to update a FilterDefinition object.