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}/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. |
Action to get campaign information.
Url
GET https://hostname:port/dw/data/v16_3/sites/{site_id}/campaigns/{campaign_id}
Formats
json, xml
Response Document
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_3/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.3",
"_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_3/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.3",
"_type":"fault",
"fault":{
"type":"CampaignNotFoundException",
"message":"No campaign with id 'my-campaign' for site 'SiteGenesis' found."
}
}
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_3/sites/{site_id}/campaigns/{campaign_id}
Formats
json, xml
Request Document
Response Document
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_3/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.3",
"_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_3/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.3",
"_type":"fault",
"fault":{
"type":"CampaignNotFoundException",
"message":"No campaign with id 'my-campaign' found."
}
}
Deletes the campaign by ID
Url
DELETE https://hostname:port/dw/data/v16_3/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_3/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
Creates a campaign using the information provided.
Url
PUT https://hostname:port/dw/data/v16_3/sites/{site_id}/campaigns/{campaign_id}
Formats
json, xml
Request Document
Response Document
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_3/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_3/sites/SiteGenesis/campaigns/campaign-registered
Content-Type: application/json; charset=UTF-8
ETag: 860cde3040519cce439cd99e209f8a87c3ad0b7e2813edbf6f5501f763b73bd5
{
"_v" : "16.3",
"_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_3/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.3",
"_type":"fault",
"fault":{
"type":"CampaignDuplicateException",
"message":"Campaign with id 'campaign-registered' is already in use."
}
}
Action to bind a single coupon to a given campaign.
Url
PUT https://hostname:port/dw/data/v16_3/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_3/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.3",
"_type":"fault",
"fault" : {
"type" : "CampaignNotFoundException",
"message" : "No campaign with id 'campaign-registered' in site 'SiteGenesis' found."
}
}
Action to unbind a coupon from a given campaign.
Url
DELETE https://hostname:port/dw/data/v16_3/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_3/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.3",
"fault" : {
"type" : "CampaignNotFoundException",
"message" : "No campaign with id 'campaign-registered' in site 'SiteGenesis' found."
}
}
Action to bind a single customer group to a given campaign.
Url
PUT https://hostname:port/dw/data/v16_3/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_3/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.3",
"_type":"fault",
"fault" : {
"type" : "CampaignNotFoundException",
"message" : "No campaign with id 'campaign-registered' in site 'SiteGenesis' found."
}
}
Action to unbind a customer group from a given campaign.
Url
DELETE https://hostname:port/dw/data/v16_3/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_3/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.3",
"fault" : {
"type" : "CampaignNotFoundException",
"message" : "No campaign with id 'campaign-registered' in site 'SiteGenesis' found."
}
}
Action to bind a single source code group to a given campaign.
Url
PUT https://hostname:port/dw/data/v16_3/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_3/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.3",
"_type":"fault",
"fault" : {
"type" : "CampaignNotFoundException",
"message" : "No campaign with id 'campaign-registered' in site 'SiteGenesis' found."
}
}
Action to unbind a source code group from a given campaign.
Url
DELETE https://hostname:port/dw/data/v16_3/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_3/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.3",
"fault" : {
"type" : "CampaignNotFoundException",
"message" : "No campaign with id 'campaign-registered' in site 'SiteGenesis' found."
}
}