GET /configurations/{configuration_id}

Description

Get the configuration associated with configuration_id.

Parameters

Type Name Schema

Path

configuration_id
required

string

Responses

HTTP Code Description Schema

200

OK

404

Configuration not found

No Content

Produces

  • application/json

Example HTTP response

Response 200

{
  "configuration_id" : "<some_name>",
  "constraints" : [ {
    "_constraint_explanation" : "Limit the generated recommendations to contain at most 2 results which contain 'Brexit' in the metadata key 'article_title'",
    "limit" : {
      "max" : 2
    },
    "query" : {
      "contains" : {
        "value" : "Brexit"
      },
      "key" : "article_title"
    }
  }, {
    "_constraint_explanation" : "Include at least one result which has an exact match for 'domestic' for the metadata key 'section'",
    "limit" : {
      "min" : 1
    },
    "query" : {
      "key" : "section",
      "match" : {
        "value" : "domestic"
      }
    }
  }, {
    "_constraint_explanation" : "Results' 'section' key value should not be equal to 'SHE'",
    "query" : {
      "key" : "section",
      "match" : {
        "not" : {
          "value" : "SHE"
        }
      }
    }
  }, {
    "_constraint_explanation" : "Results' 'paywall_type' key value should have an exact match for 'paid'",
    "query" : {
      "key" : "paywall_type",
      "match" : {
        "value" : "paid"
      }
    }
  }, {
    "_constraint_explanation" : "Results' 'section' key value should either match 'Sport' or match the specified request body variable 'second_category' which has a fallback value of 'domestic'",
    "query" : {
      "key" : "section",
      "match" : {
        "or" : [ {
          "value" : "Sport"
        }, {
          "variable" : {
            "default" : "domestic\"",
            "name" : "second_category"
          }
        } ]
      }
    }
  }, {
    "_constraint_explanation" : "Results' 'price' key value should be located in the interval [10, 50]",
    "query" : {
      "key" : "price",
      "range" : {
        "max" : 50,
        "min" : 10
      }
    }
  }, {
    "_constraint_explanation" : "Results' 'brand' key value should exactly match the specified context item's 'brand' metadata key value",
    "query" : {
      "key" : "brand",
      "match" : {
        "variable" : {
          "context" : "item",
          "name" : "brand"
        }
      }
    }
  }, {
    "_diversify_explanation" : "The list of results should contain at most 3 items with the same value for the 'section' metadata key",
    "diversify" : {
      "key" : "section"
    },
    "limit" : {
      "max" : 3
    }
  } ]
}

CustomerConfiguration

Name Description Schema

configuration_id
required

The identifier used to reference the created configuration

string

constraints
required

Array of either Query or Diversify objects

< object > array

Query

Defines a query (constraint) which recommendations should match and optionally a limit

Name Description Schema

limit
optional

Limit the max/min number of recommendations that should satisfy this constraint

query
required

Define a constraint which the generated recommendations should match

limit

Name Description Schema

max
optional

Limit the maximum number of recommendations that should satisfy this constraint

integer

min
optional

Limit the minimum number of recommendations that should satisfy this constraint

integer

query

Name Description Schema

contains
optional

Find a substring

date_range
optional

Find values inside the specified time interval constraint

object

gt
optional

Find values greater than the specified constraint value

gte
optional

Find values greater than or equal to the specified constraint value

key
required

The metadata key for which the constraint should be applied

string

lt
optional

Find values less than the specified constraint value

lte
optional

Find values less than or equal to the specified constraint value

match
optional

Equality constraint

range
optional

Find values inside the specified interval constraint

starts_with
optional

Find the beginning of a string

Diversify

Influence the recommendation generation to be more diverse by applying limits to the maximum number of recommendations with a certain property value

Name Description Schema

diversify
required

Specify a metadata key for which values should be distinct (or limited to a maximum amount) in the generated recommendations

limit
optional

Maximum number of recommendations with the same value for the selected metadata key

diversify

Name Description Schema

key
required

Metadata key

string

limit

Name Description Schema

max
optional

Maximum number of recommendations

integer

QueryConstraintComparator

Either an array of QueryConstraintValueOrVariable objects or a single QueryConstraintValueOrVariable object

QueryConstraintMatchBody

Key one of and, or, not with a Value QueryConstraintComparator or just a plain QueryConstraintValueOrVariable

QueryConstraintNot

One of: QueryConstraintValueOrVariable, {"or": QueryConstraintComparator} or {"and": QueryConstraintComparator}

QueryConstraintRangeBody

Name Description Schema

max
required

Upper bound value of the range

number

min
required

Lower bound value of the range

number

QueryConstraintValueOrVariable

A QueryConstraintValue or QueryConstraintVariable

QueryConstraintValue

Match a constraint using a hard coded value

Name Description Schema

value
required

A string, boolean or number

object

QueryConstraintVariable

Match a constraint using a variable which can be specified at recommendation request time

Name Description Schema

variable
required

Reference a variable by at least its name

variable

Name Description Schema

context
optional

The source of the variable, can be either request_body (default) to look inside the request body or item to look for the variable in the metadata of the specified context item

string

default
optional

A fallback value that is used when the variable is not set at request time either a string or number

object

name
required

Name of the variable which can be specified at recommendation request time

string

on_absent_drop
optional

Set to true if the constraint should be ignored if the variable is not specified in the request

boolean