Get values 📋

GET /products/values/{property_key}

Returns the values for a given property on a list of products

By default all the products of the perimeter with a value on this property will be returned, but the population can be reduced using filters.

Path parameters

  • property_key string Required

    The property key for which to get the values, as returned by segment datamodel endpoint.

    If it is a public property, it must be prefixed by the segment slug + '--', for example hand-protection--en388-digits.

    Otherwise it will look for private properties

Query parameters

  • Optional filters that will reduce the product population and only provide values for the products matching the filters. Filter example: en388-cut~d

    Filters can be cumulated with the query string array syntax: ?filters[]=prop1~foo&filters[]=prop2~bar

    Filters on string properties must provide the exact value, case sensitive. Loose search is not permitted yet.

    In the filter, if the value is omitted after the ~, the filter will return all products having at least a value for the property.

Responses

  • 200 application/json

    Successfully returned property values

    Hide response attributes Show response attributes object
    • status string
    • result object

      Additional properties are allowed.

      Hide result attribute Show result attribute object
      • values array[object]
        Hide values attributes Show values attributes object
        • Unique slug to identify the segment

          Values are hand-protection, foot-protection, head-protection, eye-protection, body-protection, ear-protection, fall-protection, respiratory-protection, ergonomy, safety-first-aid, hygiene, lockout-tagout, electrical, lightening, safety-signs, or surface-cleaning.

        • Id to identify the product, unique segment-wise

        • value string

          The value for this property can be:

          • a value_key for enum
          • an array of value_key for enum_list
          • a string otherwise
GET /products/values/{property_key}
curl \
 --request GET https://api.ppe-analytics.com/api/v1/products/values/acme-product-ranking \
 -H "PPEApiKey: $API_KEY"
Response examples (200)
{
  "status": "OK",
  "result": {
    "values": [
      {
        "value": [
          "one",
          "two"
        ],
        "product_id": "f50938a24830edb8b1c2ecc3f7dd88a3",
        "product_segment_key": "surface-cleaning"
      },
      {
        "value": [
          "three"
        ],
        "product_id": "89e6848c8f1f91404c224393340b1fad",
        "product_segment_key": "surface-cleaning"
      },
      {
        "value": [
          "one"
        ],
        "product_id": "79e6848c8f1f91404c224393340b1fad",
        "product_segment_key": "surface-cleaning"
      }
    ]
  }
}