Sites Resource (Data API 16.2)

Summary

Http Method Resource Description
GET /Sites/{Site_id} Action to read an existing site.

Get Site

Action to read an existing site.

Url

GET https://hostname:port/dw/data/v16_2/sites/{site_id}

Formats

json, xml

Response Document

Site

Path Parameters

Parameter Type Description Constraints
site_id String the id of the site minLength=1

Sample

REQUEST:
GET /s/-/dw/data/v16_2/sites/SiteGenesis HTTP/1.1
Host: example.com
Authorization:Bearer ac734607-c966-44fb-8739-8ea413a2c0a5
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
{
   "_v" : "16.2",
   "_type" : "site",
   "customer_list_link" : 
   {
      "_type" : "customer_list_link",
      "customer_list_id" : "SiteGenesis",
      "link" : "https://ocapi.mon.demandware.net/s/-/dw/data/v16_2/customer_lists/SiteGenesis"
   },
   "description" : "Site's site used for WAPI integration test.",
   "id" : "SiteGenesis"
}

# in case of failure (SecureCommunicationRequired, i.e. no http):

RESPONSE:
HTTP/1.1 403 Forbidden
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.2",
   "fault" : 
   {
      "type" : "SecureCommunicationRequiredException",
      "message" : "Secure communication required."
   }
}

# in case of failure (SiteNotFound, i.e. invalid site id):

RESPONSE:
HTTP/1.1 404 Forbidden
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.2",
   "fault" : 
   {
      "type" : "SiteNotFoundException",
      "message" : "No site with id 'foobar' found."
   }
}