Campaigns Resource (Data API 16.4)

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. The request must include the If-Match header, which holds the last known base-point information. The value of this header is an "ETag" representing the campaign state. If the request does not contain an If-Match header with the current server customer "ETag", a 409 (IfMatchRequiredException) fault is returned. If the If-Match header does not match the current server campaign "ETag", a 412 (InvalidIfMatchException) fault is returned.
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}/Slot_configurations/{Slot_id}/{Slot_config_id} Action to bind a slot configuration to a given 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}/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/v16_4/sites/{site_id}/campaigns/{campaign_id}

Formats

json, xml

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/v16_4/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
ETag: 43c2d7a118bd0a4034399ed86c86654b40c198ea64fd3195e5587d9211d10d7e
{
    "_v" : "16.4",
    "_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/v16_4/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":"16.4",
   "_type":"fault",
  "fault":{
    "type":"CampaignNotFoundException",
    "message":"No campaign with id 'my-campaign' for site 'SiteGenesis' found."
  }
}

Update Campaign

Updates the campaign with the specified information. The request must include the If-Match header, which holds the last known base-point information. The value of this header is an "ETag" representing the campaign state. If the request does not contain an If-Match header with the current server customer "ETag", a 409 (IfMatchRequiredException) fault is returned. If the If-Match header does not match the current server campaign "ETag", a 412 (InvalidIfMatchException) fault is returned.

Url

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

Formats

json, xml

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

Header Parameters

Parameter Type Description Constraints
If-Match String must match the last eTag  

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:
PATCH /s/-/dw/data/v16_4/sites/SiteGenesis/campaigns/my-campaign HTTP/1.1
Host: example.com
Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367
If-Match: 860cde3040519cce439cd99e209f8a87c3ad0b7e2813edbf6f5501f763b73bd5

{
    "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
ETag: 860cde3040519cce439cd99e209f8a87c3ad0b7e2813edbf6f5501f763b73bd5
{
    "_v" : "16.4",
    "_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/v16_4/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":"16.4",
   "_type":"fault",
  "fault":{
    "type":"CampaignNotFoundException",
    "message":"No campaign with id 'my-campaign' found."
  }
}

Delete Campaign

Deletes the campaign by ID

Url

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

Formats

json, xml

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/v16_4/sites/site-one/campaigns/my-campaign HTTP/1.1
Host: example.com
Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367

# 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/v16_4/sites/{site_id}/campaigns/{campaign_id}

Formats

json, xml

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/v16_4/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/v16_4/sites/SiteGenesis/campaigns/campaign-registered
Content-Type: application/json; charset=UTF-8
ETag: 860cde3040519cce439cd99e209f8a87c3ad0b7e2813edbf6f5501f763b73bd5
{
    "_v" : "16.4",
    "_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/v16_4/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":"16.4",
    "_type":"fault",
    "fault":{
        "type":"CampaignDuplicateException",
        "message":"Campaign with id 'campaign-registered' is already in use."
    }
}

Bind Coupon

Action to bind a single coupon to a given campaign.

Url

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

Formats

json, xml

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/v16_4/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" : "16.4",
   "_type":"fault",
   "fault" : {
      "type" : "CampaignNotFoundException",
      "message" : "No campaign with id 'campaign-registered' in site 'SiteGenesis' found."
   }
}

Unbind Coupon

Action to unbind a coupon from a given campaign.

Url

DELETE https://hostname:port/dw/data/v16_4/sites/{site_id}/campaigns/{campaign_id}/coupons/{coupon_id}

Formats

json, xml

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

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/v16_4/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

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

Bind Customer Group

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

Url

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

Formats

json, xml

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/v16_4/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" : "16.4",
   "_type":"fault",
   "fault" : {
      "type" : "CampaignNotFoundException",
      "message" : "No campaign with id 'campaign-registered' in site 'SiteGenesis' found."
   }
}

Unbind Customer Group

Action to unbind a customer group from a given campaign.

Url

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

Formats

json, xml

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/v16_4/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

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

Bind SlotConfiguration

Action to bind a slot configuration to a given campaign.

Url

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

Formats

json, xml

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). 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 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/v16_4/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

# 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":"16.4",
  "fault":{
    "type":"CampaignNotFoundException",
    "message":"No campaign with id 'campaign-registered' for site 'SiteGenesis' 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":"16.4",
  "fault":{
    "type":"SlotWithContextTypeNotFoundException",
    "message":"No slot with id 'my-slot' and context type 'CATEGORY' for site 'SiteGenesis' 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":"16.4",
  "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' 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":"16.4",
  "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/v16_4/sites/{site_id}/campaigns/{campaign_id}/slot_configurations/{slot_id}/{slot_config_id}?context={String}

Formats

json, xml

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 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/v16_4/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

# 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":"16.4",
  "fault":{
    "type":"CampaignNotFoundException",
    "message":"No campaign with id 'campaign-registered' for site 'SiteGenesis' 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":"16.4",
  "fault":{
    "type":"SlotWithContextTypeNotFoundException",
    "message":"No slot with id 'my-slot' and context type 'CATEGORY' for site 'SiteGenesis' 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":"16.4",
  "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' 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":"16.4",
  "fault":{
    "type":"InvalidContextTypeException",
    "message":"'invalid' is not a valid context."
  }
}

Bind Source Code Group

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

Url

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

Formats

json, xml

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/v16_4/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" : "16.4",
   "_type":"fault",
   "fault" : {
      "type" : "CampaignNotFoundException",
      "message" : "No campaign with id 'campaign-registered' in site 'SiteGenesis' found."
   }
}

Unbind Source Code Group

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

Url

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

Formats

json, xml

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/v16_4/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

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