Campaigns resource (Data API 19.5)

Summary

Http Method Resource Description
GET /sites/{site_id}/campaigns/{campaign_id} Action to get campaign information.
PATCH /sites/{site_id}/campaigns/{campaign_id} Updates the campaign with the specified information.
DELETE /sites/{site_id}/campaigns/{campaign_id} Deletes the campaign by ID
PUT /sites/{site_id}/campaigns/{campaign_id} Creates a campaign using the information provided.
PUT /sites/{site_id}/campaigns/{campaign_id}/coupons/{coupon_id} Action to bind a single coupon to a given campaign.
DELETE /sites/{site_id}/campaigns/{campaign_id}/coupons/{coupon_id} Action to unbind a coupon from a given campaign.
PUT /sites/{site_id}/campaigns/{campaign_id}/customer_groups/{customer_group_id} Action to bind a single customer group to a given campaign.
DELETE /sites/{site_id}/campaigns/{campaign_id}/customer_groups/{customer_group_id} Action to unbind a customer group from a given campaign.
PUT /sites/{site_id}/campaigns/{campaign_id}/promotions/{promotion_id} Action to bind a single promotion to a given campaign.
DELETE /sites/{site_id}/campaigns/{campaign_id}/promotions/{promotion_id} Action to unbind a single promotion from a given campaign.
PUT /sites/{site_id}/campaigns/{campaign_id}/slot_configurations/{slot_id}/{slot_config_id} Action to bind a slot configuration to a given campaign.
PATCH /sites/{site_id}/campaigns/{campaign_id}/slot_configurations/{slot_id}/{slot_config_id} Action to update the assignment of slot configuration to a campaign.
DELETE /sites/{site_id}/campaigns/{campaign_id}/slot_configurations/{slot_id}/{slot_config_id} Action to unbind a slot configuration from a given campaign.
PUT /sites/{site_id}/campaigns/{campaign_id}/sorting_rules/{sorting_rule_id}/{category_id} Action to bind a single sorting rule to a given campaign.
DELETE /sites/{site_id}/campaigns/{campaign_id}/sorting_rules/{sorting_rule_id}/{category_id} Action to unbind a single sorting rule from a given campaign.
PUT /sites/{site_id}/campaigns/{campaign_id}/source_code_groups/{source_code_group_id} Action to bind a single source code group to a given campaign.
DELETE /sites/{site_id}/campaigns/{campaign_id}/source_code_groups/{source_code_group_id} Action to unbind a source code group from a given campaign.

Get Campaign

Action to get campaign information.

Url

GET https://hostname:port/dw/data/v19_5/sites/{site_id}/campaigns/{campaign_id}

Formats

json, xml

Authentication

Name Description
OAuth Authentication via OAuth token.

Response Document

Campaign

Path Parameters

Parameter Type Description Constraints
campaign_id String The id of the requested campaign. minLength=1, nullable=false
site_id String The site the requested campaign belongs to. minLength=1, nullable=false

In case of a failure Fault Document is returned.

Faults

Status Type Arguments Description
404 CampaignNotFoundException

campaignId (String)

siteId (String)

Thrown in case the campaign does not exist matching the given id

Sample

REQUEST:
GET /s/-/dw/data/v19_5/sites/SiteGenesis/campaigns/my-campaign 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" : "19.5",
   "_resource_state" : "860cde3040519cce439cd99e209f8a87c3ad0b7e2813edbf6f5501f763b73bd5",
    "_type" : "campaign",
    "description" : "My Campaign",
    "enabled" : true,
    "coupons" : ["testCoupon"],
    "customer_groups" : ["Registered"],
    "source_code_groups" : ["WapiSourceCodeGroup1"],
    "start_date" : "2015-04-01T11:30:15.000Z",
    "end_date" : "2015-07-31T23:09:08.000Z"
    "link" : "https://example.com/s/-/dw/data/v19_5/sites/SiteGenesis/campaigns/my-campaign",
}

# in case of failure:
 
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":"19.5",
   "_type":"fault",
  "fault":{
    "type":"CampaignNotFoundException",
    "message":"No campaign with ID 'my-campaign' for site 'SiteGenesis' was found."
  }
}

Update Campaign

Updates the campaign with the specified information.

Url

PATCH https://hostname:port/dw/data/v19_5/sites/{site_id}/campaigns/{campaign_id}

Formats

json, xml

Authentication

Name Description
OAuth Authentication via OAuth token.

Request Document

Campaign

Response Document

Campaign

Path Parameters

Parameter Type Description Constraints
campaign_id String The id of the requested campaign. minLength=1
site_id String The site context. minLength=1

In case of a failure Fault Document is returned.

Faults

Status Type Arguments Description
400 CampaignDuplicateException

campaignId (String)

if a campaign exists already in the site with the given campaign id.
404 CampaignNotFoundException

campaignId (String)

siteId (String)

Thrown in case the campaign does not exist matching the given id

Sample

REQUEST:
PATCH /s/-/dw/data/v19_5/sites/SiteGenesis/campaigns/my-campaign HTTP/1.1
Host: example.com
Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367
{
    "_resource_state" : "847f9c3c5867f641470b3046aeec31f07757991b792d722e10079926f7a289fb",
    "description" : "My Other Campaign",
    "enabled" : false
}
# in case of success:

RESPONSE:
HTTP/1.1 200 OK
Content-Length: 67
Content-Type: application/json; charset=UTF-8
{
    "_v" : "19.5",
    "_resource_state" : "860cde3040519cce439cd99e209f8a87c3ad0b7e2813edbf6f5501f763b73bd5",
    "_type" : "campaign",
    "description" : "My Other Campaign",
    "enabled" : false,
    "coupons" : ["testCoupon"],
    "customer_groups" : ["Registered"],
    "source_code_groups" : ["WapiSourceCodeGroup1"],
    "start_date" : "2015-04-01T11:30:15.000Z",
    "end_date" : "2015-07-31T23:09:08.000Z"
    "link" : "https://example.com/s/-/dw/data/v19_5/sites/SiteGenesis/campaigns/my-campaign",
}

# 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":"19.5",
  "_type":"fault",
  "fault":{
    "type":"CampaignNotFoundException",
    "message":"No campaign with ID 'my-campaign' was found."
  }
}

Delete Campaign

Deletes the campaign by ID

Url

DELETE https://hostname:port/dw/data/v19_5/sites/{site_id}/campaigns/{campaign_id}

Formats

json, xml

Authentication

Name Description
OAuth Authentication via OAuth token.

Path Parameters

Parameter Type Description Constraints
campaign_id String A campaign id to remove  
site_id String The site context. minLength=1

Sample

REQUEST:
DELETE /s/-/dw/data/v19_5/sites/site-one/campaigns/my-campaign 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

Create Campaign

Creates a campaign using the information provided.

Url

PUT https://hostname:port/dw/data/v19_5/sites/{site_id}/campaigns/{campaign_id}

Formats

json, xml

Authentication

Name Description
OAuth Authentication via OAuth token.

Request Document

Campaign

Response Document

Campaign

Path Parameters

Parameter Type Description Constraints
campaign_id String The id of the campaign to create. minLength=1, nullable=false
site_id String The site context. minLength=1

In case of a failure Fault Document is returned.

Faults

Status Type Arguments Description
400 IdConflictException

bodyID (String)

urlID (String)

if the Id in request is not the same as the ID in document.

Sample

REQUEST:
PUT /s/-/dw/data/v19_5/sites/SiteGenesis/campaigns/campaign-registered HTTP/1.1
Host: example.com
Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367
Content-Type: application/json; charset=UTF-8

{
    "description" : "My Campaign",
    "enabled" : true,
    "coupons" : ["testCoupon"],
    "customer_groups" : ["Registered"],
    "source_code_groups" : ["WapiSourceCodeGroup1"],
    "start_date" : "2015-04-01T11:30:15.000Z",
    "end_date" : "2015-07-31T23:09:08.000Z"
}

# in case of success:
 
RESPONSE:
HTTP/1.1 201 CREATED
Content-Length: 67
Location: https://example.com/s/-/dw/data/v19_5/sites/SiteGenesis/campaigns/campaign-registered
Content-Type: application/json; charset=UTF-8
{
    "_v" : "19.5",
   "_resource_state" : "860cde3040519cce439cd99e209f8a87c3ad0b7e2813edbf6f5501f763b73bd5",
    "_type" : "campaign",
    "description" : "My Campaign",
    "enabled" : true,
    "coupons" : ["testCoupon"],
    "customer_groups" : ["Registered"],
    "source_code_groups" : ["WapiSourceCodeGroup1"],
    "start_date" : "2015-04-01T11:30:15.000Z",
    "end_date" : "2015-07-31T23:09:08.000Z"
    "link" : "https://example.com/s/-/dw/data/v19_5/sites/SiteGenesis/campaigns/campaign-registered",
}

# 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":"19.5",
    "_type":"fault",
    "fault":{
        "type":"CampaignDuplicateException",
        "message":""The campaign could not be created because of duplicate ID 'campaign-registered'."
    }
}

Bind Coupon

Action to bind a single coupon to a given campaign.

Url

PUT https://hostname:port/dw/data/v19_5/sites/{site_id}/campaigns/{campaign_id}/coupons/{coupon_id}

Formats

json, xml

Authentication

Name Description
OAuth Authentication via OAuth token.

Path Parameters

Parameter Type Description Constraints
campaign_id String The campaign ID that coupons are to be bound to minLength=1
coupon_id String The coupon ID to bind to a campaign minLength=1, nullable=false
site_id String   minLength=1

In case of a failure Fault Document is returned.

Faults

Status Type Arguments Description
400 ConstraintViolationException

mp (MethodParameter)

o (Object)

reason (String)

Indicates some parameter constraint violation occurs
404 CampaignNotFoundException

campaignId (String)

siteId (String)

Indicates that the campaign with the given campaign id is unknown.

Sample

REQUEST:
PUT /s/-/dw/data/v19_5/sites/SiteGenesis/campaigns/campaign-registered/coupons/couponOne HTTP/1.1
Host: example.com
Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367
Content-Type: application/json; charset=UTF-8
Content-Length: 0

# 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" : "19.5",
   "_resource_state" : "860cde3040519cce439cd99e209f8a87c3ad0b7e2813edbf6f5501f763b73bd5",
   "_type":"fault",
   "fault" : {
      "type" : "CampaignNotFoundException",
      "message" : "No campaign with ID 'campaign-registered' in site 'SiteGenesis' was found."
   }
}

Unbind Coupon

Action to unbind a coupon from a given campaign.

Url

DELETE https://hostname:port/dw/data/v19_5/sites/{site_id}/campaigns/{campaign_id}/coupons/{coupon_id}?removeInPCA={String}

Formats

json, xml

Authentication

Name Description
OAuth Authentication via OAuth token.

Path Parameters

Parameter Type Description Constraints
campaign_id String The campaign ID that coupons are to be unbound from minLength=1
coupon_id String The coupon ID to unbind from a campaign minLength=1, nullable=false
site_id String   minLength=1

Query Parameters

Parameter Type Description Constraints
removeInPCA String    

In case of a failure Fault Document is returned.

Faults

Status Type Arguments Description
400 ConstraintViolationException

mp (MethodParameter)

o (Object)

reason (String)

Indicates some parameter constraint violation occurs
404 CampaignNotFoundException

campaignId (String)

siteId (String)

Indicates that the campaign with the given campaign id is unknown.

Sample

REQUEST:
DELETE /s/-/dw/data/v19_5/sites/site-one/campaigns/campaign-registered/coupons/couponOne HTTP/1.1
Host: example.com
Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367
Content-Type: application/json; charset=UTF-8
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" : "19.5",
   "fault" : {
      "type" : "CampaignNotFoundException",
      "message" : "No campaign with ID 'campaign-registered' in site 'SiteGenesis' was found."
   }
}

Bind Customer Group

Action to bind a single customer group to a given campaign.

Url

PUT https://hostname:port/dw/data/v19_5/sites/{site_id}/campaigns/{campaign_id}/customer_groups/{customer_group_id}

Formats

json, xml

Authentication

Name Description
OAuth Authentication via OAuth token.

Path Parameters

Parameter Type Description Constraints
campaign_id String The campaign ID that coupons are to be bound to minLength=1
customer_group_id String The customer group ID to bind to a campaign minLength=1, nullable=false
site_id String   minLength=1

In case of a failure Fault Document is returned.

Faults

Status Type Arguments Description
400 ConstraintViolationException

mp (MethodParameter)

o (Object)

reason (String)

Indicates some parameter constraint violation occurs
404 CampaignNotFoundException

campaignId (String)

siteId (String)

Indicates that the campaign with the given campaign id is unknown.

Sample

REQUEST:
PUT /s/-/dw/data/v19_5/sites/SiteGenesis/campaigns/campaign-registered/customer_groups/TA-CustomerGroup-001 HTTP/1.1
Host: example.com
Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367
Content-Type: application/json; charset=UTF-8
Content-Length: 0

# 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" : "19.5",
   "_type":"fault",
   "fault" : {
      "type" : "CampaignNotFoundException",
      "message" : "No campaign with ID 'campaign-registered' in site 'SiteGenesis' was found."
   }
}

Unbind Customer Group

Action to unbind a customer group from a given campaign.

Url

DELETE https://hostname:port/dw/data/v19_5/sites/{site_id}/campaigns/{campaign_id}/customer_groups/{customer_group_id}

Formats

json, xml

Authentication

Name Description
OAuth Authentication via OAuth token.

Path Parameters

Parameter Type Description Constraints
campaign_id String The campaign ID that coupons are to be unbound from minLength=1
customer_group_id String The customer group ID to unbind from a campaign minLength=1, nullable=false
site_id String   minLength=1

In case of a failure Fault Document is returned.

Faults

Status Type Arguments Description
400 ConstraintViolationException

mp (MethodParameter)

o (Object)

reason (String)

Indicates some parameter constraint violation occurs
404 CampaignNotFoundException

campaignId (String)

siteId (String)

Indicates that the campaign with the given campaign id is unknown.

Sample

REQUEST:
DELETE /s/-/dw/data/v19_5/sites/SiteGenesis/campaigns/campaign-registered/customer_groups/WAPI-TA-CustomerGroup-001 HTTP/1.1
Host: example.com
Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367
Content-Type: application/json; charset=UTF-8
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" : "19.5",
   "fault" : {
      "type" : "CampaignNotFoundException",
      "message" : "No campaign with ID 'campaign-registered' in site 'SiteGenesis' was found."
   }
}

Bind Promotion

Action to bind a single promotion to a given campaign.

Url

PUT https://hostname:port/dw/data/v19_5/sites/{site_id}/campaigns/{campaign_id}/promotions/{promotion_id}

Formats

json, xml

Authentication

Name Description
OAuth Authentication via OAuth token.

Path Parameters

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

In case of a failure Fault Document is returned.

Faults

Status Type Arguments Description
404 SiteNotFoundException

siteId (String)

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

campaignId (String)

siteId (String)

Indicates that the campaign with the given campaign ID is not found.
404 PromotionNotFoundException

promotionId (String)

siteId (String)

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

Sample

REQUEST:
PUT /s/-/dw/data/v19_5/sites/SiteGenesis/campaigns/my-campaign/promotions/my-promotion
HTTP/1.1
Host: example.com
Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367

# in case of success:

RESPONSE:
HTTP/1.1 204 NO CONTENT
Content-Length: 0

# 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":"19.5",
  "fault":{
    "type":"CampaignNotFoundException",
    "message":"No campaign with ID 'my-campaign' for site 'SiteGenesis' was found."
  }
}

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":"19.5",
  "fault":{
    "type":"PromotionNotFoundException",
    "message":"No promotion with ID 'my-promotion' for site 'SiteGenesis' was found."
  }
}

Unbind Promotion

Action to unbind a single promotion from a given campaign.

Url

DELETE https://hostname:port/dw/data/v19_5/sites/{site_id}/campaigns/{campaign_id}/promotions/{promotion_id}

Formats

json, xml

Authentication

Name Description
OAuth Authentication via OAuth token.

Path Parameters

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

In case of a failure Fault Document is returned.

Faults

Status Type Arguments Description
404 SiteNotFoundException

siteId (String)

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

campaignId (String)

siteId (String)

Indicates that the campaign with the given campaign ID is not found.
404 PromotionNotFoundException

promotionId (String)

siteId (String)

Indicates that the campaign with the given promotion ID is not found.

Sample

REQUEST:
DELETE /s/-/dw/data/v19_5/sites/SiteGenesis/campaigns/my-campaign/promotions/my-promotion
HTTP/1.1
Host: example.com
Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367

# in case of success:

RESPONSE:
HTTP/1.1 204 NO CONTENT
Content-Length: 0

# 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":"19.5",
  "fault":{
    "type":"CampaignNotFoundException",
    "message":"No campaign with ID 'my-campaign' for site 'SiteGenesis' was found."
  }
}

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":"19.5",
  "fault":{
    "type":"PromotionNotFoundException",
    "message":"No promotion with ID 'my-promotion' for site 'SiteGenesis' was found."
  }
}

Bind Slot Configuration to Campaign

Action to bind a slot configuration to a given campaign.

Url

PUT https://hostname:port/dw/data/v19_5/sites/{site_id}/campaigns/{campaign_id}/slot_configurations/{slot_id}/{slot_config_id}?context={String}

Formats

json, xml

Authentication

Name Description
OAuth Authentication via OAuth token.

Request Document

SlotConfigurationCampaignAssignment

Path Parameters

Parameter Type Description Constraints
campaign_id String The ID of the campaign. 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 ID 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"
400 IdConflictException

bodyID (String)

urlID (String)

Indicates the ID in the URL does not match the ID in the request
404 SiteNotFoundException

siteId (String)

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

campaignId (String)

siteId (String)

Indicates that the campaign with the given campaign 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 (Enum {global, category, folder})

contextId (String)

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

Sample

REQUEST:
PUT /s/-/dw/data/v19_5/sites/SiteGenesis/campaigns/campaign-registered/slot_configurations/my-slot1/my-slot-config2?context=category=my-category1 HTTP/1.1
Host: example.com
Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367
Content-Length: 0

Request Body:
{
    "slot_id" : "my-slot1",
    "slot_configuration_id" : "my-slot-config2",
    "context_id" : "my-category1",
    "context_type" : "category",
    "rank": 90,
    "schedule": {
                "start_date": "2010-04-29T20:20:20.000Z"
                "end_date":"2022-02-25T21:19:17.000Z"
                "recurrence": {
                              "day_of_week": ["thursday","sunday","saturday"],
                              "time_of_day": {
                                             "time_from": "01:14:00",
                                             "time_to":"20:00:00"
                                             }
                              }
                },
    "customer_groups" : ["CustomerGroup1", "Unregistered"]
}

# in case of success:

RESPONSE:
HTTP/1.1 204 NO CONTENT
Content-Length: 0

# 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":"19.5",
  "fault":{
    "type":"CampaignNotFoundException",
    "message":"No campaign with ID 'campaign-registered' 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":"19.5",
  "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":"19.5",
  "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":"19.5",
  "fault":{
    "type":"InvalidContextTypeException",
    "message":"'invalid' is not a valid context."
  }
}

Update Slot Configuration Campaign Assignment

Action to update the assignment of slot configuration to a campaign.

Url

PATCH https://hostname:port/dw/data/v19_5/sites/{site_id}/campaigns/{campaign_id}/slot_configurations/{slot_id}/{slot_config_id}?context={String}

Formats

json, xml

Authentication

Name Description
OAuth Authentication via OAuth token.

Request Document

SlotConfigurationCampaignAssignment

Path Parameters

Parameter Type Description Constraints
campaign_id String The ID of the campaign. 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 ID 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 SiteNotFoundException

siteId (String)

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

campaignId (String)

siteId (String)

Indicates that the campaign with the given campaign 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 (Enum {global, category, folder})

contextId (String)

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

Sample

REQUEST:
PATCH /s/-/dw/data/v19_5/sites/SiteGenesis/campaigns/campaign-registered/slot_configurations/my-slot1/my-slot-config2?context=category=my-category1 HTTP/1.1
Host: example.com
Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367
Content-Length: 0

Request Body:
{
    "slot_id" : "my-slot1",
    "slot_configuration_id" : "my-slot-config2",
    "context_id" : "my-category1",
    "context_type" : "category",
    "rank": 90,
    "schedule": {
                    "start_date": "2010-04-29T20:20:20.000Z"
                    "end_date":"2022-02-25T21:19:17.000Z"
                    "recurrence": {
                                  "day_of_week": ["thursday","sunday","saturday"],
                                  "time_of_day": {
                                                 "time_from": "01:14:00",
                                                 "time_to":"20:00:00"
                                                 }
                                  }
                    },
    "customer_groups" : ["CustomerGroup1", "Unregistered"]
}

# in case of success:

RESPONSE:
HTTP/1.1 204 NO CONTENT
Content-Length: 0

# 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":"19.5",
  "fault":{
    "type":"CampaignNotFoundException",
    "message":"No campaign with ID 'campaign-registered' 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":"19.5",
  "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":"19.5",
  "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":"19.5",
  "fault":{
    "type":"InvalidContextTypeException",
    "message":"'invalid' is not a valid context."
  }
}

Unbind SlotConfiguration

Action to unbind a slot configuration from a given campaign.

Url

DELETE https://hostname:port/dw/data/v19_5/sites/{site_id}/campaigns/{campaign_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
campaign_id String The id of the campaign 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 SiteNotFoundException

siteId (String)

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

campaignId (String)

siteId (String)

Indicates that the campaign with the given campaign 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 (Enum {global, category, folder})

contextId (String)

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

Sample

REQUEST:
DELETE /s/-/dw/data/v19_5/sites/SiteGenesis/campaigns/campaign-registered/slot_configurations/my-slot1/my-slot-config2?context=category=my-category1 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
Content-Length: 0

# 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":"19.5",
  "fault":{
    "type":"CampaignNotFoundException",
    "message":"No campaign with ID 'campaign-registered' 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":"19.5",
  "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":"19.5",
  "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":"19.5",
  "fault":{
    "type":"InvalidContextTypeException",
    "message":"'invalid' is not a valid context."
  }
}

Bind SortingRule

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

Url

PUT https://hostname:port/dw/data/v19_5/sites/{site_id}/campaigns/{campaign_id}/sorting_rules/{sorting_rule_id}/{category_id}?rule_context={String}

Formats

json, xml

Authentication

Name Description
OAuth Authentication via OAuth token.

Path Parameters

Parameter Type Description Constraints
campaign_id String The ID of the campaign 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
site_id String The ID of the site that contains the campaign, sorting rule and category. minLength=1
sorting_rule_id String The ID of sorting rule that is to be assigned to the campaign. minLength=1

Query Parameters

Parameter Type Description Constraints
rule_context String The context in which the rule lives, either "site" or "global"the optional context of the sorting rule, either "site" (default) or "global" strings=[<error>, <error>]

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 SiteNotFoundException

siteId (String)

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

campaignId (String)

siteId (String)

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

sortingRuleId (String)

siteId (String)

Indicates that the sorting rule with the given sorting rule 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 campaign ID and category ID. The sorting rule with the given sorting rule ID cannot be assigned to the same campaign ID and category ID.

Sample

REQUEST:
PUT /s/-/dw/data/v19_5/sites/SiteGenesis/campaigns/my-campaign/sorting_rules/my-sorting-rule?rule-context=site HTTP/1.1
Host: example.com
Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367

# in case of success:

RESPONSE:
HTTP/1.1 204 NO CONTENT
Content-Length: 0

# 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":"19.5",
  "fault":{
    "type":"CampaignNotFoundException",
    "message":"No campaign with ID 'my-campaign' 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":"19.5",
  "fault":{
    "type":"SortingRuleNotFoundException",
    "message":"No sorting rule with ID 'my-sorting-rule' for site 'SiteGenesis' was found."
  }
}

UnBind SortingRule

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

Url

DELETE https://hostname:port/dw/data/v19_5/sites/{site_id}/campaigns/{campaign_id}/sorting_rules/{sorting_rule_id}/{category_id}?rule_context={String}

Formats

json, xml

Authentication

Name Description
OAuth Authentication via OAuth token.

Path Parameters

Parameter Type Description Constraints
campaign_id String The ID of the campaign 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
site_id String The ID of the site that contains the campaign, sorting rule and category. minLength=1
sorting_rule_id String The ID of sorting rule that is to be assigned to the campaign. minLength=1

Query Parameters

Parameter Type Description Constraints
rule_context String The context in which the rule lives, either "site" or "global"the optional context of the sorting rule, either "site" (default) or "global" strings=[<error>, <error>]

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 SiteNotFoundException

siteId (String)

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

campaignId (String)

siteId (String)

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

sortingRuleId (String)

siteId (String)

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

Sample

REQUEST:
DELETE /s/-/dw/data/v19_5/sites/SiteGenesis/campaigns/campaign-registered/sorting_rules/my-sorting-rule?rule-context=site HTTP/1.1
Host: example.com
Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367

# in case of success:

RESPONSE:
HTTP/1.1 204 NO CONTENT
Content-Length: 0

# 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":"19.5",
  "fault":{
    "type":"CampaignNotFoundException",
    "message":"No campaign with ID 'my-campaign' 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":"19.5",
  "fault":{
    "type":"SortingRuleNotFoundException",
    "message":"No sorting rule with ID 'my-sorting-rule' for site 'SiteGenesis' was found."
  }
}

Bind Source Code Group

Action to bind a single source code group to a given campaign.

Url

PUT https://hostname:port/dw/data/v19_5/sites/{site_id}/campaigns/{campaign_id}/source_code_groups/{source_code_group_id}

Formats

json, xml

Authentication

Name Description
OAuth Authentication via OAuth token.

Path Parameters

Parameter Type Description Constraints
campaign_id String The campaign ID that source code group are to be bound to minLength=1
site_id String   minLength=1
source_code_group_id String The source code group ID to bind to a campaign minLength=1, nullable=false

In case of a failure Fault Document is returned.

Faults

Status Type Arguments Description
400 ConstraintViolationException

mp (MethodParameter)

o (Object)

reason (String)

Indicates some parameter constraint violation occurs
404 CampaignNotFoundException

campaignId (String)

siteId (String)

Indicates that the campaign with the given campaign id is unknown.

Sample

REQUEST:
PUT /s/-/dw/data/v19_5/sites/SiteGenesis/campaigns/campaign-registered/source_code_groups/scg1 HTTP/1.1
Host: example.com
Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367
Content-Type: application/json; charset=UTF-8
Content-Length: 0

# 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" : "19.5",
   "_type":"fault",
   "fault" : {
      "type" : "CampaignNotFoundException",
      "message" : "No campaign with ID 'campaign-registered' in site 'SiteGenesis' was found."
   }
}

Unbind Source Code Group

Action to unbind a source code group from a given campaign.

Url

DELETE https://hostname:port/dw/data/v19_5/sites/{site_id}/campaigns/{campaign_id}/source_code_groups/{source_code_group_id}

Formats

json, xml

Authentication

Name Description
OAuth Authentication via OAuth token.

Path Parameters

Parameter Type Description Constraints
campaign_id String The campaign ID that source code groups are to be unbound from minLength=1
site_id String   minLength=1
source_code_group_id String The source code group ID to unbind from a campaign minLength=1, nullable=false

In case of a failure Fault Document is returned.

Faults

Status Type Arguments Description
400 ConstraintViolationException

mp (MethodParameter)

o (Object)

reason (String)

Indicates some parameter constraint violation occurs
404 CampaignNotFoundException

campaignId (String)

siteId (String)

Indicates that the campaign with the given campaign id is unknown.

Sample

REQUEST:
DELETE /s/-/dw/data/v19_5/sites/SiteGenesis/campaigns/campaign-registered/source_code_groups/scg1 HTTP/1.1
Host: example.com
Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367
Content-Type: application/json; charset=UTF-8
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" : "19.5",
   "fault" : {
      "type" : "CampaignNotFoundException",
      "message" : "No campaign with ID 'campaign-registered' in site 'SiteGenesis' was found."
   }
}