close

Filter

loading table of contents...

Headless Server Developer Manual / Version 2512.1

Table Of Contents

4.10.10.2 Retrieving Variants and Parsed Conditions

Especially when interfacing with a personalization provider directly, it can be beneficial to retrieve the conditions in parsed form:

{
  content {
    page(id: "123456") {
      id
      name
      contentVariants {
        content {
          id
        }
        conditions {
          condition
          vendor
          type
          externalId
          vendorAttributes
        }
      }
    }
  }
}

The output would look like this:

{
  "data": {
    "content": {
      "page": {
        "id": "123456",
        "name": "The Page",
        "contentVariants": [
          {
            "content": {
              "id": "345678"
            },
            "conditions": [
              {
                "condition": "cmec:///p13n/segment/12345678901234567890;cmecType=segment",
                "vendor": "cmec",
                "type": "segment",
                "externalId": "12345678901234567890",
                "vendorAttributes": "cmecType=segment"
              }
            ]
          }
        ]
      }
    }
  }
}

See the notes about the interpretation of the variant list in the previous section.

Search Results

Table Of Contents
warning

Your Internet Explorer is no longer supported.

Please use Mozilla Firefox, Google Chrome, or Microsoft Edge.