OCAPI filtering 19.10

After you specify a resource type and relationship type (see URL schema), you can specify a filter parameter to further reduce the number of resource instances in the result set. Filter parameters differ for each resource_type and relationship_type pair. In the following example, the first filter parameter type specifies a value of cross_sell, eliminating from the result set all resource instances whose type is not equal to cross_sell. The second filter parameter direction specifies the value out, eliminating all resource instances whose direction is different.


REQUEST:
GET /dw/shop/v19_10/products/123/links?type=cross_sell&direction=out HTTP/1.1
Host: example.com
Accept: application/json

RESPONSE:
HTTP/1.1 200 OK
Content-Length: 351
Content-Type: application/json; charset=UTF-8

{
  "_v":"19.10",
  ...
  "product_links":
  [{
    "source_product_id":"123",
    "source_product_link":"http://example.com/dw/shop/v19_10/product/123",
    "target_product_id":"456",
    "target_product_link":"http://example.com/dw/shop/v19_10/product/456",
    "type":"cross_sell",
    "direction":"out"
  },
  {
    "source_product_id":"123",
    "source_product_link":"http://example.com/dw/shop/v19_10/product/123",
    "target_product_id":"789",
    "target_product_link":"http://example.com/dw/shop/v19_10/product/789",
    "type":"cross_sell",
    "direction":"out"
  }]
X Privacy Update: We use cookies to make interactions with our websites and services easy and meaningful, to better understand how they are used and to tailor advertising. By continuing to use this site you are giving us your consent to do this.