Sites Resource (Data API 15.1)

Summary

Http Method Resource Description
POST /Sites/{Site_id}/Slot_configurations Creates a new configuration for an existing slot. When a slot configuration with the given configuration_id, slot_id and context does already exist for the site, this will throw a 409. The retrieved document contains the uuid of the slot configuration, which is used to read, update or delete the slot configuration.
PATCH /Sites/{Site_id}/Slot_configurations/{Uuid} Updates an existing configuration for an existing slot. This action ignores the uuid, slot_id, configuration_id and the context in the input document.
GET /Sites/{Site_id}/Slot_configurations/{Uuid} Action to read an existing configuration for a slot.
DELETE /Sites/{Site_id}/Slot_configurations/{Uuid} Removes a slot configuration with a given uuid from a site.

Create Slot Configuration

Creates a new configuration for an existing slot. When a slot configuration with the given configuration_id, slot_id and context does already exist for the site, this will throw a 409. The retrieved document contains the uuid of the slot configuration, which is used to read, update or delete the slot configuration.

Url

POST https://hostname:port/dw/data/v15_1/sites/{site_id}/slot_configurations

Formats

json, xml

Request Document

SlotConfiguration

Response Document

SlotConfiguration

Path Parameters

Parameter Type Description Constraints
site_id String The id of the site to create the slot configuration for. maxLength=32, minLength=1

In case of a failure Fault Document is returned.

Faults

Status Type Arguments Description
400 InvalidSlotIdException

slotId (String)

siteId (String)

Thrown if there was no slot with the given id found for the requested site.
400 MissingSlotConfigurationContextIdException   Thrown if a missing context id for given context 'category'.
409 SlotConfigurationAlreadyExistsException

slotConfigurationId (String)

slotId (String)

contextId (String)

Thrown if a configuration for the slot with the given context and the configuration id does already exists for the site.

Sample

REQUEST:
POST /s/-/dw/data/v15_1/sites/SiteGenesis/slot_configurations HTTP/1.1
Host: example.com
Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367
Content-Type: application/json; charset=UTF-8
{
    "slot_id":"header-banner", 
    "configuration_id":"header_banner_html",
    "slot_content":
    {
        "type":"html",
        "body":
        {
            "default":"<html>Default HTML content</html>",
            "de-DE":"<html>HTML Inhalt</html>",
            "en-US":"<html>HTML content</html>"
        }
    },
    "customer_groups":[
        "Administrators",
        "Registered"
    ],
    "context":"category", 
    "context_id":"men_shoes", 
    "enabled":true, 
    "default":true, 
    "rank":2,
    "description":"slot configuration description", 
    "callout_msg":
    {
        "default":"Default message",
        "de-DE":"Deutsche Nachricht",
        "en-US":"US american message"
    }, 
    "schedule":
    {
        "start_date":"2013-03-28T23:21:00.000Z", 
        "end_date":"2022-03-28T23:21:00.000Z", 
        "recurrence":
        {
            "day_of_week":[
                "monday",
                "sunday"
            ], 
            "time_of_day":
            {
                "time_from":"00:00:00", 
                "time_to":"23:59:59"
            }
        }
    }
}

# in case of success:

RESPONSE:
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
ETag: 860cde3040519cce439cd99e209f8a87c3ad0b7e2813edbf6f5501f763b73bd5
{
    "_v":"15.1",
    "slot_id":"header-banner",
    "uuid":"fsdoi43ofijwdf",
    "configuration_id":"header_banner_html",
    "slot_content":
    {
        "type":"html",
        "body":
        {
            "default":"<html>HTML content</html>",
            "de-DE":"<html>HTML Inhalt</html>",
            "en-US":"<html>HTML content</html>"
        }
    }, 
    "customer_groups":[
        "Administrators",
        "Registered"
    ],
    "assigned_to_site" : true,
    "context":"category", 
    "context_id":"men_shoes", 
    "enabled":true, 
    "default":true, 
    "rank":2,
    "description":"slot configuration description", 
    "callout_msg":
    {
        "default":"some message",
        "de-DE":"Deutsche Nachricht",
        "en-US":"US american message"
    }, 
    "schedule":
    {
        "start_date":"2013-03-28T23:21:00.000Z", 
        "end_date":"2022-03-28T23:21:00.000Z", 
        "recurrence":
        {
            "day_of_week":[
                "monday",
                "sunday"
            ], 
            "time_of_day":
            {
                "time_from":"00:00:00", 
                "time_to":"23:59:00"
            }
        }
    }
}

# in case of failure:

RESPONSE:
HTTP/1.1 400 Bad Request
Content-Type: application/json;charset=UTF-8
{
  "_v":"15.1",
  "fault":
  {
    "type":"InvalidSlotIdException",
    "message":"No slot with id 'header-banner' found for site 'SiteGenesis'."
  }
}

Update Slot Configuration

Updates an existing configuration for an existing slot. This action ignores the uuid, slot_id, configuration_id and the context in the input document.

Url

PATCH https://hostname:port/dw/data/v15_1/sites/{site_id}/slot_configurations/{uuid}

Formats

json, xml

Request Document

SlotConfiguration

Response Document

SlotConfiguration

Path Parameters

Parameter Type Description Constraints
site_id String The id of the site to create the slot configuration for. maxLength=32, minLength=1
uuid String The uuid of the slot configuration. maxLength=28, minLength=1

Header Parameters

Parameter Type Description Constraints
If-Match String    

In case of a failure Fault Document is returned.

Faults

Status Type Arguments Description
400 InvalidSlotIdException

slotId (String)

siteId (String)

Thrown if there was no slot with the given id found for the requested site.
400 MissingSlotConfigurationContextIdException   Thrown if a missing context id for given context 'category'.
404 SlotConfigurationNotFoundException

slotConfigurationId (String)

siteId (String)

Thrown if there was no slot configuration found for the configuration id, given in the URL.

Sample

REQUEST:
PATCH /s/-/dw/data/v15_1/sites/SiteGenesis/slot_configurations/fsdoi43ofijwdf HTTP/1.1
Host: example.com
Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367
Content-Type: application/json; charset=UTF-8
If-Match: 860cde3040519cce439cd99e209f8a87c3ad0b7e281cupc4k35501f763b73bd5
{
    "slot_id":"header-banner", 
    "slot_content":
    {
        "type":"html",
        "body":
        {
            "default":"<html>Default HTML content</html>",
            "de-DE":"<html>HTML Inhalt</html>",
            "en-US":"<html>HTML content</html>"
        }
    },
    "customer_groups":[
        "Administrators",
        "Registered"
    ],
    "context":"category", 
    "context_id":"men_shoes", 
    "enabled":true, 
    "default":true, 
    "rank":2,
    "description":"slot configuration description", 
    "callout_msg":
    {
        "default":"Default message",
        "de-DE":"Deutsche Nachricht",
        "en-US":"US american message"
    }, 
    "schedule":
    {
        "start_date":"2013-03-28T23:21:00.000Z", 
        "end_date":"2022-03-28T23:21:00.000Z", 
        "recurrence":
        {
            "day_of_week":[
                "monday",
                "sunday"
            ], 
            "time_of_day":
            {
                "time_from":"00:00:00", 
                "time_to":"23:59:59"
            }
        }
    }
}

# in case of success:

RESPONSE:
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
ETag: t9ccde3040519cce439cd99e209f8a87c3ad0b7e2813edbf6f5501f763b73b8h6
{
    "_v":"15.1",
    "slot_id":"header-banner",
    "uuid":"fsdoi43ofijwdf",
    "configuration_id":"header_banner_html",
    "slot_content":
    {
        "type":"html",
        "body":
        {
            "default":"<html>HTML content</html>",
            "de-DE":"<html>HTML Inhalt</html>",
            "en-US":"<html>HTML content</html>"
        }
    }, 
    "customer_groups":[
        "Administrators",
        "Registered"
    ],
    "assigned_to_site" : true,
    "context":"category", 
    "context_id":"men_shoes", 
    "enabled":true, 
    "default":true, 
    "rank":2,
    "description":"slot configuration description", 
    "callout_msg":
    {
        "default":"some message",
        "de-DE":"Deutsche Nachricht",
        "en-US":"US american message"
    }, 
    "schedule":
    {
        "start_date":"2013-03-28T23:21:00.000Z", 
        "end_date":"2022-03-28T23:21:00.000Z", 
        "recurrence":
        {
            "day_of_week":[
                "monday",
                "sunday"
            ], 
            "time_of_day":
            {
                "time_from":"00:00:00", 
                "time_to":"23:59:00"
            }
        }
    }
}

# in case of failure:

RESPONSE:
HTTP/1.1 404 Not Found
Content-Type: application/json;charset=UTF-8
{
  "_v":"15.1",
  "fault":
  {
    "type":"SlotConfigurationNotFoundException",
    "message":"No slot configuration with id 'fsdoi43ofijwdf' found for site 'SiteGenesis'."
  }
}

Get Slot Configuration

Action to read an existing configuration for a slot.

Url

GET https://hostname:port/dw/data/v15_1/sites/{site_id}/slot_configurations/{uuid}

Formats

json, xml

Response Document

SlotConfiguration

Path Parameters

Parameter Type Description Constraints
site_id String The id of the site, the configuration is assigned to. minLength=1
uuid String The uuid of the slot configuration. maxLength=28, minLength=1

In case of a failure Fault Document is returned.

Faults

Status Type Arguments Description
404 SlotConfigurationNotFoundException

slotConfigurationId (String)

siteId (String)

Thrown if there was no slot configuration found for the configuration id, given in the URL.

Sample

REQUEST:
GET /s/-/dw/data/v15_1/sites/SiteGenesis/slot_configurations/fsdoi43ofijwdf 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-Jan-1970 00:00:00 GMT
ETag: 860cde3040519cce439cd99e209f8a87c3ad0b7e2813edbf6f5501f763b73bd5
{
    "_v":"15.1",
    "slot_id":"header-banner",
    "uuid":"fsdoi43ofijwdf",
    "configuration_id":"header_banner_html",
    "slot_content":
    {
        "type":"html",
        "body":
        {
            "default":"<html>HTML content</html>"
        }
    }, 
    "customer_groups":[
        "Administrators",
        "Registered"
    ],
    "assigned_to_site" : true,
    "context":"category", 
    "context_id":"men_shoes", 
    "enabled":true, 
    "default":true, 
    "rank":2,
    "description":"slot configuration description", 
    "callout_msg":
    {
        "default":"some message"
    }, 
    "schedule":
    {
        "start_date":"2013-03-28T23:21:00.000Z", 
        "end_date":"2022-03-28T23:21:00.000Z", 
        "recurrence":
        {
            "day_of_week":[
                "monday",
                "sunday"
            ], 
            "time_of_day":
            {
                "time_from":"00:00:00", 
                "time_to":"23:59:00"
            }
        }
    }
}

# 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":"15.1",
  "fault":
  {
    "type":"SlotConfigurationNotFoundException",
    "message":"No slot configuration with id 'fsdoi43ofijwdf' found for site 'SiteGenesis'."
  }
}

Delete Slot Configuration

Removes a slot configuration with a given uuid from a site.

Url

DELETE https://hostname:port/dw/data/v15_1/sites/{site_id}/slot_configurations/{uuid}

Formats

json, xml

Path Parameters

Parameter Type Description Constraints
site_id String The id of the site to remove the slot configuration from. maxLength=32, minLength=1
uuid String The uuid the slot configuration to remove. maxLength=28, minLength=1

Sample

REQUEST:
DELETE /s/-/dw/data/v15_1/sites/SiteGenesis/slot_configurations/fsdoi43ofijwdf 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 Requested resource not found
Content-Type: application/json;charset=UTF-8
{
  "_v":"15.1",
  "fault":
  {
    "type":"SiteNotFoundException",
    "message":"No site with id 'SiteGenesis' found."
  }
}