getPageTypes()

Pixelsilk API function to get all the page types available stored in the system and the site--requires the edit-page-properties permission
Parameters:
The function getPageTypes has no parameters.

Output:
The function getPageTypes returns a collection of page types

C# Example:
IList pageTypes = GetPageTypes();
Note the capital first letter of the C# method.

HTTP Example:
Request Headers:
POST /api2/getPageTypes HTTP/1.1
HOST: www.example.com
Content-Length: 36
Content-Type: application/x-www-form-urlencoded
Cookie: auth=0E8D5DD5F656...BA84791C11BF

Request Data:
Unencoded Data:
token=7AdbNHZQBtwc...RPTEK8UvSUQ=

Url-encoded Data:
token=7AdbNHZQBtwc...TEK8UvSUQ%3d

Response Headers:
HTTP/1.1 200 OK
Set-Cookie: auth=5EC1C44FEE8C...7A3540ECD41; path=/
Content-Type: text/javascript; charset=UTF-8
Content-Length: 2499

Response Data:
[{"id":"031ce0ac-24c1-4254-a7ec-82a4d7fe5c8e",
   "name":"Cars",
   "image":"Parent","groupName":null},
{"id":"35a21d3d-d6c9-44bd-8525-013ebd0dfe6d",
   "name":"Copy of Cars",
   "image":"Parent","groupName":null},
{"id":"56e7e8e2-fb4a-4aea-8bdb-d335f0e83462",
   "name":"Examples",
   "image":"Articles","groupName":null},
{"id":"a866eeb2-1e6a-4e31-931a-d1839dc29418",
   "name":"HTML Page",
   "image":"Html","groupName":null},
{"id":"d2862cd8-275f-4307-aeb6-4758d192b372",
   "name":"List Section",
   "image":"Html","groupName":"System"},
{"id":"c2b98e7d-cc48-4265-ac06-9626a40dc0a9",
   "name":"Newsletter",
   "image":"Html","groupName":null},
{"id":"b520588b-a79c-44d9-a4c6-662d328792c9",
   "name":"Test",
   "image":"PhotoGallery","groupName":null}]

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

Input Object:
The function getPageTypes has no parameters.

Returned Data:
[
    {
        "id":"9e46a476-e8ac-488b-91e0-4d57b2dbaf6d",
        "name":"APIHtmlPage",
        "image":"Html",
        "groupName":null
    },
    {
        "id":"598ff8a5-e303-4e19-bc5c-461413d044ed",
        "name":"APIListSection",
        "image":"Articles",
        "groupName":null
    }
]
NOTE: many page types were removed to make this more readable.

Back to Page Types »