Create revision of a treatment definition

post/definitions/{definitionId}/revisions
Internal-Use Only

Creates a new revision of a treatment definition based on the representation in the request body.

Request Samples

1

Response Samples

1{
2 "name": "My Treatment Definition",
3 "checkout": false,
4 "locked": false,
5 "sourceRevisionUri": "/treatmentDefinitions/definitions/6b53e248-1afb-4147-b17a-13e75b8c759b/revisions/0340f630-3ee6-4058-ad36-744619c141d5",
6 "copyTimeStamp": "2020-06-17T13:37:01.750Z",
7 "attributes": [
8 {
9 "name": "Discount",
10 "valueConstraints": {
11 "dataType": "number",
12 "format": "decimal"
13 },
14 "defaultValue": 30
15 },
16 {
17 "name": "Product",
18 "valueConstraints": {
19 "dataType": "string",
20 "enum": [
21 "iPhone",
22 "Samsung"
23 ]
24 },
25 "defaultValue": "iPhone"
26 },
27 {
28 "name": "Offertext",
29 "valueConstraints": {
30 "dataType": "string"
31 },
32 "defaultValue": "Get a new iPhone now and get 30% off iPad"
33 },
34 {
35 "name": "Budget",
36 "valueConstraints": {
37 "dataType": "number",
38 "format": "decimal",
39 "readOnly": true
40 },
41 "defaultValue": 500
42 },
43 {
44 "name": "Goal",
45 "valueConstraints": {
46 "dataType": "string",
47 "format": "date"
48 },
49 "defaultValue": "2018-07-13"
50 },
51 {
52 "name": "TimesClicked",
53 "valueConstraints": {
54 "dataType": "number",
55 "format": "integer"
56 }
57 }
58 ]
59}

Path Parameters

NameTypeRequiredDescription
definitionId
string
true

The unique identifier for the treatment definition.

Examples:
"da85cd3c-7c7a-437c-acac-eca2819c9a6d"

Query Parameters

NameTypeRequiredDescription
revisionType
string
false

Valid values are major or minor. This value determines how the server generates the major and minor numbers. If a major number is provided, the next available major version number is started. For example, if the treatment has revisions 1.0, 1.1, 1.2, 2.0, and 2.1, creating a new major revision results in 3.0. If a minor number is provided, then the next available minor revision number is reserved based on the existing revisions. For example, if the existing revisions have major and minor numbers of 1.1, 1.2, 1.3, 2.1, 2.2, and a user requests a new minor revision, then 2.3 is assigned. This parameter defaults to minor if not supplied.

Allowed values:
majorminor
fromRevisionUri
string
false

This value specifies the URI of the treatment definition revision this new treatment definition revision is being created from.This property allows for the lineage of a treatment definition to be traced. The valid format for this parameter is '/treatmentDefinitions/definitions/${definitionId}/revisions/${revisionId}'

Examples:
"/treatmentDefinitions/definitions/da85cd3c-7c7a-437c-acac-eca2819c9a6d/revisions/ba14828c-b4b6-4a3a-9246-f51dd16ffcba"

Request Body

Treatment definition details that need to be created as revision.

The representation of a treatment definition.

Example:
{"name":"My Treatment Definition","checkout":false,"locked":false,"sourceRevisionUri":"/treatmentDefinitions/definitions/6b53e248-1afb-4147-b17a-13e75b8c759b/revisions/0340f630-3ee6-4058-ad36-744619c141d5","copyTimeStamp":"2020-06-17T13:37:01.750Z","attributes":[{"name":"Discount","valueConstraints":{"dataType":"number","format":"decimal"},"defaultValue":30},{"name":"Product","valueConstraints":{"dataType":"string","enum":["iPhone","Samsung"]},"defaultValue":"iPhone"},{"name":"Offertext","valueConstraints":{"dataType":"string"},"defaultValue":"Get a new iPhone now and get 30% off iPad"},{"name":"Budget","valueConstraints":{"dataType":"number","format":"decimal","readOnly":true},"defaultValue":500},{"name":"Goal","valueConstraints":{"dataType":"string","format":"date"},"defaultValue":"2018-07-13"},{"name":"TimesClicked","valueConstraints":{"dataType":"number","format":"integer"}}]}
NameTypeRequiredDescription
name
string
true

The treatment definition name.

description
string
false

The treatment definition description.

status
string<enumeration>
false

The status of the treatment definition.

Allowed values:
validerror
eligibility
Treatment Definition Eligibility
false

Represents the eligibility details for a treatment definition. This does not represent any of the top-level media types.

attributes
array [Treatment Definition Attribute]
false

An array of treatment definition attributes.

folderType
string
false

Indicates the type of folder where the treatment definition is stored.

links
array [Link]
false

Zero or more links to related resources or operations.

version
integer
false

This media type's schema version number. This representation is version 4.

Responses

StatusMeaningDescription
201CreatedA revision of a treatment was created.HeadersSchema
400Bad RequestThe request was invalid.HeadersSchema
404Not FoundNo treatment definition exists at the requested path.HeadersSchema