Skip to main content

Use the retrieve variants of a decision model reference function in Sitecore CDP REST API

Abstract

How to retrieve variants of a decision model reference in Sitecore CDP (Data model 2.1).

You can use the Decision Model REST API to perform the retrieve variants decision model reference function to return the variants of a decision model. To do this, you need the decisionModelDefinitionRef returned when retrieving the decision model definition.

To retrieve variants of a decision model reference in Sitecore CDP, use the following:

GET: https://apiEndpoint/v2/decisionModelDefinitions/<ref>/variants

Attribute

Description

Type

decisionModelDefinitionRef

The reference of the decision model.

string

$ curl -H "Accept: application/json" \
    "https://{apiEndpoint}/v2/decisionModelDefinitions/64ebc05e-2406-48d0-a074-d78dc0191ea6/variants"

The following is a 200 response:

{  
   "href":"https://dev-api.boxever.com/v2/decisionModelDefinitions/db6ee91d-bc02-4e83-8621-a17aee09814d/variants",
   "items":[  
      {  
         "clientKey":"pqsPERS3lw12v5a9rrHPW1c4hET73GxQ",
         "href":"https://dev-api.boxever.com/v2/decisionModelVariants/2e5c1db3-7ed5-420a-a50a-0fa46067906a",
         "ref":"2e5c1db3-7ed5-420a-a50a-0fa46067906a",
         "name":"promoting upgrades",
         "modifiedByUserRef":"25f46901-bc51-45e8-b587-148aecf1e48f",
         "modifiedAt":"2018-09-20T16:54:23.589Z",
         "revision":3,
         "archived":false,
         "decisionModelDefinitionRef":"db6ee91d-bc02-4e83-8621-a17aee09814d",
         "definition":"<definitions xmlns=\"http://www.omg.org/spec/DMN/20151101/dmn.xsd\" id=\"definitions\" name=\"definitions\" namespace=\"http://camunda.org/schema/1.0/dmn\" />",
         "revisions":{  
            "href":"https://dev-api.boxever.com/v2/decisionModelVariants/2e5c1db3-7ed5-420a-a50a-0fa46067906a/revisions"
         },
         "inProduction":true
      },
      {  
         "clientKey":"pqsPERS3lw12v5a9rrHPW1c4hET73GxQ",
         "href":"https://dev-api.boxever.com/v2/decisionModelVariants/38f0a6a2-c7c6-4fa5-bb53-06469dc8e133",
         "ref":"38f0a6a2-c7c6-4fa5-bb53-06469dc8e133",
         "name":"20% discount",
         "modifiedByUserRef":"25f46901-bc51-45e8-b587-148aecf1e48f",
         "modifiedAt":"2018-09-20T16:54:15.450Z",
         "revision":4,
         "archived":false,
         "decisionModelDefinitionRef":"db6ee91d-bc02-4e83-8621-a17aee09814d",
         "definition":"<definitions xmlns=\"http://www.omg.org/spec/DMN/20151101/dmn.xsd\" id=\"definitions\" name=\"definitions\" namespace=\"http://camunda.org/schema/1.0/dmn\" />",
         "revisions":{  
            "href":"https://dev-api.boxever.com/v2/decisionModelVariants/38f0a6a2-c7c6-4fa5-bb53-06469dc8e133/revisions"
         },
         "inProduction":true
      },
      {  
         "clientKey":"pqsPERS3lw12v5a9rrHPW1c4hET73GxQ",
         "href":"https://dev-api.boxever.com/v2/decisionModelVariants/cdc15d08-433f-4698-b76b-04adfe11be4b",
         "ref":"cdc15d08-433f-4698-b76b-04adfe11be4b",
         "name":"promoting tours",
         "modifiedByUserRef":"25f46901-bc51-45e8-b587-148aecf1e48f",
         "modifiedAt":"2018-09-20T16:54:51.291Z",
         "revision":4,
         "archived":false,
         "decisionModelDefinitionRef":"db6ee91d-bc02-4e83-8621-a17aee09814d",
         "definition":"<definitions xmlns=\"http://www.omg.org/spec/DMN/20151101/dmn.xsd\" id=\"definitions\" name=\"definitions\" namespace=\"http://camunda.org/schema/1.0/dmn\" />",
         "revisions":{  
            "href":"https://dev-api.boxever.com/v2/decisionModelVariants/cdc15d08-433f-4698-b76b-04adfe11be4b/revisions"
         },
         "inProduction":true
      },
      {  
         "clientKey":"pqsPERS3lw12v5a9rrHPW1c4hET73GxQ",
         "href":"https://dev-api.boxever.com/v2/decisionModelVariants/2a18c317-cd98-4866-b2a8-b36239a3e8bc",
         "ref":"2a18c317-cd98-4866-b2a8-b36239a3e8bc",
         "name":"15% discount",
         "modifiedByUserRef":"25f46901-bc51-45e8-b587-148aecf1e48f",
         "modifiedAt":"2018-09-20T16:53:59.720Z",
         "revision":7,
         "archived":false,
         "decisionModelDefinitionRef":"db6ee91d-bc02-4e83-8621-a17aee09814d",
         "definition":"<definitions xmlns=\"http://www.omg.org/spec/DMN/20151101/dmn.xsd\" id=\"definitions\" name=\"definitions\" namespace=\"http://camunda.org/schema/1.0/dmn\" />",
         "revisions":{  
            "href":"https://dev-api.boxever.com/v2/decisionModelVariants/2a18c317-cd98-4866-b2a8-b36239a3e8bc/revisions"
         },
         "inProduction":true
      }
   ]
}