Skip to main content

Use the create a decision model variant function in Sitecore CDP REST API

Abstract

How to create a decision model variant in Sitecore CDP (Data model 2.1).

You can use the Decision Model Variant REST API to perform the create a decision model variant function to create a decision model variant. To do this, you must have the decisionModelDefinitionRef attribute returned when retrieving the decision model reference.

To create a decision model variant in Sitecore CDP, use the following:

POST: https://apiEndpoint/v2/decisionModelDefinitions/decisionModelDefinitionRef/variants

Attribute

Description

Type

decisionModelDefinitionRef

The reference of the decision model.

string

{  
   "name":"Discount Seasonal Offers",
   "modifiedByUserRef":"25f46901-bc51-45e8-b587-148aecf1e48f",
   "modifiedAt":"2018-10-05T07:37:49.650Z",
   "revision":1,
   "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/4ee0797d-e229-492d-883e-1344787002b4/revisions"
   },
   "offers":[  

   ]
}

The following is a 201 response:

{  
   "clientKey":"pqsPERS3lw12v5a9rrHPW1c4hET73GxQ",
   "href":"https://dev-api.boxever.com/v2/decisionModelVariants/4ee0797d-e229-492d-883e-1344787002b4",
   "ref":"4ee0797d-e229-492d-883e-1344787002b4",
   "name":"Discount Seasonal Offers",
   "modifiedByUserRef":"25f46901-bc51-45e8-b587-148aecf1e48f",
   "modifiedAt":"2018-10-05T07:37:49.650Z",
   "revision":1,
   "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/4ee0797d-e229-492d-883e-1344787002b4/revisions"
   },
   "offers":[  

   ]
}