getSections()

Pixelsilk API function to get a list of sections based on the parent--requires the edit-page-properties permission
Parameters:
parentId: the unique identifier of the parent section

Output:
The function getSections returns a section object that contains the parent section's children

C# Example:
Guid? parentId = <parent section's (page's) id>;
object childSections = GetSections(parentId);
Note the capital first letter of the C# method.

HTTP Example:
Request Headers:
POST /api2/getSections HTTP/1.1
HOST: www.example.com
Content-Length: 107
Content-Type: application/x-www-form-urlencoded
Cookie: auth=439BB1F82DF8...08FF831278E2

Request Data:
Unencoded Data:
json={"parentId":"3c3299c1-1c41-4eea-a81b-7d1cfc5911ce"}&token=7AdbNHZQBtwc...RPTEK8UvSUQ=

Url-encoded Data:
json=%7b%22parent...5911ce%22%7d&token=7AdbNHZQBtwc...TEK8UvSUQ%3d

Response Headers:
HTTP/1.1 200 OK
Set-Cookie: auth=925FB3A0AF67...B19418C9389; path=/
Content-Type: text/javascript; charset=UTF-8
Content-Length: 940

Response Data:
{
  "menuName":"ie1",
  "id":"3c3299c1-1c41-4eea-a81b-7d1cfc5911ce",
  "urlRelative":"/ie1/",
  "enabled":true,
  "displayInNav":true,
  "includeInHtmlSiteMap":true,
  "approved":true,
  "typeImage":"Html",
  "typeName":"HTML Page",
  "children":[
    {
      "menuName":"ie1-1",
      "id":"867ea9a1-209c-47e3-9dbb-a039a275cc47",
      "urlRelative":"/ie1/ie1-1/",
      "enabled":true,
      "displayInNav":true,
      "includeInHtmlSiteMap":true,
      "approved":true,
      "typeImage":"Html",
      "typeName":"HTML Page",
      "children":[
      ],
      "inheritSecurityFromParent":false,
      "inheritOptionsFromParent":false,
      "inheritUrlSettingsFromParent":false,
      "inheritAdvancedStettingsFromParent":false,
      "shouldBeEnabled":true,
      "shouldBeDisplayedInNav":true,
      "shouldBeVisibleInSiteMap":true,
      "isRoot":false
    }
  ],
  "inheritSecurityFromParent":false,
  "inheritOptionsFromParent":false,
  "inheritUrlSettingsFromParent":false,
  "inheritAdvancedStettingsFromParent":false,
  "shouldBeEnabled":true,
  "shouldBeDisplayedInNav":true,
  "shouldBeVisibleInSiteMap":true,
  "isRoot":false
}

JavaScript Example:
Method Call:
pixelsilk2.getSections(input, callback);

Input Object:
{
    parentId:"3c3299c1-1c41-4eea-a81b-7d1cfc5911ce"
}

Returned Data:
{
    "menuName":"ie1",
    "id":"3c3299c1-1c41-4eea-a81b-7d1cfc5911ce",
    "urlRelative":"/ie1/",
    "enabled":true,
    "displayInNav":true,
    "includeInHtmlSiteMap":true,
    "approved":true,
    "typeImage":"Html",
    "typeName":"HTML Page",
    "children":[
        {
            "menuName":"ie1-1",
            "id":"867ea9a1-209c-47e3-9dbb-a039a275cc47",
            "urlRelative":"/ie1/ie1-1/",
            "enabled":true,
            "displayInNav":true,
            "includeInHtmlSiteMap":true,
            "approved":true,
            "typeImage":"Html",
            "typeName":"HTML Page",
            "children":[
            ],
            "inheritSecurityFromParent":false,
            "inheritOptionsFromParent":false,
            "inheritUrlSettingsFromParent":false,
            "inheritAdvancedStettingsFromParent":false,
            "shouldBeEnabled":true,
            "shouldBeDisplayedInNav":true,
            "shouldBeVisibleInSiteMap":true,
            "isRoot":false
        }
    ],
    "inheritSecurityFromParent":false,
    "inheritOptionsFromParent":false,
    "inheritUrlSettingsFromParent":false,
    "inheritAdvancedStettingsFromParent":false,
    "shouldBeEnabled":true,
    "shouldBeDisplayedInNav":true,
    "shouldBeVisibleInSiteMap":true,
    "isRoot":false
}

Back to Pages »