Job definition reference
A JSON request body is required when creating a Data Repair API job. This page provides a full list of variables, actions, and filters that you can include to create a valid JSON request body.
data-variant=info
data-slots=text
Structure
A JSON request body consists of one or more variables with the desired action for each variable. You can also optionally include filters for a given variable.
{
"variables": {
"{VARIABLE_1}": {
"action": "{ACTION_1}"
},
"{VARIABLE_2}": {
"action": "{ACTION_2}",
"filter": {"condition": "{CONDITION_2}"}
},
"{VARIABLE_3}": {
"action": "{ACTION_3}",
"filters": [
{"condition": "{CONDITION_1}"},
{"condition": "{CONDITION_2}"}
]
}
}
}
Variables
The Data Repair API supports the following variables, with their supported actions.
- If a variable supports the
setaction, you can use any filter with it unless otherwise noted. - If a variable supports the
deleteaction, you can use any filter exceptisEmptywith it unless otherwise noted. - If a variable supports
deleteQueryStringordeleteQueryStringParameters, you cannot use any filters with either action.
activitymapdeletecampaignset<br/>delete<br/>deleteQueryString<br/>deleteQueryStringParametersentrypage<br/>set<br/>delete<br/>deleteQueryString<br/>deleteQueryStringParameterspage variable as well.entrypageoriginalset<br/>delete<br/>deleteQueryString<br/>deleteQueryStringParameterspage variable with similar modifications for consistency.evar1 - evar250set<br/>delete<br/>deleteQueryString<br/>deleteQueryStringParametersgeolatitude<br/>geolongitudedeleteinList.geozipdeletezip. The only supported filter is inList.ipaddressdeleteinList.latitude<br/>longitudedeleteinList.latlon1<br/>latlon23<br/>latlon45<br/>pointofinterest<br/>pointofinterestdistancedeletemobileappid<br/>mobilemessagebuttonname<br/>mobilemessageid<br/>mobilerelaunchcampaigncontent<br/>mobilerelaunchcampaignmedium<br/>mobilerelaunchcampaignsource<br/>mobilerelaunchcampaignterm<br/>mobilerelaunchcampaigntrackingcodeset<br/>delete<br/>deleteQueryString<br/>deleteQueryStringParametersdelete action with this variable, no filters are supported. Standard filters are supported when using the set action with this variable.pageset<br/>deleteQueryString<br/>deleteQueryStringParametersisEmpty filter is not supported. If you modify values in this variable, consider also making similar modifications to the entrypage and entrypageoriginal variables.pageeventvar1set<br/>deleteQueryString<br/>deleteQueryStringParameterslinkURL implementation variable. The isEmpty filter is not supported.pageeventvar2set<br/>deleteQueryString<br/>deleteQueryStringParametersisEmpty filter is not supported.pageurlfirsthit<br/>pageurlvisitstartdeleteQueryString<br/>deleteQueryStringParametersprop1 - prop75set<br/>delete<br/>deleteQueryString<br/>deleteQueryStringParametersreferrerfirsthit<br/>referrervisitdeleteQueryString<br/>deleteQueryStringParameterssitesectionsset<br/>delete<br/>deleteQueryString<br/>deleteQueryStringParametersvideo<br/>videoadset<br/>deleteQueryString<br/>deleteQueryStringParametersvideoadname<br/>videoadplayername<br/>videoadadvertiser<br/>videoaudioalbum<br/>videoaudioartist<br/>videoaudioauthor<br/>videoaudiolabel<br/>videoaudiopublisher<br/>videoaudiostation<br/>videoadcampaign<br/>videochannel<br/>videochapter<br/>videocontenttype<br/>videoepisode<br/>videofeedtype<br/>videomvpd<br/>videoname<br/>videonetwork<br/>videopath<br/>videoplayername<br/>videoseason<br/>videoshow<br/>videoshowtype<br/>videostreamtypeset<br/>delete<br/>deleteQueryString<br/>deleteQueryStringParameterszipdeletezip variable (not geosegmentation). See also geozip. The only supported filter is inList.Actions
Each variable requires an action. The Data Repair API supports the following four actions:
-
set: Overwrites the variable to the value in thesetValueproperty. Include thesetValueproperty alongside theactionproperty inside the variable. It supports all filters by default; however, some variables do not support all filters for this action. See the above table to confirm that a variable supports a filter with this action. -
delete: Clears the variable value. It supports all filters exceptisEmptyby default. Some variables do not support all filters for this action. See the above table to confirm that a variable supports a filter with this action. -
deleteQueryString: Remove the entire query string from a variable value. If the value does not appear to be a URL, no action is taken. Filters are not supported with this action. -
deleteQueryStringParameters: Remove one or more query string parameters and their values from a variable. The query parameters removed are based on the string arrayparameters. Include theparametersarray alongside theactionproperty inside the variable.- Up to 10 parameters are supported.
- Parameters are case sensitive.
- Filters are not supported with this action.
- If the value is not a correctly formatted URL, no action is taken.
data-slots=heading, code
data-repeat=4
data-languages=JSON,JSON,JSON,JSON
set
{
"variables": {
"evar1": {
"action": "set",
"setValue": "New value"
}
}
}
delete
{
"variables": {
"evar1": {
"action": "delete"
}
}
}
deleteQueryString
{
"variables": {
"evar1": {
"action": "deleteQueryString"
}
}
}
deleteQueryStringParameters
{
"variables": {
"evar1": {
"action": "deleteQueryStringParameters",
"parameters": ["param1", "param2"]
}
}
}
Filters
The set and delete actions support filters, which allow you to selectively repair certain rows based on the filter criteria. Check the above variable table to make sure that an action supports the desired filter. The deleteQueryString and deleteQueryStringParameters actions do not support any filters.
You can specify a single filter using filter or multiple filters using filters. Matching one of multiple filters (using an 'OR' operator) is not supported; when using multiple filters, each row must match all filters to be included in the repair.
All filters are case-sensitive.
inList: Include all rows where the variable is an exact match to at least one value from thematchValuesarray. ThematchValuesarray can hold up to 1000 values.isEmpty: Only include rows where the variable does not contain a value. Cannot be used with thedeleteaction.contains: Include rows where the variable contains the value inmatchValue.doesNotContain: Include rows where the value inmatchValueis not present.startsWith: Limit the action to rows where the value starts with the value inmatchValue.doesNotStartWith: Limit the action to rows where the value does not start with the value inmatchValue.endsWith: Limit the action to rows where the value ends with the value inmatchValue.doesNotEndWith: Limit the action to rows where the value does not end with the value inmatchValue.isURL: Only include the row if the Data Repair API recognizes the value as a URL.isNotURL: Only include the row if the Data Repair API recognizes that the value is not a URL.isNumeric: Include rows where the variable contains only numbers (0-9).isNotNumeric: Include rows where the variable contains characters other than numbers.
data-slots=heading, code
data-repeat=7
data-languages=JSON,JSON,JSON,JSON,JSON,JSON,JSON
inList
{
"variables": {
"evar1": {
"action": "delete",
"filter": {
"condition": "inList",
"matchValues": ["match1", "match2"]
}
},
"evar2": {
"action": "delete",
"filters": [{
"condition": "inList",
"matchValues": ["match1", "match2"]
}, {
"condition": "inList",
"matchValues": ["match2", "match3"]
}]
}
}
}
isEmpty
{
"variables": {
"evar1": {
"action": "set",
"setValue": "new value",
"filter": {
"condition": "isEmpty"
}
}
}
}
contains
{
"variables": {
"evar1": {
"action": "delete",
"filter": {
"condition": "contains",
"matchValue": "@"
}
}
}
}
startsWith
{
"variables": {
"evar1": {
"action": "delete",
"filter": {
"condition": "startsWith",
"matchValue": "ABC"
}
}
}
}
endsWith
{
"variables": {
"evar1": {
"action": "delete",
"filter": {
"condition": "endsWith",
"matchValue": "XYZ"
}
}
}
}
isURL
{
"variables": {
"evar1": {
"action": "delete",
"filter": {
"condition": "isURL"
}
}
}
}
isNumeric
{
"variables": {
"evar1": {
"action": "delete",
"filter": {
"condition": "isNumeric"
}
}
}
}
Filter Variables
By default, a filter is applied to the variable being repaired. Use filter.variable to filter by a variable other than the target variable. For example, the following means delete evar2 where evar3 contains '@':
{
"evar2": {
"action": "delete",
"filter": {
"condition": "contains",
"matchValue": "@",
"variable": "evar3"
}
}
}
Example Data Repair API definition file
The following Data Repair API definition simultaneously performs the following five actions:
- Deletes all activity map data
- Deletes the value in
prop12across all rows - Sets
eVar74to the value of "Turtles" across all rows - Deletes the value in
eVar107if the existing eVar value contains "Fox" or "Dog" - Deletes the value in
evar110whereevar110starts withHorseANDevar111starts withZebra
{
"variables": {
"activitymap": {
"action": "delete"
},
"prop12": {
"action": "delete"
},
"evar74": {
"action": "set",
"setValue": "Turtles"
},
"evar107": {
"action": "delete",
"filter": {
"condition": "inList",
"matchValues": ["Fox", "Dog"]
}
},
"evar110": {
"action": "delete",
"filters": [{
"condition": "startsWith",
"matchValue": "Horse"
}, {
"condition": "startsWith",
"matchValue": "Zebra",
"variable": "evar111"
}]
}
}
}
Once you have a completed JSON request body and a validationToken from the Server Call estimate endpoint, you can make a call to the Job endpoint to make the Data Repair API call.