Use the retrieve revisions of a decision model definition function in Sitecore CDP REST API

Abstract

How to retrieve revisions of a decision model definition in Sitecore CDP (Data model 2.1).

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

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

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

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/revisions"

The following is a 200 response:

{  
   "href":"https://api.boxever.com/v2/decisionModelDefinitions/64ebc05e-2406-48d0-a074-d78dc0191ea6/revisions",
   "items":[  
      {  
         "href":"https://api.boxever.com/v2/decisionModelDefinitions/64ebc05e-2406-48d0-a074-d78dc0191ea6/revisions/1",
         "ref":"64ebc05e-2406-48d0-a074-d78dc0191ea6",
         "revision":1,
         "revisionComment":"revision 1 comment",
         "modifiedByUserRef":"f58e3f5a-dc4a-4dde-acf9-998580eb1975",
         "modifiedAt":"2018-03-07T08:51:13.952Z",
         "archived":false,
         "name":"MANAGE MY BOOKING OFFERS",
         "description":"mmb seasonal offers",
         "deploymentConfiguration":{  
            "variants":[  

            ]
         },
         "tags":[  
            "Tag1"
         ],
         "variants":{  
            "href":"https://api.boxever.com/v2/decisionModelDefinitions/64ebc05e-2406-

{
    "href": "https://dev-api.boxever.com/v2/decisionModelDefinitions/e8878fdb-4031-423c-a12b-5691381f0c89/revisions",
    "items": [
        {
            "clientKey": "pqsPERS3lw12v5a9rrHPW1c4hET73GxQ",
            "href": "https://dev-api.boxever.com/v2/decisionModelDefinitions/e8878fdb-4031-423c-a12b-5691381f0c89/revisions/4",
            "ref": "e8878fdb-4031-423c-a12b-5691381f0c89",
            "name": "MANAGE MY BOOKING OFFERS - archived 2018-10-10 16:04",
            "modifiedByUserRef": "c008c81d-4941-46aa-b4e6-a17e8388498a",
            "modifiedAt": "2018-10-10T16:04:20.878Z",
            "revision": 4,
            "archived": true,
            "deploymentConfiguration": {
                "variants": [
                    {
                        "variantRef": "19700f15-4069-4121-b709-1031118677c8",
                        "split": 80,
                        "status": "PRODUCTION",
                        "variantRevision": 1
                    },
                    {
                        "variantRef": "42e882a5-c8a8-4149-be76-343409d10c1c",
                        "split": 20,
                        "status": "PRODUCTION",
                        "variantRevision": 1
                    }
                ]
            },
            "variants": {
                "href": "https://dev-api.boxever.com/v2/decisionModelDefinitions/e8878fdb-4031-423c-a12b-5691381f0c89/variants"
            },
            "revisions": {
                "href": "https://dev-api.boxever.com/v2/decisionModelDefinitions/e8878fdb-4031-423c-a12b-5691381f0c89/revisions"
            }
        },
        {
            "clientKey": "pqsPERS3lw12v5a9rrHPW1c4hET73GxQ",
            "href": "https://dev-api.boxever.com/v2/decisionModelDefinitions/e8878fdb-4031-423c-a12b-5691381f0c89/revisions/3",
            "ref": "e8878fdb-4031-423c-a12b-5691381f0c89",
            "name": "MANAGE MY BOOKING OFFERS",
            "modifiedByUserRef": "843c775e-db9c-49f6-9f56-e3999123bcf4",
            "modifiedAt": "2018-10-10T15:14:40.233Z",
            "revision": 3,
            "archived": false,
            "deploymentConfiguration": {
                "variants": [
                    {
                        "variantRef": "19700f15-4069-4121-b709-1031118677c8",
                        "split": 80,
                        "status": "PRODUCTION",
                        "variantRevision": 1
                    },
                    {
                        "variantRef": "42e882a5-c8a8-4149-be76-343409d10c1c",
                        "split": 20,
                        "status": "PRODUCTION",
                        "variantRevision": 1
                    }
                ]
            },
            "variants": {
                "href": "https://dev-api.boxever.com/v2/decisionModelDefinitions/e8878fdb-4031-423c-a12b-5691381f0c89/variants"
            },
            "revisions": {
                "href": "https://dev-api.boxever.com/v2/decisionModelDefinitions/e8878fdb-4031-423c-a12b-5691381f0c89/revisions"
            }
        },
        {
            "clientKey": "pqsPERS3lw12v5a9rrHPW1c4hET73GxQ",
            "href": "https://dev-api.boxever.com/v2/decisionModelDefinitions/e8878fdb-4031-423c-a12b-5691381f0c89/revisions/2",
            "ref": "e8878fdb-4031-423c-a12b-5691381f0c89",
            "name": "MANAGE MY BOOKING OFFERS",
            "modifiedByUserRef": "843c775e-db9c-49f6-9f56-e3999123bcf4",
            "modifiedAt": "2018-10-10T15:14:13.947Z",
            "revision": 2,
            "archived": false,
            "deploymentConfiguration": {
                "variants": [
                    {
                        "variantRef": "19700f15-4069-4121-b709-1031118677c8",
                        "split": 100,
                        "status": "PRODUCTION",
                        "variantRevision": 1
                    }
                ]
            },
            "variants": {
                "href": "https://dev-api.boxever.com/v2/decisionModelDefinitions/e8878fdb-4031-423c-a12b-5691381f0c89/variants"
            },
            "revisions": {
                "href": "https://dev-api.boxever.com/v2/decisionModelDefinitions/e8878fdb-4031-423c-a12b-5691381f0c89/revisions"
            }
        },
        {
            "clientKey": "pqsPERS3lw12v5a9rrHPW1c4hET73GxQ",
            "href": "https://dev-api.boxever.com/v2/decisionModelDefinitions/e8878fdb-4031-423c-a12b-5691381f0c89/revisions/1",
            "ref": "e8878fdb-4031-423c-a12b-5691381f0c89",
            "name": "MANAGE MY BOOKING OFFERS",
            "modifiedByUserRef": "843c775e-db9c-49f6-9f56-e3999123bcf4",
            "modifiedAt": "2018-10-10T15:13:34.172Z",
            "revision": 1,
            "archived": false,
            "deploymentConfiguration": {
                "variants": []
            },
            "variants": {
                "href": "https://dev-api.boxever.com/v2/decisionModelDefinitions/e8878fdb-4031-423c-a12b-5691381f0c89/variants"
            },
            "revisions": {
                "href": "https://dev-api.boxever.com/v2/decisionModelDefinitions/e8878fdb-4031-423c-a12b-5691381f0c89/revisions"
            }
        }
    ]
}