Adobe  I/O

Adobe Target

Criteria

A criteria contains rules, such as:

  • Filtering rules
  • Ranking rules
  • Datasource

Use these rules when building entity recommendations for customers. 

See the parent page for common documentation that applies to all resources within the API.

Example JSON of InclusionRules, Ranking Rules, and Grouping Attribute

{
    ...
    "configuration" : {
       ...
       "inclusionRules": [
          {
             "attribute": "value",
             "operation": "equals",
             "values": [
                "5"
             ]
          }
       ],
       "rankingRules": [
          {
             "matcher":{
                "attribute": "name",
                "operation": "contains",
                "values": [
                   "salad"
                ]
              },
              "weighting": 4
           }
        ],
        "grouping": {
           "type" : "HIERARCHICAL | SEQUENTIAL",
           "attributes" :["user.recsAttributeCity", "user.recsAttributeState"]
        }
     }
}

Field Description and validation rules for Inclusion Rules and Ranking Rules

Field Path Description Default Validation
inclusionRules->attribute

String. Attribute can be any user defined attribute plus a set of predefined attributes:id,category,name,message,environment,inventory,margin,value,pageUrl, thumbnailUrl, brand \(*\).

\(*\) = new attribute

---

Cannot be empty or longer than 100 characters. Must be a known attribute.

inclusionRules->operation

Represents the matching operations to be applied on products, allowed values:

equals|notEquals|contains|doesNotContain|greaterOrEquals|lesserOrEquals|startsWith|endsWith|

dynamicallyMatches|dynamicallyDoesNotMatch|dynamicallyRanges

numeric operators: greaterOrEquals|lesserOrEquals|dynamicallyRanges

non numeric: startsWith|endsWith|contains|doesNotContain|
dynamicallyMatches|dynamicallyDoesNotMatch|dynamicallyRanges

numeric and non numeric: (equals|notEquals|valueIsPresent|ValueIsNotPresent)

numeric = floating point value, negative accepted, scientific notations accepted

---

Must be a valid operation (as per description). Numeric attributes:environment,inventory,margin,value require numeric operations. e.g.greaterOrEquals|lesserOrEquals|equals|notEquals.

Must not include a value when using valueIsPresent or valueIsNotPresent.

inclusionRules->values

Comma separated list of string values.

---

Must be at least 1 value and no more than a 1000. Values cannot be empty or exceed 250 characters. Numeric attributes require numeric values. Numeric operations require numeric values. Operations valueIsPresent and ValueIsNoPresent cannot have values.

inclusionRules->lowRange

inclusionRules->highRange

Integer positive values, represents the min and the max boundaries used with the "dynamicallyRanges" operation where lowRange < highRange.

---

Must be present for operation dynamicallyRanges. lowRange cannot be greater than highRange and vice-versa.

rankingRules->matcher Matcher is the criterion, deciding which entity should receive the weighting. ---
rankingRules->weighting The weighting property is the weight applied to the entity when it satisfies the matcher's criterion. The weight can be a value between 0 and 4. ---

Weighting should not be out of bands, lower than 0 or higher than 4.

rankingRules->matcher->attribute See inclusionRules->attribute ---

Cannot be empty or longer than 100 characters. Must be a known attribute.

rankingRules->matcher->operation See inclusionRules->operation. It can use the same operators as do inclusionRules can,except rankingRules do not have dynamicallyMatches|dynamicallyDoesNotMatch|dynamicallyRanges. ---

Must be a valid operation (as per description). Numeric attributes:environment,inventory,margin,value require numeric operations. e.g.greaterOrEquals|lesserOrEquals|equals|notEquals.

rankingRules->matcher->values[ ] See configuration->inclusionRules->values. Because ranking rules do not use dynamic matching or dynamic range matching, the values must always contain legitimate values; it can not be empty. ---

Must be at least 1 value and no more than a 1000. Values cannot be empty or exceed 250 characters. Numeric attributes require numeric values. Numeric operations require numeric values.

List all criteria

GET /recs/{client}/criteria
List all types of criteria.
RETURN TYPE
RESPONSES
200 OK
400 Bad Request. Most probably the data provided in the request is invalid.
401 The user is not allowed to perform this operation.
403 Access to this resource is forbidden.
404 The referenced resource was not found.
PARAMETERS
references (optional) Query Parameter — boolean
offset (optional) Query Parameter — integer
limit (optional) Query Parameter — integer

Sample code

curl -X GET -H "Accept: application/vnd.adobe.target.v1+json" -H "X-Target-user-email: buzz@adobe.com" https://{recs-host}/api/recs/demo/criteria?offset=1&limit=6&references=true

{
  "offset": 1,
  "limit": 6,
  "total": 12,
  "list": [
      {
        "id": 1,
        "name" : "Criteria-01",
        "criteriaTitle" : "optional title",
        "references": {
           "recommendations": {
              "activeCount": 1,
              "inactiveCount": 0
           }
        },
        "type": "BOUGHT",
        "key": "CURRENT",
        "aggregation" : "NONE",
        "daysCount": "TWO_MONTHS",
        "backupDisabled" : false,
        "partialDesignAllowed" : false,
        "excludePurchases":false,
        "enableCaching":false,
        "criteriaGroup": "CATEGORY",
        "configuration" : {
            "pastBehaviorOrdinal": -1
        }
     },
     {
        "id": 2,
        "name" : "Criteria-02",
        "criteriaTitle" : "optional title",
        "references": {
           "recommendations": {
              "activeCount": 0,
              "inactiveCount": 0
           }
        },
        "type": "SELLERS",
        "aggregation" : "NONE",
        "daysCount": "TWO_MONTHS",
        "backupDisabled" : false,
        "partialDesignAllowed" : false,
        "excludePurchases":false,
        "enableCaching":false,
        "criteriaGroup": "POPULARITY",
        "configuration" : {
            "grouping" : {
                "type" : "HIERARCHICAL",
                "attributes" : ["user.recAttributetest"]
            }
        }
    },
    ....
  ]
}

Criteria Groups

Various groups are created within criteria based on the type of criteria. This is done in order to keep the validation simple as well as not include the fields which are irrelevant for particular type of criteria. Criteria of one group can not be changed into criteria of another group. BAD REQUEST if user tries to PUT/POST in another group criteria. Criteria groups are listed as below with their sample api calls and fields.

Category

This group contains criteria which are based on category i.e. currentCategory & favoriteCategory.

List criteria that belongs to category criteria

GET /recs/{client}/criteria/category
List criteria that belongs to category criteria.
RETURN TYPE
RESPONSES
200 OK
400 Bad Request. Most probably the data provided in the request is invalid.
401 The user is not allowed to perform this operation.
403 Access to this resource is forbidden.
404 The referenced resource was not found.
PARAMETERS
references (optional) Query Parameter — boolean
offset (optional) Query Parameter — integer
limit (optional) Query Parameter — integer

Sample code

curl -X GET -H "Accept: application/vnd.adobe.target.v1+json" -H "X-Target-user-email: buzz@adobe.com" https://{recs-host}/api/recs/demo/criteria/category?offset=1&limit=6&references=true

{
  "offset": 1,
  "limit": 6,
  "total": 12,
  "list": [
      {
        "id": 1,
        "name" : "Criteria-01",
        "criteriaTitle" : "optional title",
        "references": {
           "recommendations": {
              "activeCount": 1,
              "inactiveCount": 0
           }
        },
        "type": "BOUGHT",
        "key": "CURRENT",
        "aggregation" : "NONE",
        "daysCount": "TWO_MONTHS",
        "backupDisabled" : false,
        "partialDesignAllowed" : false,
        "excludePurchases":false,
        "enableCaching":false,
        "criteriaGroup": "CATEGORY",
        "configuration" : {
            "pastBehaviorOrdinal": -1
        }
     },
    ....
  ]
}

Create a category criteria

POST /recs/{client}/criteria/category
Create a category criteria as specified by the contents of the request and return the newly-created criteria definition.
REQUEST BODY
criteria (required) Body Parameter — CriteriaCategory
RESPONSES
201 Created
400 Bad Request. Most probably the data provided in the request is invalid.
401 The user is not allowed to perform this operation.
403 Access to this resource is forbidden.
404 The referenced resource was not found.

Sample code

curl -X POST -H "Accept: application/vnd.adobe.target.v1+json" -H "Content-Type: application/vnd.adobe.target.v1+json" -H "X-Target-user-email: buzz@adobe.com" https://{recs-host}/api/recs/demo/criteria/category

{
    "name" : "Criteria-01",
    "criteriaTitle" : "optional title",
    "type": "BOUGHT",
    "key": "CURRENT",
    "daysCount": "TWO_MONTHS",
    "minInventory": 1
}

<-- 201 CREATED
<-- Location https://{recs-host}/api/recs/demo/criteria/category/1

{
    "id": 1,
    "name" : "Criteria-01",
    "criteriaTitle" : "optional title",
    "type": "BOUGHT",
    "key": "CURRENT",
    "aggregation" : "NONE",
    "daysCount": "TWO_MONTHS",
    "minInventory": 1,
    "backupDisabled" : false,
    "partialDesignAllowed" : false,
    "excludePurchases":false,
    "enableCaching":false,
    "criteriaGroup": "CATEGORY",
    "configuration" : {
        "pastBehaviorOrdinal": -1
    }
}

Get a category criteria by id

GET /recs/{client}/criteria/category/{id}
Get a category criteria definition, specified by the provided id.
RETURN TYPE
RESPONSES
200 OK
400 Bad Request. Most probably the data provided in the request is invalid.
401 The user is not allowed to perform this operation.
403 Access to this resource is forbidden.
404 The referenced resource was not found.
PARAMETERS
id (required) Path Parameter — integer
references (optional) Query Parameter — boolean

Sample code

curl -X GET -H "Accept: application/vnd.adobe.target.v1+json" -H "X-Target-user-email: buzz@adobe.com" https://{recs-host}/api/recs/demo/criteria/category/1?references=true

{
    "id": 1,
    "name" : "Criteria-01",
    "criteriaTitle" : "optional title",
    "references": {
       "recommendations": {
          "activeCount": 1,
          "inactiveCount": 0,
          "active": [ {"id": 5, "name": "recs name" } ]
       }
    },
    "type": "BOUGHT",
    "key": "CURRENT",
    "aggregation" : "NONE",
    "daysCount": "TWO_MONTHS",
    "backupDisabled" : false,
    "partialDesignAllowed" : false,
    "excludePurchases":false,
    "enableCaching":false,
    "criteriaGroup": "CATEGORY",
    "configuration" : {
        "pastBehaviorOrdinal": -1
    }
}

Update a category criteria by id

PUT /recs/{client}/criteria/category/{id}
Update a category criteria with the new content specified by the request data.
REQUEST BODY
criteria (required) Body Parameter — CriteriaCategory
RETURN TYPE
RESPONSES
200 OK
201 Created
400 Bad Request. Most probably the data provided in the request is invalid.
401 The user is not allowed to perform this operation.
403 Access to this resource is forbidden.
404 The referenced resource was not found.
PARAMETERS
id (required) Path Parameter — integer
references (optional) Query Parameter — boolean

Sample code

curl -X PUT -H "Accept: application/vnd.adobe.target.v1+json" -H "Content-Type: application/vnd.adobe.target.v1+json" -H "X-Target-user-email: buzz@adobe.com" https://{recs-host}/api/recs/demo/criteria/category/1

{
    "name" : "Criteria-01",
    "criteriaTitle" : "optional title",
    "type": "BOUGHT",
    "key": "CURRENT",
    "daysCount": "TWO_WEEKS",
    "minInventory": 2,
    "partialDesignAllowed": true
}
{    "id": 1,
    "name" : "Criteria-01",
    "criteriaTitle" : "optional title",
    "type": "BOUGHT",
    "key": "CURRENT",
    "aggregation" : "NONE",
    "daysCount": "TWO_WEEKS",
    "minInventory": 2,
    "backupDisabled" : false,
    "partialDesignAllowed" : true,
    "excludePurchases":false,
    "enableCaching":false,
    "criteriaGroup": "CATEGORY",
    "configuration" : {
        "pastBehaviorOrdinal": -1
    }
}

Delete a category criteria

DELETE /recs/{client}/criteria/category/{id}
Delete a category criteria referenced by the specified id.
RETURN TYPE
RESPONSES
200 OK
400 Bad Request. Most probably the data provided in the request is invalid.
401 The user is not allowed to perform this operation.
204 No Content
403 Access to this resource is forbidden.
404 The referenced resource was not found.
PARAMETERS
id (required) Path Parameter — integer

Sample code

curl -X DELETE -H "Accept: application/vnd.adobe.target.v1+json" -H "X-Target-user-email: buzz@adobe.com" https://{recs-host}/api/recs/demo/criteria/category/1?references=true

{
    "id": 1,
    "name" : "Criteria-01",
    "criteriaTitle" : "optional title",
    "type": "BOUGHT",
    "key": "CURRENT",
    "aggregation" : "NONE",
    "daysCount": "TWO_WEEKS",
    "minInventory": 2,
    "backupDisabled" : false,
    "partialDesignAllowed" : true,
    "excludePurchases":false,
    "enableCaching":false,
    "criteriaGroup": "CATEGORY",
    "configuration" : {
        "pastBehaviorOrdinal": -1
    }
}

Field Description and Validation Rules

Field Path Description Default Validation
id Read only long value, generated by server side at the time of creation. Used to identify a criteria in URL. System generated. Must not exist on POST. Optional on PUT but must be the same as the existing id if included.
name String. Must be unique, 250 characters or less and not empty.
criteriaTitle String. Optional title which can be displayed on the design with $criteria.title. Cannot exceed 250 characters.
type String. Allowed values are BOUGHT | VIEWED Cannot be empty.
key String. Allowed values are CURRENT | FAVORITE Cannot be empty.
aggregation String. Allowed values are NONE | AGGREGATE | ALL_OR_NOTHING NONE Must be a valid value if specifed.
daysCount String. The data window to determine the time range of available historical user behavior data to use when determining which recommendations to show. Allowed values are DAY|TWO_DAYS|WEEK|TWO_WEEKS|MONTH|TWO_MONTHS Must be an allowed value.
minInventory Integer. The minimum number of items in stock for recommended items. Optional non-negative integer.
backupDisabled Boolean. Enable the recommendation's algorithm to use backup recommendations if the criteria does not generate enough recommendations. false Optional
partialDesignAllowed Boolean. Display the design when there is not enough recommendations to fill the slots. false Optional
excludePurchases Optional. If enabled does not include products that a visitor previously purchased. false Optional
enableCaching Boolean false Optional
criteriaGroup String. Read only. Represents the group that the criteria belongs too. CATEGORY
configuration Contains criteria specific settings Optional
configuration->pastBehaviorOrdinal Integer. Any number greater or equal to 0 for FAVORITE & -1 for CURRENT Optional. Must be -1 when key is CURRENT. Cannot be less than 0 when key is FAVORITE

configuration->priceRange->min

configuration->priceRange->max

Float. Indicates the price range of entities to consider. Optional. Must be numeric values if specified where min cannot be greater than max.
configuration->inclusionRules[ ]

List of inclusion rules rules for a criteria

Refer to Field Descriptions and validation rules for Inclusion Rules and Ranking Rules  for validation details of inclusion rule.

Cannot have more than 1000 rules.
configuration->rankingRules[ ]

A list of ranking rules, composed of a matcher and a weighting value. They are similar to inclusionRules, but the weights are applied when the matcher is satisfied. A criteria has the limit of having 1000 ranking rules.

Refer to Field Descriptions and validation rules for Inclusion Rules and Ranking Rules  for validation details of ranking rule.

Cannot have more than 1000 rules.

Get the list of custom criteria

GET /recs/{client}/criteria/custom
Get the list of custom criteria
RETURN TYPE
RESPONSES
200 OK
400 Bad Request. Most probably the data provided in the request is invalid.
401 The user is not allowed to perform this operation.
403 Access to this resource is forbidden.
404 The referenced resource was not found.
PARAMETERS
references (optional) Query Parameter — boolean
offset (optional) Query Parameter — integer
limit (optional) Query Parameter — integer

Sample code

curl -X GET -H "Accept: application/vnd.adobe.target.v1+json" -H "X-Target-user-email: buzz@adobe.com" "http://recs/api/recs/honeybeedemo/criteria/custom/" 
{
  "offset": 0,
  "limit": 2147483647,
  "total": 1,  
  "list": [
    {
      "id": 1,
      "name": "Custom Criteria 01",
      "criteriaTitle": "Criteria Title",
      "criteriaGroup": "CUSTOM",
      "key": "CURRENT",
      "partialDesignAllowed": true,
      "backupDisabled": false,
      "excludePurchases": false,
      "enableCaching": false,
      "configuration": {
        "feed": {
          "id": 1,
          "environmentId": 13,
          "scheduleType": "weekly",
          "scheduleTime": "08:00:00",
          "connection": {
            "type": "url",
            "attributes": {
              "URL": "http://yourfavoriteplace/foo.csv"
            }
          },
          "uploadHistory": []
        }
      }
    }
  ]
}

Create a custom criteria

POST /recs/{client}/criteria/custom
Create a custom criteria
REQUEST BODY
criteria (required) Body Parameter — CriteriaCustom
RESPONSES
201 Created
400 Bad Request. Most probably the data provided in the request is invalid.
401 The user is not allowed to perform this operation.
403 Access to this resource is forbidden.
404 The referenced resource was not found.

Sample code

curl -X POST -H "Accept: application/vnd.adobe.target.v1+json" -H "X-Target-user-email: buzz@adobe.com" -H "Content-Type: application/vnd.adobe.target.v1+json" -d '{
    "name" : "Custom Criteria 01",
    "criteriaTitle" : "Criteria Title",
    "key": "CURRENT",
    "backupDisabled" : false,
    "partialDesignAllowed" : true,
    "excludePurchases": false,
    "configuration": {
        "feed":{
            "scheduleType": "weekly",
            "scheduleTime": "08:00",
            "environmentId": 13,
            "connection": {
                "type": "url",
                "attributes": {
                    "URL": "http://yourfavoriteplace/foo.csv"
                }
            }
        }
    }
}' "http://recs/api/recs/honeybeedemo/criteria/custom"
 
<-- 201 CREATED
{
  "id": 1,
  "name": "Custom Criteria 01",
  "criteriaTitle": "Criteria Title",
  "criteriaGroup": "CUSTOM",
  "key": "CURRENT",
  "partialDesignAllowed": true,
  "backupDisabled": false,
  "excludePurchases": false,
  "enableCaching": false,
  "configuration": {
    "feed": {
      "id": 1,
      "environmentId": 13,
      "scheduleType": "weekly",
      "scheduleTime": "08:00:00",
      "connection": {
        "type": "url",
        "attributes": {
          "URL": "http://yourfavoriteplace/foo.csv"
        }
      },
      "uploadHistory": []
    }
  }
}

Get a custom criteria by id

GET /recs/{client}/criteria/custom/{id}
Get a custom criteria by id
RETURN TYPE
RESPONSES
200 OK
400 Bad Request. Most probably the data provided in the request is invalid.
401 The user is not allowed to perform this operation.
403 Access to this resource is forbidden.
404 The referenced resource was not found.
PARAMETERS
id (required) Path Parameter — integer
references (optional) Query Parameter — boolean

Sample code

curl -X GET -H "Accept: application/vnd.adobe.target.v1+json" -H "X-Target-user-email: buzz@adobe.com" "http://recs/api/recs/honeybeedemo/criteria/custom/1" 

{
  "id": 1,
    "name": "Custom Criteria 01",
    "criteriaTitle": "Criteria Title",
    "criteriaGroup": "CUSTOM",
    "key": "CURRENT",
    "partialDesignAllowed": true,
    "backupDisabled": false,
    "excludePurchases": false,
    "enableCaching": false,
    "configuration": {
    "feed": {
      "id": 1,
      "environmentId": 13,
      "scheduleType": "weekly",
      "scheduleTime": "08:00:00",
      "connection": {
        "type": "url",
        "attributes": {
          "URL": "http://yourfavoriteplace/foo.csv"
        }
      },
      "uploadHistory": []
    }
  }
}

Update a custom criteria by id

PUT /recs/{client}/criteria/custom/{id}
Update a custom criteria by id
REQUEST BODY
criteria (required) Body Parameter — CriteriaCustom
RETURN TYPE
RESPONSES
200 OK
201 Created
400 Bad Request. Most probably the data provided in the request is invalid.
401 The user is not allowed to perform this operation.
403 Access to this resource is forbidden.
404 The referenced resource was not found.
PARAMETERS
id (required) Path Parameter — integer
references (optional) Query Parameter — boolean

Sample code

curl -X PUT -H "Accept: application/vnd.adobe.target.v1+json" -H "X-Target-user-email: buzz@adobe.com" -H "Content-Type: application/vnd.adobe.target.v1+json" -d '{
    "name" : "Custom Criteria 01",
    "criteriaTitle" : "Criteria Title",
    "key": "CURRENT",
    "backupDisabled" : false,
    "partialDesignAllowed" : true,
    "excludePurchases": false,
    "configuration": {
        "feed":{
            "scheduleType": "weekly",
            "scheduleTime": "08:00",
            "environmentId": 13,
            "connection": {
                "type": "url",
                "attributes": {
                    "URL": "http://yourfavoriteplace/foo.csv"
                }
            }
        }
    }
}' "http://recs/api/recs/honeybeedemo/criteria/custom/1"
 
<-- 200 OK
{
  "id": 1,
  "name": "Custom Criteria 01",
  "criteriaTitle": "Criteria Title",
  "criteriaGroup": "CUSTOM",
  "key": "CURRENT",
  "partialDesignAllowed": true,
  "backupDisabled": false,
  "excludePurchases": false,
  "enableCaching": false,
  "configuration": {
    "feed": {
      "id": 1,
      "environmentId": 13,
      "scheduleType": "weekly",
      "scheduleTime": "08:00:00",
      "connection": {
        "type": "url",
        "attributes": {
          "URL": "http://yourfavoriteplace/foo.csv"
        }
      },
      "uploadHistory": []
    }
  }
}

Delete a custom criteria by id

DELETE /recs/{client}/criteria/custom/{id}
Delete a custom criteria by id
RETURN TYPE
RESPONSES
200 OK
400 Bad Request. Most probably the data provided in the request is invalid.
401 The user is not allowed to perform this operation.
204 No Content
403 Access to this resource is forbidden.
404 The referenced resource was not found.
PARAMETERS
id (required) Path Parameter — integer

Sample code

curl -X DELETE -H "Accept: application/vnd.adobe.target.v1+json" -H "X-Target-user-email: buzz@adobe.com" -H "Content-Type: application/vnd.adobe.target.v1+json" -d '' "http://recs/api/recs/honeybeedemo/criteria/custom/1" 
{
  "id": 1,
  "name": "Custom Criteria 01",
  "criteriaTitle": "Criteria Title",
  "criteriaGroup": "CUSTOM",
  "key": "CURRENT",
  "partialDesignAllowed": true,
  "backupDisabled": false,
  "excludePurchases": false,
  "enableCaching": false,
  "configuration": {
    "feed": {
      "id": 1,
      "environmentId": 13,
      "scheduleType": "weekly",
      "scheduleTime": "08:00:00",
      "connection": {
        "type": "url",
        "attributes": {
          "URL": "http://yourfavoriteplace/foo.csv"
        }
      },
      "uploadHistory": []
    }
  }
}

List criteria that belongs to item criteria

GET /recs/{client}/criteria/item
List criteria that belongs to item criteria.
RETURN TYPE
RESPONSES
200 OK
400 Bad Request. Most probably the data provided in the request is invalid.
401 The user is not allowed to perform this operation.
403 Access to this resource is forbidden.
404 The referenced resource was not found.
PARAMETERS
references (optional) Query Parameter — boolean
offset (optional) Query Parameter — integer
limit (optional) Query Parameter — integer

Sample code

curl -X GET -H "Accept: application/vnd.adobe.target.v1+json" -H "X-Target-user-email: buzz@adobe.com" https://{recs-host}/api/recs/demo/criteria/item?offset=1&limit=6&references=true

{
  "offset": 1,
  "limit": 6,
  "total": 12,
  "list": [
      {
        "id": 1,
        "name" : "Criteria-01",
        "criteriaTitle" : "optional title",
        "references": {
           "recommendations": {
              "activeCount": 1,
              "inactiveCount": 0
           }
        },
        "type": "VIEWED_CF",
        "key": "CURRENT",
        "aggregation" : "NONE",
        "daysCount": "TWO_MONTHS",
        "backupDisabled" : false,
        "partialDesignAllowed" : false,
        "excludePurchases":false,
        "enableCaching":false,
        "criteriaGroup": "ITEM",
        "configuration" : {
            "pastBehaviorOrdinal": -1
        }
     },
    ....
  ]
}

Create a item criteria

POST /recs/{client}/criteria/item
Create a item criteria as specified by the contents of the request and return the newly-created criteria definition.
REQUEST BODY
criteria (required) Body Parameter — CriteriaItem
RESPONSES
201 Created
400 Bad Request. Most probably the data provided in the request is invalid.
401 The user is not allowed to perform this operation.
403 Access to this resource is forbidden.
404 The referenced resource was not found.

Sample code

curl -X POST -H "Accept: application/vnd.adobe.target.v1+json" -H "Content-Type: application/vnd.adobe.target.v1+json" -H "X-Target-user-email: buzz@adobe.com" https://{recs-host}/api/recs/demo/criteria/item

{
    "name" : "Criteria-01",
    "criteriaTitle" : "optional title",
    "type": "VIEWED_CF",
    "key": "CURRENT",
    "daysCount": "TWO_MONTHS",
    "minInventory": 1
}

<-- 201 CREATED
<-- Location https://{recs-host}/api/recs/demo/criteria/category/1

{
    "id": 1,
    "name" : "Criteria-01",
    "criteriaTitle" : "optional title",
    "type": "VIEWED_CF",
    "key": "CURRENT",
    "aggregation" : "NONE",
    "daysCount": "TWO_MONTHS",
    "minInventory": 1,
    "backupDisabled" : false,
    "partialDesignAllowed" : false,
    "excludePurchases":false,
    "enableCaching":false,
    "criteriaGroup": "ITEM",
    "configuration" : {
        "pastBehaviorOrdinal": -1
    }
}

Get a item criteria by id

GET /recs/{client}/criteria/item/{id}
Get a item criteria definition, specified by the provided id.
RETURN TYPE
RESPONSES
200 OK
400 Bad Request. Most probably the data provided in the request is invalid.
401 The user is not allowed to perform this operation.
403 Access to this resource is forbidden.
404 The referenced resource was not found.
PARAMETERS
id (required) Path Parameter — integer
references (optional) Query Parameter — boolean

Sample code

curl -X GET -H "Accept: application/vnd.adobe.target.v1+json" -H "X-Target-user-email: buzz@adobe.com" https://{recs-host}/api/recs/demo/criteria/item/1?references=true

{
    "id": 1,
    "name" : "Criteria-01",
    "criteriaTitle" : "optional title",
    "references": {
       "recommendations": {
          "activeCount": 1,
          "inactiveCount": 0,
          "active": [ {"id": 5, "name": "recs name" } ]
       }
    },
    "type": "VIEWED_CF",
    "key": "CURRENT",
    "aggregation" : "NONE",
    "daysCount": "TWO_MONTHS",
    "backupDisabled" : false,
    "partialDesignAllowed" : false,
    "excludePurchases":false,
    "enableCaching":false,
    "criteriaGroup": "ITEM",
    "configuration" : {
        "pastBehaviorOrdinal": -1
    }
}

Update a item criteria by id

PUT /recs/{client}/criteria/item/{id}
Update a item criteria with the new content specified by the request data.
REQUEST BODY
criteria (required) Body Parameter — CriteriaItem
RETURN TYPE
RESPONSES
200 OK
201 Created
400 Bad Request. Most probably the data provided in the request is invalid.
401 The user is not allowed to perform this operation.
403 Access to this resource is forbidden.
404 The referenced resource was not found.
PARAMETERS
id (required) Path Parameter — integer
references (optional) Query Parameter — boolean

Sample code

curl -X PUT -H "Accept: application/vnd.adobe.target.v1+json" -H "Content-Type: application/vnd.adobe.target.v1+json" -H "X-Target-user-email: buzz@adobe.com" https://{recs-host}/api/recs/demo/criteria/item/1

{
    "name" : "Criteria-01",
    "criteriaTitle" : "optional title",
    "type": "BOUGHT_CF",
    "key": "CURRENT",
    "daysCount": "TWO_WEEKS",
    "minInventory": 2,
    "partialDesignAllowed": true
}

{
    "id": 1,
    "name" : "Criteria-01",
    "criteriaTitle" : "optional title",
    "type": "BOUGHT_CF",
    "key": "CURRENT",
    "aggregation" : "NONE",
    "daysCount": "TWO_WEEKS",
    "minInventory": 2,
    "backupDisabled" : false,
    "partialDesignAllowed" : true,
    "excludePurchases":false,
    "enableCaching":false,
    "criteriaGroup": "ITEM",
    "configuration" : {
        "pastBehaviorOrdinal": -1
    } 
}

Delete a item criteria

DELETE /recs/{client}/criteria/item/{id}
Delete a item criteria referenced by the specified id.
RETURN TYPE
RESPONSES
200 OK
400 Bad Request. Most probably the data provided in the request is invalid.
401 The user is not allowed to perform this operation.
204 No Content
403 Access to this resource is forbidden.
404 The referenced resource was not found.
PARAMETERS
id (required) Path Parameter — integer

Sample code

curl -X DELETE -H "Accept: application/vnd.adobe.target.v1+json" -H "X-Target-user-email: buzz@adobe.com" https://{recs-host}/api/recs/demo/criteria/item/1?references=true

{
    "id": 1,
    "name" : "Criteria-01",
    "criteriaTitle" : "optional title",
    "type": "BOUGHT_CF",
    "key": "CURRENT",
    "aggregation" : "NONE",
    "daysCount": "TWO_WEEKS",
    "minInventory": 2,
    "backupDisabled" : false,
    "partialDesignAllowed" : true,
    "excludePurchases":false,
    "enableCaching":false,
    "criteriaGroup": "ITEM",
    "configuration" : {
        "pastBehaviorOrdinal": -1
    }
}

Field Description and Validation Rules

Field Path Description Default Validation
id Read only long value, generated by server side at the time of creation. Used to identify a criteria in URL. System generated.

Must not exist on POST. Optional on PUT but must be the same as the existing id if included.

name String representation, non empty, limited to 250 chars, case sensitive -- Must be unique, 250 characters or less and not empty.
criteriaTitle

String. Optional title which can be displayed on the design with $criteria.title.

 

 --

 

Cannot exceed 250 characters.

 

type String. Allowed values are BOUGHT | VIEWED | VIEWED_BOUGHT | BOUGHT_CF | VIEWED_CF | VIEWED_BOUGHT_CF | SITE_AFFINITY | SIMILARITY --- Cannot be empty.
key String. Allowed values are CURRENT | LAST_VIEWED | LAST_PURCHASED | MOST_VIEWED --- Cannot be empty.
aggregation String. Allowed values are NONE | AGGREGATE | ALL_OR_NOTHING NONE Must be a valid value if specifed.
daysCount String. The data window to determine the time range of available historical user behavior data to use when determining which recommendations to show. Allowed values are DAY|TWO_DAYS|WEEK|TWO_WEEKS|MONTH|TWO_MONTHS --- Must be an allowed value.
minInventory Integer. The minimum number of items in stock for recommended items. --- Optional non-negative integer.
backupDisabled Boolean. Enable the recommendation's algorithm to use backup recommendations if the criteria does not generate enough recommendations. false Optional
partialDesignAllowed Boolean. Display the design when there is not enough recommendations to fill the slots. false Optional
excludePurchases Optional. If enabled does not include products that a visitor previously purchased. false Optional
enableCaching Boolean false Optional
criteriaGroup String. Read only. Represents the group that the criteria belongs too. ITEM
configuration Criteria specific settings. --- Optional for all types but SITE_AFFINITY
configuration->pastBehaviorOrdinal

Integer. any number greater or equal to 0 for LAST_VIEWED | LAST_PURCHASED | MOST_VIEWED &

-1 for CURRENT

0 for LAST_VIEWED | LAST_PURCHASED | MOST_VIEWED, -1 for CURRENT Must be -1 if the key is CURRENT. For LAST_VIEWED | LAST_PURCHASED | MOST_VIEWED it can be any number greater or equal to 0.
configuration->datasource String. Indicates the datasource, either mboxes or a client specific reportsuite. Report suite cannot be used with SIMILARITY. mboxes Optional. For SIMILARITY it must either be empty or mboxes. If the value is not mboxes then it must be an existing analytics report suite.
configuration->confidence String. Confidence can only be specified for SITE_AFFINITY. Allowed values are VERY_WEAK | WEAK | MODERATE | STRONG | VERY_STRONG --- Must be empty if criteria is not SITE AFFINITY otherwise it must be one of the allowed values.

configuration->priceRange->min

configuration->priceRange->max

Float. Indicates the price range of entities to consider. Cannot be used with SITE_AFFINITY. --- Optional. Must be numeric values if specified where min cannot be greater than max.
configuration->inclusionRules[ ] List of inclusion rules rules for a criteria. Refer to Field Description and validation rules for Inclusion Rules and Ranking Rules for validation details of inclusion rule. Cannot be used with SITE_AFFINITY. ---

Cannot have more than 1000 rules.

configuration->rankingRules[ ]

A list of ranking rules, composed of a matcher and a weighting value. They are similar to inclusionRules, but the weights are applied when the matcher is satisfied. A criteria has the limit of having 1000 ranking rules.

Refer to Field Description and validation rules for Inclusion Rules and Ranking Rules for validation details of ranking rule. Cannot be used with SITE_AFFINITY.

--- Cannot have more than 1000 rules.

Popularity

This group contains criteria which are based on popularity i.e. topSellers, topViewed & topMetric.

List criteria that belongs to popularity criteria

GET /recs/{client}/criteria/popularity
List criteria that belongs to popularity criteria.
RETURN TYPE
RESPONSES
200 OK
400 Bad Request. Most probably the data provided in the request is invalid.
401 The user is not allowed to perform this operation.
403 Access to this resource is forbidden.
404 The referenced resource was not found.
PARAMETERS
references (optional) Query Parameter — boolean
offset (optional) Query Parameter — integer
limit (optional) Query Parameter — integer

Sample code

curl -X GET -H "Accept: application/vnd.adobe.target.v1+json" -H "X-Target-user-email: buzz@adobe.com" https://{recs-host}/api/recs/demo/criteria/popularity?offset=1&limit=6&references=true

{
  "offset": 1,
  "limit": 6,
  "total": 12,
  "list": [
      {
        "id": 1,
        "name" : "Criteria-01",
        "criteriaTitle" : "optional title",
        "references": {
           "recommendations": {
              "activeCount": 1,
              "inactiveCount": 0
           }
        },
        "type": "SELLERS",
        "aggregation" : "NONE",
        "daysCount": "TWO_MONTHS",
        "backupDisabled" : false,
        "partialDesignAllowed" : false,
        "excludePurchases":false,
        "enableCaching":false,
        "criteriaGroup": "POPULARITY",
        "configuration" : { }
     },
    ....
  ]
}

Create a popularity criteria

POST /recs/{client}/criteria/popularity
Create a popularity criteria as specified by the contents of the request and return the newly-created criteria definition.
REQUEST BODY
criteria (required) Body Parameter — CriteriaPopularity
RESPONSES
201 Created
400 Bad Request. Most probably the data provided in the request is invalid.
401 The user is not allowed to perform this operation.
403 Access to this resource is forbidden.
404 The referenced resource was not found.

Sample code

curl -X POST -H "Accept: application/vnd.adobe.target.v1+json" -H "Content-Type: application/vnd.adobe.target.v1+json" -H "X-Target-user-email: buzz@adobe.com" https://{recs-host}/api/recs/demo/criteria/popularity

{
    "name" : "Criteria-01",
    "criteriaTitle" : "optional title",
    "type": "SELLERS",
    "daysCount": "TWO_MONTHS",
    "minInventory": 1
}

<-- 201 CREATED
<-- Location https://{recs-host}/api/recs/demo/criteria/category/1

{
    "id": 1,
    "name" : "Criteria-01",
    "criteriaTitle" : "optional title",
    "type": "SELLERS",
    "aggregation" : "NONE",
    "daysCount": "TWO_MONTHS",
    "minInventory": 1,
    "backupDisabled" : false,
    "partialDesignAllowed" : false,
    "excludePurchases":false,
    "enableCaching":false,
    "criteriaGroup": "POPULARITY",
    "configuration" : { }
}

Get a popularity criteria by id

GET /recs/{client}/criteria/popularity/{id}
Get a popularity criteria definition, specified by the provided id.
RETURN TYPE
RESPONSES
200 OK
400 Bad Request. Most probably the data provided in the request is invalid.
401 The user is not allowed to perform this operation.
403 Access to this resource is forbidden.
404 The referenced resource was not found.
PARAMETERS
id (required) Path Parameter — integer
references (optional) Query Parameter — boolean

Sample code

curl -X GET -H "Accept: application/vnd.adobe.target.v1+json" -H "X-Target-user-email: buzz@adobe.com" https://{recs-host}/api/recs/demo/criteria/popularity/1?references=true

{
    "id": 1,
    "name" : "Criteria-01",
    "criteriaTitle" : "optional title",
    "references": {
       "recommendations": {
          "activeCount": 1,
          "inactiveCount": 0,
          "active": [ {"id": 5, "name": "recs name" } ]
       }
    },
    "type": "SELLERS",
    "aggregation" : "NONE",
    "daysCount": "TWO_MONTHS",
    "backupDisabled" : false,
    "partialDesignAllowed" : false,
    "excludePurchases":false,
    "enableCaching":false,
    "criteriaGroup": "POPULARITY",
    "configuration" : { }
}

Update a popularity criteria by id

PUT /recs/{client}/criteria/popularity/{id}
Update a popularity criteria with the new content specified by the request data.
REQUEST BODY
criteria (required) Body Parameter — CriteriaPopularity
RETURN TYPE
RESPONSES
200 OK
201 Created
400 Bad Request. Most probably the data provided in the request is invalid.
401 The user is not allowed to perform this operation.
403 Access to this resource is forbidden.
404 The referenced resource was not found.
PARAMETERS
id (required) Path Parameter — integer
references (optional) Query Parameter — boolean

Sample code

curl -X PUT -H "Accept: application/vnd.adobe.target.v1+json" -H "Content-Type: application/vnd.adobe.target.v1+json" -H "X-Target-user-email: buzz@adobe.com" https://{recs-host}/api/recs/demo/criteria/popularity/1

{
    "name" : "Criteria-01",
    "criteriaTitle" : "optional title",
    "type": "SELLERS",
    "daysCount": "TWO_WEEKS",
    "minInventory": 2,
    "partialDesignAllowed": true
}

{
    "id": 1,
    "name" : "Criteria-01",
    "criteriaTitle" : "optional title",
    "type": "VIEWED",
    "aggregation" : "NONE",
    "daysCount": "TWO_WEEKS",
    "minInventory": 2,
    "backupDisabled" : false,
    "partialDesignAllowed" : true,
    "excludePurchases":false,
    "enableCaching":false,
    "criteriaGroup": "POPULARITY",
    "configuration" : { }
}

Delete a popularity criteria

DELETE /recs/{client}/criteria/popularity/{id}
Delete a popularity criteria referenced by the specified id.
RETURN TYPE
RESPONSES
200 OK
400 Bad Request. Most probably the data provided in the request is invalid.
401 The user is not allowed to perform this operation.
204 No Content
403 Access to this resource is forbidden.
404 The referenced resource was not found.
PARAMETERS
id (required) Path Parameter — integer

Sample code

curl -X DELETE -H "Accept: application/vnd.adobe.target.v1+json" -H "X-Target-user-email: buzz@adobe.com" https://{recs-host}/api/recs/demo/criteria/popularity/1?references=true

{
    "id": 1,
    "name" : "Criteria-01",
    "criteriaTitle" : "optional title",
    "type": "SELLERS",
    "aggregation" : "NONE",
    "daysCount": "TWO_WEEKS",
    "minInventory": 2,
    "backupDisabled" : false,
    "partialDesignAllowed" : true,
    "excludePurchases":false,
    "enableCaching":false,
    "criteriaGroup": "POPULARITY",
    "configuration" : { }
}

Field Description and Validation Rules

Field Path Description Default Validation
id Read only long value, generated by server side at the time of creation. Used to identify a criteria in URL. System generated.

Must not exist on POST. Optional on PUT but must be the same as the existing id if included.

name String. --

Must be unique, 250 characters or less and not empty.

criteriaTitle

String. Optional title which can be displayed on the design with $criteria.title.

 

 --

 

Optional. Cannot exceed 250 characters.

 

type String. Allowed values are SELLERS | VIEWED | METRIC --- Cannot be empty.
key String. Metric name. Only applicable when type is METRIC. --- Should be empty when key is not METRIC. Must be specified when key is METRIC.
aggregation String. Optional. Allowed values are NONE | AGGREGATE | ALL_OR_NOTHING NONE

Must be a valid value if specified.

daysCount String. The data window to determine the time range of available historical user behavior data to use when determining which recommendations to show. Allowed values are DAY|TWO_DAYS|WEEK|TWO_WEEKS|MONTH|TWO_MONTHS --- Must be an allowed value.
minInventory Integer. The minimum number of items in stock for recommended items. --- Optional non-negative integer.
backupDisabled Boolean. Boolean. Enable the recommendation's algorithm to use backup recommendations if the criteria does not generate enough recommendations. false Optional
partialDesignAllowed Boolean. If enabled displays the design when there is not enough recommendations to fill the slots. false Optional
excludePurchases Optional. If enabled does not include products that a visitor previously purchased. false Optional
enableCaching Boolean false Optional
criteriaGroup String. Read only. Represent the group that the criteria belongs too. POPULARITY  
configuration Optional for all types but METRIC, Contains criteria specific settings. ---  
configuration->datasource String. Indicates the datasource,either mboxes or an analytics report-suite. mboxes Cannot be empty if key is METRIC. If value is not mboxes then it must be an existing analytics report suite.

configuration->grouping

String. Represents the key grouping option, available only for  SELLERS | VIEWED, with mbox datasource

--- Optional. Cannot be present if key is METRIC
configuration->grouping->type String. Allowed values: HIERARCHICAL | SEQUENTIAL --- Must be a one of the allowed values.
configuration->grouping->attributes Array of up to 10 T&T profile attribute names. --- Cannot be empty. Each profile attribute name is a non empty string up to 250 characters. The attribute name must match the pattern '^(user|profile)\\.[a-zA-z0-9_\\-]+'

configuration->priceRange->min

configuration->priceRange->max

Float. Indicates the price range of entities to consider. --- Optional. Must be numeric values if specified where min cannot be greater than max.
configuration->inclusionRules[ ] List of inclusion rules rules for a criteria. Refer to Field Description and validation rules for Inclusion Rules and Ranking Rules for validation details of inclusion rule. --- Cannot have more than 1000 rules.
configuration->rankingRules[ ] A list of ranking rules, composed of a matcher and a weighting value. They are similar to inclusionRules, but the weights are applied when the matcher is satisfied. A criteria has the limit of having 1000 ranking rules.

Refer to Field Description and validation rules for Inclusion Rules and Ranking Rules for validation details of ranking rule.
---
Cannot have more than 1000 rules.

Profile Attribute

This group contains criteria which are based on customProfileAttribute.

List criteria that belongs to profileattribute criteria

GET /recs/{client}/criteria/profileattribute
List criteria that belongs to profile-attribute criteria.
RETURN TYPE
RESPONSES
200 OK
400 Bad Request. Most probably the data provided in the request is invalid.
401 The user is not allowed to perform this operation.
403 Access to this resource is forbidden.
404 The referenced resource was not found.
PARAMETERS
references (optional) Query Parameter — boolean
offset (optional) Query Parameter — integer
limit (optional) Query Parameter — integer

Sample code

curl -X GET -H "Accept: application/vnd.adobe.target.v1+json" -H "X-Target-user-email: buzz@adobe.com" https://{recs-host}/api/recs/demo/criteria/profileattribute?offset=1&limit=6&references=true

{
  "offset": 1,
  "limit": 6,
  "total": 12,
  "list": [
      {
        "id": 1,
        "name" : "Criteria-01",
        "criteriaTitle" : "optional title",
        "references": {
           "recommendations": {
              "activeCount": 1,
              "inactiveCount": 0
           }
        },
        "type": "BOUGHT_CF",
        "aggregation" : "NONE",
        "daysCount": "TWO_MONTHS",
        "backupDisabled" : false,
        "partialDesignAllowed" : false,
        "excludePurchases":false,
        "enableCaching":false,
        "criteriaGroup": "PROFILEATTRIBUTE",
        "configuration" : {
            "attribute": "user.testAttribute"
        }
     },
    ....
  ]
}

Create a profileattribute criteria

POST /recs/{client}/criteria/profileattribute
Create a profile-attribute criteria as specified by the contents of the request and return the newly-created criteria definition.
REQUEST BODY
criteria (required) Body Parameter — CriteriaProfileAttribute
RESPONSES
201 Created
400 Bad Request. Most probably the data provided in the request is invalid.
401 The user is not allowed to perform this operation.
403 Access to this resource is forbidden.
404 The referenced resource was not found.

Sample code

curl -X POST -H "Accept: application/vnd.adobe.target.v1+json" -H "Content-Type: application/vnd.adobe.target.v1+json" -H "X-Target-user-email: buzz@adobe.com" https://{recs-host}/api/recs/demo/criteria/profileattribute

{
    "name" : "Criteria-01",
    "criteriaTitle" : "optional title",
    "type": "BOUGHT_CF",
    "daysCount": "TWO_MONTHS",
    "minInventory": 1,
    "configuration" : {
        "attribute": "user.testAttribute"
    }
}

<-- 201 CREATED
<-- Location https://{recs-host}/api/recs/demo/criteria/category/1

{
    "id": 1,
    "name" : "Criteria-01",
    "criteriaTitle" : "optional title",
    "type": "BOUGHT_CF",
    "aggregation" : "NONE",
    "daysCount": "TWO_MONTHS",
    "minInventory": 1,
    "backupDisabled" : false,
    "partialDesignAllowed" : false,
    "excludePurchases":false,
    "enableCaching":false,
    "criteriaGroup": "PROFILEATTRIBUTE",
    "configuration" : {
        "attribute": "user.testAttribute"
    }
}

Get a profileattribute criteria by id

GET /recs/{client}/criteria/profileattribute/{id}
Get a profile-attribute criteria definition, specified by the provided id.
RETURN TYPE
RESPONSES
200 OK
400 Bad Request. Most probably the data provided in the request is invalid.
401 The user is not allowed to perform this operation.
403 Access to this resource is forbidden.
404 The referenced resource was not found.
PARAMETERS
id (required) Path Parameter — integer
references (optional) Query Parameter — boolean

Sample code

curl -X GET -H "Accept: application/vnd.adobe.target.v1+json" -H "X-Target-user-email: buzz@adobe.com" https://{recs-host}/api/recs/demo/criteria/profileattribute/1?references=true

{
    "id": 1,
    "name" : "Criteria-01",
    "criteriaTitle" : "optional title",
    "references": {
       "recommendations": {
          "activeCount": 1,
          "inactiveCount": 0,
          "active": [ {"id": 5, "name": "recs name" } ]
       }
    },
    "type": "BOUGHT_CF",
    "aggregation" : "NONE",
    "daysCount": "TWO_MONTHS",
    "backupDisabled" : false,
    "partialDesignAllowed" : false,
    "excludePurchases":false,
    "enableCaching":false,
    "criteriaGroup": "PROFILEATTRIBUTE",
    "configuration" : {
        "attribute": "user.testAttribute"
    }
}

Update a profileattribute criteria by id

PUT /recs/{client}/criteria/profileattribute/{id}
Update a profile-attribute criteria with the new content specified by the request data.
REQUEST BODY
criteria (required) Body Parameter — CriteriaProfileAttribute
RETURN TYPE
RESPONSES
200 OK
201 Created
400 Bad Request. Most probably the data provided in the request is invalid.
401 The user is not allowed to perform this operation.
403 Access to this resource is forbidden.
404 The referenced resource was not found.
PARAMETERS
id (required) Path Parameter — integer
references (optional) Query Parameter — boolean

Sample code

curl -X PUT -H "Accept: application/vnd.adobe.target.v1+json" -H "Content-Type: application/vnd.adobe.target.v1+json" -H "X-Target-user-email: buzz@adobe.com" https://{recs-host}/api/recs/demo/criteria/profileattribute/1

{
    "name" : "Criteria-01",
    "criteriaTitle" : "optional title",
    "type": "VIEWED_CF",
    "daysCount": "TWO_WEEKS",
    "minInventory": 2,
    "partialDesignAllowed": true,
    "configuration" : {
        "attribute": "user.testAttribute"
    }
}
{
    "id": 1,
    "name" : "Criteria-01",
    "criteriaTitle" : "optional title",
    "type": "VIEWED_CF",
    "aggregation" : "NONE",
    "daysCount": "TWO_WEEKS",
    "minInventory": 2,
    "backupDisabled" : false,
    "partialDesignAllowed" : true,
    "excludePurchases":false,
    "enableCaching":false,
    "criteriaGroup": "PROFILEATTRIBUTE",
    "configuration" : {
        "attribute": "user.testAttribute"
    }
}

Delete a profileattribute criteria

DELETE /recs/{client}/criteria/profileattribute/{id}
Delete a profile-attribute criteria referenced by the specified id.
RETURN TYPE
RESPONSES
200 OK
400 Bad Request. Most probably the data provided in the request is invalid.
401 The user is not allowed to perform this operation.
204 No Content
403 Access to this resource is forbidden.
404 The referenced resource was not found.
PARAMETERS
id (required) Path Parameter — integer

Sample code

curl -X DELETE -H "Accept: application/vnd.adobe.target.v1+json" -H "X-Target-user-email: buzz@adobe.com" https://{recs-host}/api/recs/demo/criteria/profileattribute/1?references=true

{
    "id": 1,
    "name" : "Criteria-01",
    "criteriaTitle" : "optional title",
    "type": "BOUGHT_CF",
    "aggregation" : "NONE",
    "daysCount": "TWO_WEEKS",
    "minInventory": 2,
    "backupDisabled" : false,
    "partialDesignAllowed" : true,
    "excludePurchases":false,
    "enableCaching":false,
    "criteriaGroup": "PROFILEATTRIBUTE",
    "configuration" : {
        "attribute": "user.testAttribute"
    }
}


Field Description and Validation Rules

Field Path Description Default Validation
id Read only long value, generated by server side at the time of creation. Used to identify a criteria in URL.

System generated.

Must not exist on POST. Optional on PUT but must be the same as the existing id if included.

name string representation, non empty, limited to 250 chars, case sensitive --

Must be unique, 250 characters or less and not empty.

criteriaTitle

String. Optional title which can be displayed on the design with $criteria.title.

 

 --

Cannot exceed 250 characters.

daysCount String. The data window to determine the time range of available historical user behavior data to use when determining which recommendations to show. Allowed values are DAY|TWO_DAYS|WEEK|TWO_WEEKS|MONTH|TWO_MONTHS ---

Must be an allowed value.

minInventory Integer. The minimum number of items in stock for recommended items. --- Optional non-negative integer.
backupDisabled Boolean. Enable the recommendation's algorithm to use backup recommendations if the criteria does not generate enough recommendations. false Optional
partialDesignAllowed Boolean. Display the design when there is not enough recommendations to fill the slots. false Optional
excludePurchases Optional. If enabled does not include products that a visitor previously purchased. false Optional
enableCaching Boolean false Optional
criteriaGroup String. Read only. Represents the group that the criteria belongs too. PROFILEATTRIBUTE Read only
configuration Contains criteria specific settings --- Must be present.
configuration->attribute String. Name of custom profile/user attribute ---

Cannot be empty. Each profile attribute name is a non empty string up to 250 characters. The attribute name must match the pattern '^(user|profile)\\.[a-zA-z0-9_\\-]+'

configuration->datasource

String. Indicates the datasource,either mboxes or an analytics report-suite.

---

If value is not mboxes then it must be an existing analytics report suite.

configuration->confidence String. Confidence can only be specified for SITE_AFFINITY.Allowed values are VERY_WEAK | WEAK | MODERATE | STRONG | VERY_STRONG ---

Must be empty if criteria is not SITE AFFINITY otherwise it must be one of the allowed values.

configuration->priceRange->min

configuration->priceRange->max

Float. Indicates the price range of entities to consider. Cannot be used with SITE_AFFINITY.

---

Optional. Must be numeric values if specified where min cannot be greater than max.

configuration->inclusionRules[ ]

List of inclusion rules rules for a criteria. Refer to Field Description and validation rules for Inclusion Rules and Ranking Rules for validation details of inclusion rule. Cannot be used with SITE_AFFINITY.

---

Cannot have more than a 1000 rules.

configuration->rankingRules[ ]

A list of ranking rules, composed of a matcher and a weighting value. They are similar to inclusionRules, but the weights are applied when the matcher is satisfied. A criteria has the limit of having 1000 ranking rules.

Refer to Field Description and validation rules for Inclusion Rules and Ranking Rules for validation details of ranking rule. Cannot be used with SITE_AFFINITY.

---

Cannot have more than a 1000 rules.

Recent

This group contains criteria which are based on recentlyViewed.

List criteria that belongs to recent criteria

GET /recs/{client}/criteria/recent
List criteria that belongs to recent criteria.
RETURN TYPE
RESPONSES
200 OK
400 Bad Request. Most probably the data provided in the request is invalid.
401 The user is not allowed to perform this operation.
403 Access to this resource is forbidden.
404 The referenced resource was not found.
PARAMETERS
references (optional) Query Parameter — boolean
offset (optional) Query Parameter — integer
limit (optional) Query Parameter — integer

Sample code

curl -X GET -H "Accept: application/vnd.adobe.target.v1+json" -H "X-Target-user-email: buzz@adobe.com" https://{recs-host}/api/recs/demo/criteria/recent?offset=1&limit=6&references=true

{
  "offset": 1,
  "limit": 6,
  "total": 12,
  "list": [
      {
        "id": 1,
        "name" : "Criteria-01",
        "criteriaTitle" : "optional title",
        "references": {
           "recommendations": {
              "activeCount": 1,
              "inactiveCount": 0
           }
        },
        "criteriaGroup": "RECENT"
     },
    ....
  ]
}

Create a recent criteria

POST /recs/{client}/criteria/recent
Create a recent criteria as specified by the contents of the request and return the newly-created criteria definition.
REQUEST BODY
criteria (required) Body Parameter — CriteriaRecent
RESPONSES
201 Created
400 Bad Request. Most probably the data provided in the request is invalid.
401 The user is not allowed to perform this operation.
403 Access to this resource is forbidden.
404 The referenced resource was not found.

Sample code

curl -X POST -H "Accept: application/vnd.adobe.target.v1+json" -H "Content-Type: application/vnd.adobe.target.v1+json" -H "X-Target-user-email: buzz@adobe.com" https://{recs-host}/api/recs/demo/criteria/recent

{
    "name" : "Criteria-01",
    "criteriaTitle" : "optional title"
}

<-- 201 CREATED
<-- Location https://{recs-host}/api/recs/demo/criteria/category/1

{
    "id": 1,
    "name" : "Criteria-01",
    "criteriaTitle" : "optional title",
    "criteriaGroup": "RECENT"
}

Get a recent criteria by id

GET /recs/{client}/criteria/recent/{id}
Get a recent criteria definition, specified by the provided id.
RETURN TYPE
RESPONSES
200 OK
400 Bad Request. Most probably the data provided in the request is invalid.
401 The user is not allowed to perform this operation.
403 Access to this resource is forbidden.
404 The referenced resource was not found.
PARAMETERS
id (required) Path Parameter — integer
references (optional) Query Parameter — boolean

Sample code

curl -X GET -H "Accept: application/vnd.adobe.target.v1+json" -H "X-Target-user-email: buzz@adobe.com" https://{recs-host}/api/recs/demo/criteria/recent/1?references=true

{
    "id": 1,
    "name" : "Criteria-01",
    "criteriaTitle" : "optional title",
    "references": {
       "recommendations": {
          "activeCount": 1,
          "inactiveCount": 0,
          "active": [ {"id": 5, "name": "recs name" } ]
       }
    },
    "criteriaGroup": "RECENT"
}

Update a recent criteria by id

PUT /recs/{client}/criteria/recent/{id}
Update a recent criteria with the new content specified by the request data.
REQUEST BODY
criteria (required) Body Parameter — CriteriaRecent
RETURN TYPE
RESPONSES
200 OK
201 Created
400 Bad Request. Most probably the data provided in the request is invalid.
401 The user is not allowed to perform this operation.
403 Access to this resource is forbidden.
404 The referenced resource was not found.
PARAMETERS
id (required) Path Parameter — integer
references (optional) Query Parameter — boolean

Sample code

curl -X PUT -H "Accept: application/vnd.adobe.target.v1+json" -H "Content-Type: application/vnd.adobe.target.v1+json" -H "X-Target-user-email: buzz@adobe.com" https://{recs-host}/api/recs/demo/criteria/recent/1

{
    "name" : "Criteria-Recent"
}
{
    "id": 1,
    "name" : "Criteria-Recent",
    "criteriaGroup": "RECENT"
}

Delete a recent criteria

DELETE /recs/{client}/criteria/recent/{id}
Delete a recent criteria referenced by the specified id.
RETURN TYPE
RESPONSES
200 OK
400 Bad Request. Most probably the data provided in the request is invalid.
401 The user is not allowed to perform this operation.
204 No Content
403 Access to this resource is forbidden.
404 The referenced resource was not found.
PARAMETERS
id (required) Path Parameter — integer

Sample code

curl -X DELETE -H "Accept: application/vnd.adobe.target.v1+json" -H "X-Target-user-email: buzz@adobe.com" https://{recs-host}/api/recs/demo/criteria/recent/1?references=true

{
    "id": 1,
    "name" : "Criteria-01",
    "criteriaTitle" : "optional title",
    "criteriaGroup": "RECENT"
}

Field Description and Validation Rules

Field Path Description Default Validation
id Read only long value, generated by server side at the time of creation. Used to identify a criteria in URL.

System generated.

Must not exist on POST. Optional on PUT but must be the same as the existing id if included.

name String. --

Must be unique, 250 characters or less and not empty.

criteriaTitle

String. Optional title which can be displayed on the design with $criteria.title.

 

 --

Cannot exceed 250 characters.

criteriaGroup String. Read only. Represents the group that the criteria belongs too. RECENT  

Custom Algorithm

A custom algorithm is both an algorithm and a feed providing a source of recommendations. This feature can be used to replace the legacy custom algorithm. Because the custom algorithm is a feed that can pull a CSV document from a server, it can handle a larger number of documents than the previous algorithm. It can also update periodically.

CSV Documentation Format

# Lines beginning with hash are comments, as they are comments in CSV downloads 
* Lines beginning with asterisks are also ignored, as they are back up algorithms in CSV downloads 
key1, recommendation1, recommendation2, recommendation3, ..., recommendationN 
key2, recommendation1, recommendation2, ..., recommendationN 
... 
keyN, recomendation1, recommendation2, ..., recommendationN

 

Get a criteria by id

GET /recs/{client}/criteria/{id}
Get minimal criteria information by the provided id that can be used to construct api call to fetch the criteria's full details.
RETURN TYPE
RESPONSES
200 OK
400 Bad Request. Most probably the data provided in the request is invalid.
401 The user is not allowed to perform this operation.
403 Access to this resource is forbidden.
404 The referenced resource was not found.
PARAMETERS
id (required) Path Parameter — integer

Sample code

curl -X GET -H "Accept: application/vnd.adobe.target.v1+json" -H "X-Target-user-email: buzz@adobe.com" "http://recs/api/recs/honeybeedemo/criteria/custom/1" 
{
  "id": 1,
    "name": "Custom Criteria 01",
    "criteriaTitle": "Criteria Title",
    "criteriaGroup": "CUSTOM",
    "key": "CURRENT",
    "partialDesignAllowed": true,
    "backupDisabled": false,
    "excludePurchases": false,
    "enableCaching": false,
    "configuration": {
    "feed": {
      "id": 1,
      "environmentId": 13,
      "scheduleType": "weekly",
      "scheduleTime": "08:00:00",
      "connection": {
        "type": "url",
        "attributes": {
          "URL": "http://yourfavoriteplace/foo.csv"
        }
      },
      "uploadHistory": []
    }
  }
}

Field Description & Validation Rules

Field Path Description Default Validation
backupDisabled Boolean.Enable the recommendation's algorithm to use backup recommendations if the criteria does not generate enough recommendations.
false
Optional
configuration Contains criteria specific settings   Must be specified for SITE_AFFINITY optional for others.
configuration-> attribute String. Name of a user or profile attribute.   This field can only be used and must be assigned a value if and only if the key is PROFILE_ATTRIBUTE. The attribute value must start with either the prefix "profile." or "user."
configuration-> feed Object defining the feed's settings.   Must be specified.
configuration-> feed-> connection Describes the connection for the feed    
configuration-> feed-> connection-> attributes A set of attributes describing a connection. For URL, the attributes are
URL, which is the url of the source of the feed, including its
protocol. For FTP, the attributes are SERVER, USERNAME, PASSWORD,
FILENAME, DIRECTORY
   
configuration-> feed-> connection-> type String. url or ftp    
configuration-> feed-> environmentId Long. Id of an existing environment. Use -1 to indicate all environments.   Must be a valid environment id or -1.
configuration-> feed-> scheduleTime Time to run the feed in the format hh:mm   Optional field.
configuration-> feed-> scheduleType String. Allowed values: "daily", "weekly","biWeekly", "never".   Must be a allowed value.
configuration-> feed-> uploadHistory A list of feed import status over time.   Cannot be part of a POST or PUT request.
criteriaGroup String. Read only. Represents the group that the criteria belongs too. CUSTOM  
criteriaTitle String. Optional title which can be displayed on the design with $criteria.title.   Cannot exceed 250 characters.
enableCaching Boolean false Optional
excludePurchases Optional. If enabled does not include products that a visitor previously purchased. false Optional
id Read only long value, generated by server side at the time of creation. Used to identify a criteria in URL. System generated. Must not exist on POST. Optional on PUT but must be the same as the existing id if included.
key String. Allowed values are CURRENT | LAST_VIEWED|LAST_PURCHASED | MOST_VIEWED|CURRENT_CATEGORY | FAVORITE_CATEGORY | PROFILE_ATTRIBUTE   Cannot be empty.
name String.   Must be unique, 250 characters or less and not empty.
partialDesignAllowed Boolean. Display the design when there is not enough recommendations to fill the slots. false Optional