AbTests resource (Data API 17.8)

Summary

Http Method Resource Description
GET /sites/{site_id}/ab_tests Action to get all the A/B tests with no filtering.
GET /sites/{site_id}/ab_tests/{ab_test_id}/segments/{segment_id} Gets an A/B Test segment using the information provided.
PUT /sites/{site_id}/ab_tests/{ab_test_id}/segments/{segment_id} Creates an A/B Test segment using the information provided.
PATCH /sites/{site_id}/ab_tests/{ab_test_id}/segments/{segment_id} Updates an A/B Test segment using the information provided.
DELETE /sites/{site_id}/ab_tests/{ab_test_id}/segments/{segment_id} Deletes the A/B Test by ID
PUT /sites/{site_id}/ab_tests/{ab_test_id}/segments/{segment_id}/promotions/{promotion_id} Action to bind a single promotion to a given abTest.
DELETE /sites/{site_id}/ab_tests/{ab_test_id}/segments/{segment_id}/promotions/{promotion_id} Action to unbind one promotions from a given abTest.
PUT /sites/{site_id}/ab_tests/{ab_test_id}/segments/{segment_id}/slot_configurations/{slot_id}/{slot_config_id} Action to bind a slot configuration to a given abTest.
DELETE /sites/{site_id}/ab_tests/{ab_test_id}/segments/{segment_id}/slot_configurations/{slot_id}/{slot_config_id} Action to unbind a slot configuration from a given abTest.
PUT /sites/{site_id}/ab_tests/{ab_test_id}/segments/{segment_id}/sorting_rules/{sorting_rule_id}/{category_id} Action to bind a single sorting rule to a given abTest.
DELETE /sites/{site_id}/ab_tests/{ab_test_id}/segments/{segment_id}/sorting_rules/{sorting_rule_id}/{category_id} Action to unbind a single sorting rule from a given abTest.
GET /sites/{site_id}/ab_tests/{id} Action to get an A/B Test information.
PATCH /sites/{site_id}/ab_tests/{id} Updates the A/B Test with the specified information.
DELETE /sites/{site_id}/ab_tests/{id} Deletes the A/B Test by ID
PUT /sites/{site_id}/ab_tests/{id} Creates an A/B Test using the information provided.

Get AB/Tests

Action to get all the A/B tests with no filtering.

Url

GET https://hostname:port/dw/data/v17_8/sites/{site_id}/ab_tests?start={Integer}&count={Integer}&select={String}

Formats

json, xml

Authentication

Name Description
OAuth Authentication via OAuth token.

Response Document

AbTests

Path Parameters

Parameter Type Description Constraints
site_id String The site context. minLength=1

Query Parameters

Parameter Type Description Constraints
count Integer Optional count for retrieving only a subset of the items (default is 25).  
select String The property selector.  
start Integer Optional start index for retrieving the items from a given index (default 0).  

Sample

REQUEST:
GET /s/-/dw/data/v17_8/sites/SiteGenesis/ab_tests?select=(**) HTTP/1.1
Host: example.com
Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367
Accept: application/json

RESPONSE:
HTTP/1.1 200 OK
Content-Length: 67
Content-Type: application/json; charset=UTF-8

{
  "_v" : "17.8",
  "_type" : "ab_test_search_result",
  "count" : 2,
  "data" : [
    {
       "_v" : "17.8",
       "_type" : "ab_tests",
       "_resource_state":"c2309jd239jdrifj3ui4fn",
       "customer_groups" : 
       [
          "abtest_customer_group"
       ],
       "description" : "my abtest1 description",
       "email_addresses" : 
       [
          "[email protected]"
       ],
       "enabled" : true,
       "end_date" : "2015-07-31T23:09:08.000Z",
       "expiration_type" : "session",
       "id" : "my-abtest1",
       "key_metric_id" : "abtest_key_metric_id",
       "link" : "https://example.com/s/-/dw/data/v17.8/sites/SiteGenesis/ab_tests/my-abtest1",
       "paused" : true,
       "start_date" : "2015-04-01T11:30:15.000Z",
       "tags" : 
       [
          "abtest_tag"
       ],
       "test_groups" : 
       [
          {
             "_type" : "ab_test_group",
             "allocation" : 20,
             "custom_experience" : false,
             "id" : "Control"
          },
          {
             "_type" : "ab_test_group",
             "allocation" : 40,
             "custom_experience" : false,
             "description" : "A description",
             "id" : "Test Segment A"
          },
          {
             "_type" : "ab_test_group",
             "allocation" : 40,
             "custom_experience" : false,
             "id" : "Test Segment B"
          }
       ],   
       "trigger" : 
       {
          "_type" : "ab_test_trigger",
          "is_pipeline_based" : false,
          "trigger_type" : "immediately"
       }    
    },
    {
       "_v" : "17.8",
       "_type" : "ab_test",
       "_resource_state":"9g9jrfc93jr03fr09sdcjk",
       "customer_groups" : 
       [
          "abtest_customer_group"
       ],
       "description" : "my abtest2 description",
       "email_addresses" : 
       [
          "[email protected]"
       ],
       "enabled" : true,
       "end_date" : "2015-07-31T23:09:08.000Z",
       "expiration_type" : "session",
       "id" : "my-abtest2",
       "key_metric_id" : "abtest_key_metric_id",
       "link" : "https://example.com/s/-/dw/data/v17.8/sites/SiteGenesis/ab_tests/my-abtest2",
       "paused" : true,
       "start_date" : "2015-04-01T11:30:15.000Z",
       "tags" : 
       [
          "abtest_tag"
       ],
       "test_groups" : 
       [
          {
             "_type" : "ab_test_group",
             "allocation" : 20,
             "custom_experience" : false,
             "id" : "Control"
          },
          {
             "_type" : "ab_test_group",
             "allocation" : 80,
             "custom_experience" : false,
             "id" : "Test Segment B"
          }
       ],   
       "trigger" : 
       {
          "_type" : "ab_test_trigger",
          "is_pipeline_based" : true,
          "trigger_type" : "pipeline_call",
          "pipeline_calls" :
          [
              "My-Pipeline"
          ]
       }
    }
  ],
  "select": "**",
  "start" : 0,
  "total" : 2
}

Creates A/B Test Segment

Gets an A/B Test segment using the information provided.

Url

GET https://hostname:port/dw/data/v17_8/sites/{site_id}/ab_tests/{ab_test_id}/segments/{segment_id}?expand={String}

Formats

json, xml

Authentication

Name Description
OAuth Authentication via OAuth token.

Response Document

AbTestSegment

Path Parameters

Parameter Type Description Constraints
ab_test_id String The id of the A/B Test. minLength=1
segment_id String The id of the segment in the test. minLength=1
site_id String The id of the site. minLength=1

Query Parameters

Parameter Type Description Constraints
expand String    

In case of a failure Fault Document is returned.

Faults

Status Type Arguments Description
404 ABTestNotFoundException

abtestId (String)

siteId (String)

Thrown if the A/B Test cannot be found
404 ABTestSegmentNotFoundException

abtestId (String)

abTestSegmentId (String)

siteId (String)

Thrown if the segment cannot be found in the A/B Test provided

Sample


REQUEST:
GET  /s/-/dw/data/v17_8/sites/SiteGenesis/ab_tests/my-abtest/segments/my-segment HTTP/1.1
Host: example.com
Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367
Content-Type: application/json; charset=UTF-8

# in case of success:
 
RESPONSE:
HTTP/1.1 200 OK
Expires: Thu, 01-Aug-2014 00:00:00 GMT
{
   "_v" : "17.8",
   "_resource_state" : "860cde3040519cce439cd99e209f8a87c3ad0b7e2813edbf6f5501f763b73bd5",
   "_type" : "ab_test",
   "customer_groups" :
   [
      "abtest_customer_group"
   ],
   "description" : "abtest description",
   "email_addresses" : 
   [
      "[email protected]"
   ],
   "enabled" : true,
   "end_date" : "2015-07-31T23:09:08.000Z",
   "expiration_type" : "session",
   "id" : "my-abtest",
   "key_metric_id" : "abtest_key_metric_id",
   "link" : "https://example.com/s/-/dw/data/v17_8/sites/SiteGenesis/ab_tests/my-abtest",
   "paused" : true,
   "start_date" : "2015-04-01T11:30:15.000Z",
   "tags" : 
   [
      "abtest_tag"
   ],
   "test_segments" :
   [
      {
         "_type" : "ab_test_segment",
         "allocation" : 20,
         "custom_experience" : false,
         "id" : "Control"
      },
      {
         "_type" : "ab_test_segment",
         "allocation" : 40,
         "custom_experience" : false,
         "description" : "A description",
         "id" : "Test Segment A"
      },
      {
         "_type" : "ab_test_segment",
         "allocation" : 40,
         "custom_experience" : false,
         "id" : "Test Segment B"
      }
   ],   
   "trigger" : 
   {
      "_type" : "ab_test_trigger",
      "is_pipeline_based" : false,
      "trigger_type" : "immediately"
   }
   
}

RESPONSE:
HTTP/1.1 404 Not Found
Expires: Thu, 01-Jan-1970 00:00:00 GMT
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=0,no-cache,no-store,must-revalidate
{
  "_v":"17.8",
  "fault":{
    "type":"ABTestNotFoundException",
    "message":"No ab_test with ID 'my-abtest' for site 'SiteGenesis' was found."
  }
}

RESPONSE:
HTTP/1.1 404 Not Found
Expires: Thu, 01-Jan-1970 00:00:00 GMT
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=0,no-cache,no-store,must-revalidate
{
  "_v":"17.8",
  "fault":{
    "type":"ABTesSegmentNotFoundException",
    "message":"No segment with ID 'my-segment' in A/B test 'my-abtest' for site 'SiteGenesis' was found."
  }
}

Creates A/B Test Segment

Creates an A/B Test segment using the information provided.

Url

PUT https://hostname:port/dw/data/v17_8/sites/{site_id}/ab_tests/{ab_test_id}/segments/{segment_id}

Formats

json, xml

Authentication

Name Description
OAuth Authentication via OAuth token.

Request Document

AbTestSegment

Response Document

AbTestSegment

Path Parameters

Parameter Type Description Constraints
ab_test_id String The id of the A/B Test. minLength=1
segment_id String The id of the segment in the test. minLength=1
site_id String The id of the site. minLength=1

In case of a failure Fault Document is returned.

Faults

Status Type Arguments Description
400 IdConflictException

bodyID (String)

urlID (String)

THrown if the A/B Test abtestId in the url is different from the request body
404 ABTestNotFoundException

abtestId (String)

siteId (String)

Thrown if the A/B Test cannot be found
409 ResourceAlreadyExistsException

serverState (String)

Thrown if the A/B test segment already existed but expected not to exist.

Sample

REQUEST:
PUT /s/-/dw/data/v17_8/sites/SiteGenesis/abtests/my-abtest/segments/my-segment HTTP/1.1
Host: example.com
Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367
{
   "description" : "segment description",
   "allocation": 40,
   "custom_experience": false
}

# in case of success:

RESPONSE:
HTTP/1.1 201 CREATED
Content-Length: 67
Location: https://example.com/s/-/dw/data/v17_8/sites/SiteGenesis/abtests/my-abtest
Content-Type: application/json; charset=UTF-8
{
   "_v" : "17.8",
   "_resource_state" : "860cde3040519cce439cd99e209f8a87c3ad0b7e2813edbf6f5501f763b73bd5",
   "_type" : "ab_test_segment",
   "allocation": 40,
   "custom_experience": false
   "description" : "segment description",
   "id" : "my-segment",
   "link" : "https://example.com/s/-/dw/data/v17_8/sites/SiteGenesis/ab_tests/my-abtest/segments/my-segment",
}

# in case of failure:

RESPONSE:
HTTP/1.1 404 Not Found
Expires: Thu, 01-Jan-1970 00:00:00 GMT
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=0,no-cache,no-store,must-revalidate
{
  "_v":"17.8",
  "fault":{
    "type":"ABTestNotFoundException",
    "message":"No ab_test with ID 'my-abtest' for site 'SiteGenesis' was found."
  }
}

Updates A/B Test Segment

Updates an A/B Test segment using the information provided.

Url

PATCH https://hostname:port/dw/data/v17_8/sites/{site_id}/ab_tests/{ab_test_id}/segments/{segment_id}

Formats

json, xml

Authentication

Name Description
OAuth Authentication via OAuth token.

Request Document

AbTestSegment

Response Document

AbTestSegment

Path Parameters

Parameter Type Description Constraints
ab_test_id String The id of the A/B Test. minLength=1
segment_id String The id of the segment in the test. minLength=1
site_id String The id of the site. minLength=1

In case of a failure Fault Document is returned.

Faults

Status Type Arguments Description
404 ABTestNotFoundException

abtestId (String)

siteId (String)

Thrown if the A/B Test cannot be found
404 ABTestSegmentNotFoundException

abtestId (String)

abTestSegmentId (String)

siteId (String)

Thrown if the segment cannot be found in the A/B Test provided

Sample

REQUEST:
PATCH /s/-/dw/data/v17_8/sites/SiteGenesis/abtests/my-abtest/segments/my-segment HTTP/1.1
Host: example.com
Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367
{
   "description" : "modified description",
   "allocation": 10
}

# in case of success:

RESPONSE:
HTTP/1.1 200 SUCCESS
Content-Length: 67
Location: https://example.com/s/-/dw/data/v17_8/sites/SiteGenesis/abtests/my-abtest
Content-Type: application/json; charset=UTF-8
{
   "_v" : "17.8",
   "_resource_state" : "860cde3040519cce439cd99e209f8a87c3ad0b7e2813edbf6f5501f763b73bd5",
   "_type" : "ab_test_segment",
   "allocation": 10,
   "description" : "modified description",
   "id" : "my-segment",
   "link" : "https://example.com/s/-/dw/data/v17_8/sites/SiteGenesis/ab_tests/my-abtest/segments/my-segment",
}

# in case of failure:

RESPONSE:
HTTP/1.1 404 Not Found
Expires: Thu, 01-Jan-1970 00:00:00 GMT
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=0,no-cache,no-store,must-revalidate
{
  "_v":"17.8",
  "fault":{
    "type":"ABTestNotFoundException",
    "message":"No ab_test with ID 'my-abtest' for site 'SiteGenesis' was found."
  }
}

RESPONSE:
HTTP/1.1 404 Not Found
Expires: Thu, 01-Jan-1970 00:00:00 GMT
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=0,no-cache,no-store,must-revalidate
{
  "_v":"17.8",
  "fault":{
    "type":"ABTesSegmentNotFoundException",
    "message":"No segment with ID 'my-segment' in A/B test 'my-abtest' for site 'SiteGenesis' was found."
  }
}

Delete A/B Test Segments

Deletes the A/B Test by ID

Url

DELETE https://hostname:port/dw/data/v17_8/sites/{site_id}/ab_tests/{ab_test_id}/segments/{segment_id}

Formats

json, xml

Authentication

Name Description
OAuth Authentication via OAuth token.

Path Parameters

Parameter Type Description Constraints
ab_test_id String One A/B Test abtestid that the segment belongs to minLength=1
segment_id String The A/B Test segment ID to be removed minLength=1
site_id String The abtestid of the site. minLength=1

In case of a failure Fault Document is returned.

Faults

Status Type Arguments Description
404 ABTestNotFoundException

abtestId (String)

siteId (String)

Thrown if the A/B Test cannot be found
404 ABTestSegmentNotFoundException

abtestId (String)

abTestSegmentId (String)

siteId (String)

Thrown if the segment cannot be found in the A/B Test provided

Sample

REQUEST:
DELETE /s/-/dw/data/v17_8/sites/SiteGenesis/ab_tests/my-abtest/segments/my-segment HTTP/1.1
Host: example.com
Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367
x-dw-resource-state: 860cde3040519cce439cd99e209f8a87c3ad0b7e2813edbf6f5501f763b73bd5

# in case of success:

RESPONSE:
HTTP/1.1 204 No Content

# in case of failure:

RESPONSE:
HTTP/1.1 404 Not Found
Expires: Thu, 01-Jan-1970 00:00:00 GMT
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=0,no-cache,no-store,must-revalidate
{
  "_v":"17.8",
  "fault":{
    "type":"ABTestNotFoundException",
    "message":"No ab_test with ID 'my-abtest' for site 'SiteGenesis' was found."
  }
}

RESPONSE:
HTTP/1.1 404 Not Found
Expires: Thu, 01-Jan-1970 00:00:00 GMT
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=0,no-cache,no-store,must-revalidate
{
  "_v":"17.8",
  "fault":{
    "type":"ABTesSegmentNotFoundException",
    "message":"No segment with ID 'my-segment' in A/B test 'my-abtest' for site 'SiteGenesis' was found."
  }
}

Bind Promotion

Action to bind a single promotion to a given abTest.

Url

PUT https://hostname:port/dw/data/v17_8/sites/{site_id}/ab_tests/{ab_test_id}/segments/{segment_id}/promotions/{promotion_id}

Formats

json, xml

Authentication

Name Description
OAuth Authentication via OAuth token.

Path Parameters

Parameter Type Description Constraints
ab_test_id String The ID of the abTest which contains the segment. minLength=1
promotion_id String The ID of the promotion that is to be assigned to the abTest. minLength=1
segment_id String The ID of the segment to which the promotion is to be assigned. minLength=1
site_id String The ID of the site that contains the abTest and promotion. minLength=1

In case of a failure Fault Document is returned.

Faults

Status Type Arguments Description
404 ABTestNotFoundException

abtestId (String)

siteId (String)

Indicates that the abTest with the given abTest ID is not found.
404 ABTestSegmentNotFoundException

abtestId (String)

abTestSegmentId (String)

siteId (String)

thrown when the segment with the given id is not found.
404 PromotionNotFoundException

promotionId (String)

siteId (String)

Indicates that the promotion with the given promotion ID is not found.
404 SiteNotFoundException

siteId (String)

thrown when the site with the given id is not found.

Sample

REQUEST:
PUT /s/-/dw/data/v17_8/sites/SiteGenesis/abtests/my-abtest/segments/my-segment/promotions/my-promo HTTP/1.1
Host: example.com
Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367

# in case of success:

RESPONSE:
HTTP/1.1 204 No Content

# in case of failure:

RESPONSE:
HTTP/1.1 404 Not Found
Expires: Thu, 01-Jan-1970 00:00:00 GMT
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=0,no-cache,no-store,must-revalidate
{
  "_v":"17.8",
  "fault":{
    "type":"ABTestNotFoundException",
    "message":"No ab_test with ID 'my-abtest' for site 'SiteGenesis' was found."
  }
}

RESPONSE:
HTTP/1.1 404 Not Found
Expires: Thu, 01-Jan-1970 00:00:00 GMT
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=0,no-cache,no-store,must-revalidate
{
  "_v":"17.8",
  "fault":{
    "type":"ABTesSegmentNotFoundException",
    "message":"No segment with ID 'my-segment' in A/B test 'my-abtest' for site 'SiteGenesis' was found."
  }
}

RESPONSE:
HTTP/1.1 404 Not Found
Expires: Thu, 01-Jan-1970 00:00:00 GMT
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=0,no-cache,no-store,must-revalidate
{
  "_v":"17.8",
  "fault":{
    "type":"PromotionNotFoundException",
    "message":"No promotion with ID 'my-promo' for site 'SiteGenesis' was found."
  }
}

Unbind Promotions

Action to unbind one promotions from a given abTest.

Url

DELETE https://hostname:port/dw/data/v17_8/sites/{site_id}/ab_tests/{ab_test_id}/segments/{segment_id}/promotions/{promotion_id}

Formats

json, xml

Authentication

Name Description
OAuth Authentication via OAuth token.

Path Parameters

Parameter Type Description Constraints
ab_test_id String The abTest ID that promotions are to be unbound from minLength=1
promotion_id String The ID of the promotion that is to be assigned to the abTest. minLength=1
segment_id String the segment to bind to minLength=1
site_id String   minLength=1

In case of a failure Fault Document is returned.

Faults

Status Type Arguments Description
404 ABTestNotFoundException

abtestId (String)

siteId (String)

Indicates that the abTest with the given abTest ID is not found.
404 ABTestSegmentNotFoundException

abtestId (String)

abTestSegmentId (String)

siteId (String)

thrown when the segment with the given id is not found.
404 PromotionNotFoundException

promotionId (String)

siteId (String)

thrown when promotion is not found for one of the specified promotion ids.
404 SiteNotFoundException

siteId (String)

thrown when the site with the given id is not found.

Sample

REQUEST:
DELETE /s/-/dw/data/v17_8/sites/SiteGenesis/abtests/my-abtest/segments/my-segment/promotions/my-promo HTTP/1.1
Host: example.com
Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367

# in case of success:

RESPONSE:
HTTP/1.1 204 No Content

# in case of failure:

RESPONSE:
HTTP/1.1 404 Not Found
Expires: Thu, 01-Jan-1970 00:00:00 GMT
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=0,no-cache,no-store,must-revalidate
{
  "_v":"17.8",
  "fault":{
    "type":"ABTestNotFoundException",
    "message":"No ab_test with ID 'my-abtest' for site 'SiteGenesis' was found."
  }
}

RESPONSE:
HTTP/1.1 404 Not Found
Expires: Thu, 01-Jan-1970 00:00:00 GMT
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=0,no-cache,no-store,must-revalidate
{
  "_v":"17.8",
  "fault":{
    "type":"ABTesSegmentNotFoundException",
    "message":"No segment with ID 'my-segment' in A/B test 'my-abtest' for site 'SiteGenesis' was found."
  }
}

RESPONSE:
HTTP/1.1 404 Not Found
Expires: Thu, 01-Jan-1970 00:00:00 GMT
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=0,no-cache,no-store,must-revalidate
{
  "_v":"17.8",
  "fault":{
    "type":"PromotionNotFoundException",
    "message":"No promotion with ID 'my-promo' for site 'SiteGenesis' was found."
  }
}

Bind Slot Configuration

Action to bind a slot configuration to a given abTest.

Url

PUT https://hostname:port/dw/data/v17_8/sites/{site_id}/ab_tests/{ab_test_id}/segments/{segment_id}/slot_configurations/{slot_id}/{slot_config_id}?context={String}

Formats

json, xml

Authentication

Name Description
OAuth Authentication via OAuth token.

Path Parameters

Parameter Type Description Constraints
ab_test_id String The id of the abTest minLength=1
segment_id String   minLength=1
site_id String The id of the site minLength=1
slot_config_id String The id of the slot configuration minLength=1
slot_id String The of the slot minLength=1

Query Parameters

Parameter Type Description Constraints
context String The context string, which consists of three parts: the context type (which must be folder, category or global), an equals sign (=), and the context id (either the category id or folder id). If you do not set this query parameter, the global context is used by default. minLength=1

In case of a failure Fault Document is returned.

Faults

Status Type Arguments Description
400 InvalidContextTypeException

contextType (String)

Indicates the slot context type is not one of "global", "category", or "folder"
404 ABTestNotFoundException

abtestId (String)

siteId (String)

Indicates that the abTest with the given abTest ID is not found.
404 SlotWithContextTypeNotFoundException

slotId (String)

contextType (String)

siteId (String)

Indicates that the slot with the given slot ID and context type is not found.
404 SlotConfigurationIdentifierNotFoundException

siteId (String)

slotId (String)

slotConfigurationId (String)

contextType (SlotContextClass)

contextId (String)

Indicates that the slot with the given slot ID, slot configuration ID and context type is not found.
404 ABTestSegmentNotFoundException

abtestId (String)

abTestSegmentId (String)

siteId (String)

thrown when the segment with the given id is not found.
404 SiteNotFoundException

siteId (String)

thrown when the site with the given id is not found.

Sample

REQUEST:
PUT /s/-/dw/data/v17_8/sites/SiteGenesis/abtests/my-abtest/segments/my-segment/slot_configurations/my-slot1/my-slot-config2?context=category=my-category1 HTTP/1.1
Host: example.com
Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367

# in case of success:

RESPONSE:
HTTP/1.1 204 No Content

# in case of failure:

RESPONSE:
HTTP/1.1 404 Not Found
Expires: Thu, 01-Jan-1970 00:00:00 GMT
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=0,no-cache,no-store,must-revalidate
{
  "_v":"17.8",
  "fault":{
    "type":"ABTestNotFoundException",
    "message":"No ab_test with ID 'my-abtest' for site 'SiteGenesis' was found."
  }
}

RESPONSE:
HTTP/1.1 404 Not Found
Expires: Thu, 01-Jan-1970 00:00:00 GMT
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=0,no-cache,no-store,must-revalidate
{
  "_v":"17.8",
  "fault":{
    "type":"ABTesSegmentNotFoundException",
    "message":"No segment with ID 'my-segment' in A/B test 'my-abtest' for site 'SiteGenesis' was found."
  }
}

HTTP/1.1 404 Not Found
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=0,no-cache,no-store,must-revalidate
{
  "_v":"17.8",
  "fault":{
    "type":"SlotWithContextTypeNotFoundException",
    "message":"No slot with ID 'my-slot' and context type 'CATEGORY' for site 'SiteGenesis' was found."
  }

HTTP/1.1 404 Not Found
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=0,no-cache,no-store,must-revalidate
{
  "_v":"17.8",
  "fault":{
    "type":"SlotConfigurationIdentifierNotFoundException",
    "message":"No slot configuration with ID 'my-slot-config2', slot id 'my-slot', context type 'CATEGORY', and context id '' for site 'SiteGenesis' was found."
  }
}

HTTP/1.1 400 Bad Request
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=0,no-cache,no-store,must-revalidate
{
  "_v":"17.8",
  "fault":{
    "type":"InvalidContextTypeException",
    "message":"'invalid' is not a valid context."
  }
}

Unbind Slot Configuration

Action to unbind a slot configuration from a given abTest.

Url

DELETE https://hostname:port/dw/data/v17_8/sites/{site_id}/ab_tests/{ab_test_id}/segments/{segment_id}/slot_configurations/{slot_id}/{slot_config_id}?context={String}

Formats

json, xml

Authentication

Name Description
OAuth Authentication via OAuth token.

Path Parameters

Parameter Type Description Constraints
ab_test_id String The id of the abTest minLength=1
segment_id String   minLength=1
site_id String The id of the site minLength=1
slot_config_id String The id of the slot configuration minLength=1
slot_id String The of the slot minLength=1

Query Parameters

Parameter Type Description Constraints
context String The context string, which consists of three parts: the context type (which must be folder, category or global), an equals sign (=), and the context id (either the category id or folder id). minLength=1

In case of a failure Fault Document is returned.

Faults

Status Type Arguments Description
400 InvalidContextTypeException

contextType (String)

Indicates the slot context type is not one of "global", "category", or "folder"
404 ABTestNotFoundException

abtestId (String)

siteId (String)

Indicates that the abTest with the given abTest ID is not found.
404 SlotWithContextTypeNotFoundException

slotId (String)

contextType (String)

siteId (String)

Indicates that the slot with the given slot ID and context type is not found.
404 SlotConfigurationIdentifierNotFoundException

siteId (String)

slotId (String)

slotConfigurationId (String)

contextType (SlotContextClass)

contextId (String)

Indicates that the slot with the given slot ID, slot configuration ID and context type is not found.
404 ABTestSegmentNotFoundException

abtestId (String)

abTestSegmentId (String)

siteId (String)

thrown when the segment with the given id is not found.
404 SiteNotFoundException

siteId (String)

thrown when the site with the given id is not found.

Sample

REQUEST:
DELETE /s/-/dw/data/v17_8/sites/SiteGenesis/abtests/my-abtest/segments/my-segment/slot_configurations/my-slot1/my-slot-config2?context=category=my-category1 HTTP/1.1
Host: example.com
Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367

# in case of success:

RESPONSE:
HTTP/1.1 204 No Content

# in case of failure:

RESPONSE:
HTTP/1.1 404 Not Found
Expires: Thu, 01-Jan-1970 00:00:00 GMT
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=0,no-cache,no-store,must-revalidate
{
  "_v":"17.8",
  "fault":{
    "type":"ABTestNotFoundException",
    "message":"No ab_test with ID 'my-abtest' for site 'SiteGenesis' was found."
  }
}

RESPONSE:
HTTP/1.1 404 Not Found
Expires: Thu, 01-Jan-1970 00:00:00 GMT
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=0,no-cache,no-store,must-revalidate
{
  "_v":"17.8",
  "fault":{
    "type":"ABTesSegmentNotFoundException",
    "message":"No segment with ID 'my-segment' in A/B test 'my-abtest' for site 'SiteGenesis' was found."
  }
}

HTTP/1.1 404 Not Found
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=0,no-cache,no-store,must-revalidate
{
  "_v":"17.8",
  "fault":{
    "type":"SlotWithContextTypeNotFoundException",
    "message":"No slot with ID 'my-slot' and context type 'CATEGORY' for site 'SiteGenesis' was found."
  }

HTTP/1.1 404 Not Found
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=0,no-cache,no-store,must-revalidate
{
  "_v":"17.8",
  "fault":{
    "type":"SlotConfigurationIdentifierNotFoundException",
    "message":"No slot configuration with ID 'my-slot-config2', slot id 'my-slot', context type 'CATEGORY', and context id '' for site 'SiteGenesis' was found."
  }
}

HTTP/1.1 400 Bad Request
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=0,no-cache,no-store,must-revalidate
{
  "_v":"17.8",
  "fault":{
    "type":"InvalidContextTypeException",
    "message":"'invalid' is not a valid context."
  }
}

Bind SortingRule

Action to bind a single sorting rule to a given abTest.

Url

PUT https://hostname:port/dw/data/v17_8/sites/{site_id}/ab_tests/{ab_test_id}/segments/{segment_id}/sorting_rules/{sorting_rule_id}/{category_id}

Formats

json, xml

Authentication

Name Description
OAuth Authentication via OAuth token.

Path Parameters

Parameter Type Description Constraints
ab_test_id String The ID of the abTest to which the sorting rule is to be assigned. minLength=1
category_id String The ID of the category that is associated with the sorting rule. minLength=1
segment_id String   minLength=1
site_id String The ID of the site that contains the abTest, sorting rule and category. minLength=1
sorting_rule_id String The ID of sorting rule that is to be assigned to the abTest. minLength=1

In case of a failure Fault Document is returned.

Faults

Status Type Arguments Description
400 InvalidCategoryException

categoryId (String)

Indicates that the category with the given category ID is not found.
404 ABTestNotFoundException

abtestId (String)

siteId (String)

Indicates that the abTest with the given abTest ID is not found.
404 SortingRuleNotFoundException

sortingRuleId (String)

siteId (String)

Indicates that the sorting rule with the given sorting rule ID is not found.
404 ABTestSegmentNotFoundException

abtestId (String)

abTestSegmentId (String)

siteId (String)

thrown when the segment with the given id is not found.
404 SiteNotFoundException

siteId (String)

thrown when the site with the given id is not found.
409 SortingRuleCampaignAssignConflictException

sortingRuleId (String)

campaignId (String)

categoryId (String)

existingSortingRuleId (String)

Indicates that there is a sorting rule already assigned to the given abTest ID and category ID. The sorting rule with the given sorting rule ID cannot be assigned to the same abTest ID and category ID.

Sample

REQUEST:
PUT /s/-/dw/data/v17_8/sites/SiteGenesis/abtests/my-abtest/groups/my-group/sorting_rules/my-rule/category1.1 HTTP/1.1
Host: example.com
Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367

# in case of success:

RESPONSE:
HTTP/1.1 204 No Content

# in case of failure:

RESPONSE:
HTTP/1.1 404 Not Found
Expires: Thu, 01-Jan-1970 00:00:00 GMT
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=0,no-cache,no-store,must-revalidate
{
  "_v":"17.8",
  "fault":{
    "type":"ABTestNotFoundException",
    "message":"No ab_test with ID 'my-abtest' for site 'SiteGenesis' was found."
  }
}

RESPONSE:
HTTP/1.1 404 Not Found
Expires: Thu, 01-Jan-1970 00:00:00 GMT
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=0,no-cache,no-store,must-revalidate
{
  "_v":"17.8",
  "fault":{
    "type":"ABTesGroupNotFoundException",
    "message":"No group with ID 'my-group' in A/B test 'my-abtest' for site 'SiteGenesis' was found."
  }
}

RESPONSE:
HTTP/1.1 404 Not Found
Expires: Thu, 01-Jan-1970 00:00:00 GMT
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=0,no-cache,no-store,must-revalidate
{
  "_v":"17.8",
  "fault":{
    "type":"SortingRuleNotFoundException",
    "message":"No sorting rule with ID 'my-rule' for site 'SiteGenesis' was found."
  }
}

RESPONSE:
HTTP/1.1 400 Bad Request
Expires: Thu, 01-Jan-1970 00:00:00 GMT
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=0,no-cache,no-store,must-revalidate
{
  "_v":"17.8",
  "fault":{
    "type":"InvalidCategoryException",
    "message":"The specified category with ID 'category1.1' is invalid."
  }
}

Unbind SortingRule

Action to unbind a single sorting rule from a given abTest.

Url

DELETE https://hostname:port/dw/data/v17_8/sites/{site_id}/ab_tests/{ab_test_id}/segments/{segment_id}/sorting_rules/{sorting_rule_id}/{category_id}

Formats

json, xml

Authentication

Name Description
OAuth Authentication via OAuth token.

Path Parameters

Parameter Type Description Constraints
ab_test_id String The ID of the abTest to which the sorting rule is to be assigned. minLength=1
category_id String The ID of the category that is associated with the sorting rule. minLength=1
segment_id String   minLength=1
site_id String The ID of the site that contains the abTest, sorting rule and category. minLength=1
sorting_rule_id String The ID of sorting rule that is to be assigned to the abTest. minLength=1

In case of a failure Fault Document is returned.

Faults

Status Type Arguments Description
400 InvalidCategoryException

categoryId (String)

Indicates that the category with the given category ID is not found.
404 ABTestNotFoundException

abtestId (String)

siteId (String)

Indicates that the abTest with the given abTest ID is not found.
404 SortingRuleNotFoundException

sortingRuleId (String)

siteId (String)

Indicates that the sorting rule with the given sorting rule ID is not found.
404 ABTestSegmentNotFoundException

abtestId (String)

abTestSegmentId (String)

siteId (String)

thrown when the segment with the given id is not found.
404 SiteNotFoundException

siteId (String)

thrown when the site with the given id is not found.

Sample

REQUEST:
DELETE /s/-/dw/data/v17_8/sites/SiteGenesis/abtests/my-abtest/groups/my-group/sorting_rules/my-rule/category1.1 HTTP/1.1
Host: example.com
Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367

# in case of success:

RESPONSE:
HTTP/1.1 204 No Content

# in case of failure:

RESPONSE:
HTTP/1.1 404 Not Found
Expires: Thu, 01-Jan-1970 00:00:00 GMT
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=0,no-cache,no-store,must-revalidate
{
  "_v":"17.8",
  "fault":{
    "type":"ABTestNotFoundException",
    "message":"No ab_test with ID 'my-abtest' for site 'SiteGenesis' was found."
  }
}

RESPONSE:
HTTP/1.1 404 Not Found
Expires: Thu, 01-Jan-1970 00:00:00 GMT
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=0,no-cache,no-store,must-revalidate
{
  "_v":"17.8",
  "fault":{
    "type":"ABTesGroupNotFoundException",
    "message":"No group with ID 'my-group' in A/B test 'my-abtest' for site 'SiteGenesis' was found."
  }
}

RESPONSE:
HTTP/1.1 404 Not Found
Expires: Thu, 01-Jan-1970 00:00:00 GMT
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=0,no-cache,no-store,must-revalidate
{
  "_v":"17.8",
  "fault":{
    "type":"SortingRuleNotFoundException",
    "message":"No sorting rule with ID 'my-rule' for site 'SiteGenesis' was found."
  }
}

RESPONSE:
HTTP/1.1 400 Bad Request
Expires: Thu, 01-Jan-1970 00:00:00 GMT
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=0,no-cache,no-store,must-revalidate
{
  "_v":"17.8",
  "fault":{
    "type":"InvalidCategoryException",
    "message":"The specified category with ID 'category1.1' is invalid."
  }
}

Get an A/B Test

Action to get an A/B Test information.

Url

GET https://hostname:port/dw/data/v17_8/sites/{site_id}/ab_tests/{id}?expand={String}

Formats

json, xml

Authentication

Name Description
OAuth Authentication via OAuth token.

Response Document

AbTest

Path Parameters

Parameter Type Description Constraints
id String The id of the requested A/B Test. minLength=1
site_id String The id of the site. minLength=1

Query Parameters

Parameter Type Description Constraints
expand String    

In case of a failure Fault Document is returned.

Faults

Status Type Arguments Description
404 ABTestNotFoundException

abtestId (String)

siteId (String)

Thrown in case the A/B Test does not exist matching the given id

Sample

REQUEST:
GET  /s/-/dw/data/v17_8/sites/SiteGenesis/ab_tests/my-abtest HTTP/1.1
Host: example.com
Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367
Content-Type: application/json; charset=UTF-8

# in case of success:
 
RESPONSE:
HTTP/1.1 200 OK
Expires: Thu, 01-Aug-2014 00:00:00 GMT
{
   "_v" : "17.8",
   "_resource_state" : "860cde3040519cce439cd99e209f8a87c3ad0b7e2813edbf6f5501f763b73bd5",
   "_type" : "ab_test",
   "customer_groups" : 
   [
      "abtest_customer_group"
   ],
   "description" : "abtest description",
   "email_addresses" : 
   [
      "[email protected]"
   ],
   "enabled" : true,
   "end_date" : "2015-07-31T23:09:08.000Z",
   "expiration_type" : "session",
   "id" : "my-abtest",
   "key_metric_id" : "abtest_key_metric_id",
   "link" : "https://example.com/s/-/dw/data/v17_8/sites/SiteGenesis/ab_tests/my-abtest",
   "paused" : true,
   "start_date" : "2015-04-01T11:30:15.000Z",
   "tags" : 
   [
      "abtest_tag"
   ],
   "test_groups" : 
   [
      {
         "_type" : "ab_test_group",
         "allocation" : 20,
         "custom_experience" : false,
         "id" : "Control"
      },
      {
         "_type" : "ab_test_group",
         "allocation" : 40,
         "custom_experience" : false,
         "description" : "A description",
         "id" : "Test Segment A"
      },
      {
         "_type" : "ab_test_group",
         "allocation" : 40,
         "custom_experience" : false,
         "id" : "Test Segment B"
      }
   ],   
   "trigger" : 
   {
      "_type" : "ab_test_trigger",
      "is_pipeline_based" : false,
      "trigger_type" : "immediately"
   }
   
}

# in case of failure:
 
RESPONSE:
HTTP/1.1 404 Not Found
Expires: Thu, 01-Jan-1970 00:00:00 GMT
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=0,no-cache,no-store,must-revalidate
{
  "_v":"17.8",
  "fault":{
    "type":"ABTestNotFoundException",
    "message":"No ab_test with ID 'my-abtest' for site 'SiteGenesis' was found."
  }
}

Update an A/B Test

Updates the A/B Test with the specified information.

Url

PATCH https://hostname:port/dw/data/v17_8/sites/{site_id}/ab_tests/{id}

Formats

json, xml

Authentication

Name Description
OAuth Authentication via OAuth token.

Request Document

AbTest

Response Document

AbTest

Path Parameters

Parameter Type Description Constraints
id String The id of the requested A/B Test. minLength=1
site_id String The id of the site. minLength=1

In case of a failure Fault Document is returned.

Faults

Status Type Arguments Description
400 ABTestInvalidEmailException

email (String)

abtestId (String)

Thrown if an invalid email is specified.
400 ABTestInvalidPipelineException

pipeline (String)

abtestId (String)

Thrown if an invalid pipeline is specified.
400 ABTestInvalidTriggerException

missingProperty (String)

triggerType (String)

abTestId (String)

Thrown if there is missing pipline_call or categories in the specified trigger of type pipeline_call or category_view_page respectively.
404 ABTestNotFoundException

abtestId (String)

siteId (String)

Thrown in case the A/B Test does not exist matching the given id.
409 ABTestDuplicateException

abtestId (String)

Thrown if an A/B Test exists already in the site with the given identifier specified in the body that is different from the identifier in the path.

Sample

REQUEST:
PATCH  /s/-/dw/data/v17_8/sites/SiteGenesis/ab_tests/my-abtest HTTP/1.1
Host: example.com
Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367
{
   "_resource_state" : "847f9c3c5867f641470b3046aeec31f07757991b792d722e10079926f7a289fb",
   "customer_groups" : 
   [
      "abtest_customer_group"
   ],
   "description" : "abtest description",
   "email_addresses" : 
   [
      "[email protected]"
   ],
   "enabled" : true,
   "end_date" : "2015-07-31T23:09:08.000Z",
   "expiration_type" : "session",
   "id" : "my-abtest",
   "key_metric_id" : "abtest_key_metric_id",
   "paused" : true,
   "start_date" : "2015-04-01T11:30:15.000Z",
   "tags" : 
   [
      "abtest_tag"
   ],
   "trigger" : 
   {
      "is_pipeline_based" : false,
      "trigger_type" : "immediately"
   }
}
# in case of success:

RESPONSE:
HTTP/1.1 200 OK
Content-Length: 67
Content-Type: application/json; charset=UTF-8
{
   "_v" : "17.8",
   "_resource_state" : "860cde3040519cce439cd99e209f8a87c3ad0b7e2813edbf6f5501f763b73bd5",
   "_type" : "ab_test",
   "customer_groups" : 
   [
      "abtest_customer_group"
   ],
   "description" : "abtest description",
   "email_addresses" : 
   [
      "[email protected]"
   ],
   "enabled" : true,
   "end_date" : "2015-07-31T23:09:08.000Z",
   "expiration_type" : "session",
   "id" : "my-abtest",
   "key_metric_id" : "abtest_key_metric_id",
   "link" : "https://example.com/s/-/dw/data/v17_8/sites/SiteGenesis/ab_tests/my-abtest",
   "paused" : true,
   "start_date" : "2015-04-01T11:30:15.000Z",
   "tags" : 
   [
      "abtest_tag"
   ],
   "test_groups" : 
   [
      {
         "_type" : "ab_test_group",
         "allocation" : 20,
         "custom_experience" : false,
         "id" : "Control"
      },
      {
         "_type" : "ab_test_group",
         "allocation" : 40,
         "custom_experience" : false,
         "description" : "A description",
         "id" : "Test Segment A"
      },
      {
         "_type" : "ab_test_group",
         "allocation" : 40,
         "custom_experience" : false,
         "id" : "Test Segment B"
      }
   ],   
   "trigger" : 
   {
      "_type" : "ab_test_trigger",
      "is_pipeline_based" : false,
      "trigger_type" : "immediately"
   }
}

# in case of failure:

RESPONSE:
HTTP/1.1 404 Not Found
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=0,no-cache,no-store,must-revalidate
{
  "_v":"17.8",
  "fault":{
    "type":"ABTestNotFoundException",
    "message":"No ab_test with ID 'my-abtest' for site 'SiteGenesis' was found."
  }
}

RESPONSE:
HTTP/1.1 409 Conflict
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=0,no-cache,no-store,must-revalidate
{
  "_v":"17.8",
  "fault":{
    "type":"ABTestDuplicateException",
    "message":"The A/B test could not be created or updated because of duplicate ID 'my-abtest'."
  }
}

RESPONSE:
HTTP/1.1 400 Bad Request
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=0,no-cache,no-store,must-revalidate
{
  "_v":"17.8",
  "fault":{
    "type":"ABTestInvalidEmailException",
    "message":"The email '[email protected]' specified for A/B test with ID 'my-abtest' is invalid.
  }
}

RESPONSE:
HTTP/1.1 400 Bad Request
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=0,no-cache,no-store,must-revalidate
{
  "_v":"17.8",
  "fault":{
    "type":"ABTestInvalidPipelineException",
    "message":"The pipeline 'hello' specified for A/B test with ID 'my-abtest' is invalid."
  }
}

RESPONSE:
HTTP/1.1 400 Bad Request
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=0,no-cache,no-store,must-revalidate
{
  "_v":"17.8",
  "fault":{
    "type":"ABTestInvalidTriggerException",
    "message":"'pipeline' is missing for trigger type 'PIPELINE_CALL' specified for A/B test with ID my-test'."
  }
}

RESPONSE:
HTTP/1.1 400 Bad Request
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=0,no-cache,no-store,must-revalidate
{
  "_v":"17.8",
  "fault":{
    "type":"StartAfterEndException",
    "message":"The start date '2015-04-01T11:30:15.000Z' is after the end date '2015-02-01T11:30:15.000Z' for 'ab_test' with ID 'my-test'."
  }
}

Delete A/B Tests

Deletes the A/B Test by ID

Url

DELETE https://hostname:port/dw/data/v17_8/sites/{site_id}/ab_tests/{id}

Formats

json, xml

Authentication

Name Description
OAuth Authentication via OAuth token.

Path Parameters

Parameter Type Description Constraints
id String One A/B Test id to remove  
site_id String The id of the site. minLength=1

Sample

REQUEST:
DELETE /s/-/dw/data/v17_8/sites/SiteGenesis/ab_tests/my-abtest HTTP/1.1
Host: example.com
Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367
x-dw-resource-state: 860cde3040519cce439cd99e209f8a87c3ad0b7e2813edbf6f5501f763b73bd5

# in case of success:

RESPONSE:
HTTP/1.1 204 No Content

Creates an A/B Test

Creates an A/B Test using the information provided.

Url

PUT https://hostname:port/dw/data/v17_8/sites/{site_id}/ab_tests/{id}

Formats

json, xml

Authentication

Name Description
OAuth Authentication via OAuth token.

Request Document

AbTest

Response Document

AbTest

Path Parameters

Parameter Type Description Constraints
id String The id of the A/B Test to create. maxLength=40, minLength=1
site_id String The id of the site. minLength=1

In case of a failure Fault Document is returned.

Faults

Status Type Arguments Description
400 ABTestInvalidEmailException

email (String)

abtestId (String)

Thrown if an invalid email is specified.
400 ABTestInvalidPipelineException

pipeline (String)

abtestId (String)

Thrown if an invalid pipeline is specified.
400 ABTestInvalidTriggerException

missingProperty (String)

triggerType (String)

abTestId (String)

Thrown if there is missing pipline_call or categories in the specified trigger of type pipeline_call or category_view_page respectively.
400 ABTestInvalidDateException

abtestId (String)

field (String)

date (String)

if either start date or end date is not specified.
400 IdConflictException

bodyID (String)

urlID (String)

THrown if the A/B Test id in the url is different from the request body

Sample

REQUEST:
PUT /s/-/dw/data/v17_8/sites/SiteGenesis/abtests/my-abtest HTTP/1.1
Host: example.com
Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367
{
   "customer_groups" : 
   [
      "abtest_customer_group"
   ],
   "description" : "abtest description",
   "email_addresses" : 
   [
      "[email protected]"
   ],
   "enabled" : true,
   "end_date" : "2015-07-31T23:09:08.000Z",
   "expiration_type" : "session",
   "key_metric_id" : "abtest_key_metric_id",
   "paused" : true,
   "start_date" : "2015-04-01T11:30:15.000Z",
   "tags" : 
   [
      "abtest_tag"
   ],
   "trigger" : 
   {
      "is_pipeline_based" : false,
      "trigger_type" : "immediately"
   }
}

# in case of success:

RESPONSE:
HTTP/1.1 201 CREATED
Content-Length: 67
Location: https://example.com/s/-/dw/data/v17_8/sites/SiteGenesis/abtests/my-abtest
Content-Type: application/json; charset=UTF-8
{
   "_v" : "17.8",
   "_resource_state" : "860cde3040519cce439cd99e209f8a87c3ad0b7e2813edbf6f5501f763b73bd5",
   "_type" : "ab_test",
   "customer_groups" : 
   [
      "abtest_customer_group"
   ],
   "description" : "abtest description",
   "email_addresses" : 
   [
      "[email protected]"
   ],
   "enabled" : true,
   "end_date" : "2015-07-31T23:09:08.000Z",
   "expiration_type" : "session",
   "id" : "my-abtest",
   "key_metric_id" : "abtest_key_metric_id",
   "link" : "https://example.com/s/-/dw/data/v17_8/sites/SiteGenesis/ab_tests/my-abtest",
   "paused" : true,
   "start_date" : "2015-04-01T11:30:15.000Z",
   "tags" : 
   [
      "abtest_tag"
   ],
   "test_groups" : 
   [
      {
         "_type" : "ab_test_group",
         "allocation" : 20,
         "custom_experience" : false,
         "id" : "Control"
      },
      {
         "_type" : "ab_test_group",
         "allocation" : 40,
         "custom_experience" : false,
         "description" : "A description",
         "id" : "Test Segment A"
      },
      {
         "_type" : "ab_test_group",
         "allocation" : 40,
         "custom_experience" : false,
         "id" : "Test Segment B"
      }
   ],   
   "trigger" : 
   {
      "_type" : "ab_test_trigger",
      "is_pipeline_based" : false,
      "trigger_type" : "immediately"
   }
}

# in case of failure:

RESPONSE:
HTTP/1.1 409 Conflict
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=0,no-cache,no-store,must-revalidate
{
  "_v":"17.8",
  "fault":{
    "type":"ABTestDuplicateException",
    "message":"The A/B test could not be created or updated because of duplicate ID 'my-abtest'."
  }
}

RESPONSE:
HTTP/1.1 400 Bad Request
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=0,no-cache,no-store,must-revalidate
{
  "_v":"17.8",
  "fault":{
    "type":"ABTestInvalidEmailException",
    "message":"The email '[email protected]' specified for A/B test with ID 'my-abtest' is invalid.
  }
}

RESPONSE:
HTTP/1.1 400 Bad Request
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=0,no-cache,no-store,must-revalidate
{
  "_v":"17.8",
  "fault":{
    "type":"ABTestInvalidPipelineException",
    "message":"The pipeline 'hello' specified for A/B test with ID 'my-abtest' is invalid."
  }
}

RESPONSE:
HTTP/1.1 400 Bad Request
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=0,no-cache,no-store,must-revalidate
{
  "_v":"17.8",
  "fault":{
    "type":"ABTestInvalidTriggerException",
    "message":"'pipeline' is missing for trigger type 'PIPELINE_CALL' specified for A/B test with ID my-test'."
  }
}

RESPONSE:
HTTP/1.1 400 Bad Request
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=0,no-cache,no-store,must-revalidate
{
  "_v":"17.8",
  "fault":{
    "type":"StartAfterEndException",
    "message":"The start date '2015-04-01T11:30:15.000Z' is after the end date '2015-02-01T11:30:15.000Z' for 'ab_test' with ID 'my-test'."
  }
}

RESPONSE:
HTTP/1.1 400 Bad Request
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=0,no-cache,no-store,must-revalidate
{
  "_v":"17.8",
  "fault":{
    "type":"ABTestInvalidDateException",
    "message":"The A/B test with ID ''my-test' and 'end date' '2015-02-01T11:30:15.000Z' could not be created. Please specify both the start date and the end date."
  }
}