Folders Resource (Shop API 15.6)

Summary

Http Method Resource Description
GET /Folders/({Id},...,{Id}) To access one or more content folder, you construct a URL using the template shown below. This template requires you to specify one or more content folder ids and a subfolder level. In response, the server returns a result set of corresponding content folder documents. Only content folder, which are marked as online are returned.
GET /Folders/{Id} To access a content folder, you construct a URL using the template shown below. This template requires you to specify a content folder id and a subfolder level. In response, the server returns a corresponding content folder document. Only content folder, which are marked as online are returned.

Get Multiple Content Folders

To access one or more content folder, you construct a URL using the template shown below. This template requires you to specify one or more content folder ids and a subfolder level. In response, the server returns a result set of corresponding content folder documents. Only content folder, which are marked as online are returned.

Url

GET http://hostname:port/dw/shop/v15_6/folders/({id},...,{id})?levels={Integer}&locale={String}

Formats

json, xml

Authentication

Name Description
None No authentication.

Response Document

ContentFolderResult

Path Parameters

Parameter Type Description Constraints
ids [String] The ids of the requested content folders. maxItems=50, maxLength=256

Query Parameters

Parameter Type Description Constraints
levels Integer Specifies how many levels of nested subfolders you want the server to return. The default value is 1. Valid values are 0, 1, or 2. maxIntegerValue=2, minIntegerValue=0
locale String The locale context.  

Sample

REQUEST:
GET /dw/shop/v15_6/folders/(our-story,our-team)?levels=0 HTTP/1.1
Host: example.com
Accept: application/json

RESPONSE:
HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
Cache-Control: max-age=900,must-revalidate
{
  "_v":"15.6",
  "_type":"content_folder_result",
  "count":2,
  "total":2,
  "data":
  [
    {
      "id" : "our-story",
      "name" : "Our Story",
      "parent_folder_id" : "about-us"
    },
    {
      "id" : "our-team",
      "name" : "Our Team",
      "parent_folder_id" : "about-us"
    }
  ]
}

Get Content Folder

To access a content folder, you construct a URL using the template shown below. This template requires you to specify a content folder id and a subfolder level. In response, the server returns a corresponding content folder document. Only content folder, which are marked as online are returned.

Url

GET http://hostname:port/dw/shop/v15_6/folders/{id}?levels={Integer}&locale={String}

Formats

json, xml

Authentication

Name Description
None No authentication.

Response Document

ContentFolder

Path Parameters

Parameter Type Description Constraints
id String The id of the requested content folder. maxLength=256

Query Parameters

Parameter Type Description Constraints
levels Integer Specifies how many levels of nested subfolders you want the server to return. The default value is 1. Valid values are 0, 1, or 2. maxIntegerValue=2, minIntegerValue=0
locale String The locale context.  

Sample

REQUEST:
GET /dw/shop/v15_6/folders/about-us?levels=1 HTTP/1.1
Host: example.com
Accept: application/json

RESPONSE:
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=900,must-revalidate
Content-Length: 741

{
  "_v" : "15.6",
  "_type":"content_folder",
  "folders" : 
  [ 
    {
      "id" : "our-story",
      "name" : "Our Story",
      "parent_folder_id" : "about-us"
    }, {
      "id" : "our-team",
      "name" : "Our Team",
      "parent_folder_id" : "about-us"
    }, {
      "id" : "as-seen-in",
      "name" : "As Seen In",
      "parent_folder_id" : "about-us"
    }, {
      "id" : "contact-us-new",
      "name" : "Contact Us",
      "parent_folder_id" : "about-us"
    }, {
      "id" : "employment",
      "name" : "Join Us",
      "parent_folder_id" : "about-us"
    }
  ],
  "id" : "about-us",
  "name" : "About Salesforce Commerce Cloud",
  "parent_folder_id" : "root",
  "c_customCSSFile" : "http://example.com/on/demandware.static/Sites-SiteGenesis-Site/Sites-SiteGenesis-Library/default/v1365077029384/css/aboutus.css"
}