Adobe  I/O Adobe Target

Exclusions

An Exclusion is a set of entities defined by a filter. See the parent page for common documentation that applies to all resources within the API.

List exclusions

GET /recs/{client}/exclusions
List all available exclusions.
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
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/exclusions?offset=1&limit=6

{
  "offset": 1,
  "limit": 6,
  "total": 12,
  "list": [
    {
        "id": 1,
        "name":"Exclusion 01",
        "description": "Optional description",
        "rule": {
         "id": {"doesNotContain": ["1", "2"]}
        }
    },
    {
        "id": 2,
        "name":"Exclusion 02",
        "description": "Optional description",
        "rule": {
         "id": {"contains": ["1", "2"]}
        }
    },
    ....
  ]
}

Create an exclusion

POST /recs/{client}/exclusions
Create a new exclusion as specified by the contents of the request and return the newly-created exclusion definition.
REQUEST BODY
exclusion (required) Body Parameter — Exclusion
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/exclusions

{
 "name":"Exclusion X",
 "rule":{
   "category": {"contains":["x", "X"]}
  }
}

<-- 201 CREATED
<-- Location https://{recs-host}/api/recs/demo/exclusions/9

{
 "id" : 9
 "name":"Exclusion X",
 "rule":{
   "category": {"contains":["x", "X"]}
  }
}

Get an exclusion by id

GET /recs/{client}/exclusions/{id}
Get the exclusion 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

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/exclusions/1

{
    "id": 1,
    "name":"Exclusion 01",
    "description": "Optional description",
    "rule": {
        "id": {"doesNotContain": ["1", "2"]}
   }
}

Update an exclusion by id

PUT /recs/{client}/exclusions/{id}
Update an exclusion with the new rules specified by the request data.
REQUEST BODY
exclusion (required) Body Parameter — Exclusion
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

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/exclusions/9

{
 "name":"Exclusion Y",
 "rule":{
   "category": {"contains":["y", "Y"]}
  }
}
{
 "id" : 9
 "name":"Exclusion Y",
 "rule":{
    "category": {"contains":["y", "Y"]}
  }
}

Delete an exclusion

DELETE /recs/{client}/exclusions/{id}
Delete the exclusion 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 "Content-Type: application/vnd.adobe.target.v1+json" -H "X-Target-user-email: buzz@adobe.com" https://{recs-host}/api/recs/demo/exclusions/9

{
 "id" : 9
 "name":"Exclusion Y",
 "rule":{
    "category": {"contains":["y", "Y"]}
  }
}

Field Description and Validation Rules

Field Path Description Validation
id Read only long value, generated by server side at the time of exclusion creation. used to identify a exclusion in URL. 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.
description String Optional. 1000 character limit.
rule->AttributeName

String

plus a set of predefined attributes:id,category,name,message,environment,inventory,margin,value,pageUrl, thumbnailUrl.

Cannot be empty or more than a 100 characters.
rule->AttributeName->Operation

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

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

numeric operators: greaterOrEquals|lesserOrEquals

non numeric: startsWith|endsWith|contains|doesNotContain

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

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

Must be one of the valid types described in the description. Numeric attributes environment,inventory,margin,value require numeric operations e.g. greaterOrEquals|lesserOrEquals|equals|notEquals
rule->AttributeName->Operation->[] Comma separated list of values. Each value is case sensitive. 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. Must be an empty list if the operation is valueIsPresent or valueIsNotPresent.