addNewPageType()

Pixelsilk API function to create a new page type based on an existing site page type or system page type--requires the advanced-admin-access permission
Parameters:
name: name of the new page type
baseId: the unique identifier of the base page type
image: the icon that will be used for the type

Output:
The function addNewPageType returns an object containing the id, the name, the image, and the groupName for the page type.

C# Example:
string name = "newPageTypeName";
Guid baseId = <base page type's id>;
string image = "selectedIcon.gif";
object newPageType = AddNewPageType(name, baseId, image);
Note the capital first letter of the C# method.

HTTP Example:
Request Headers:
POST /api2/addNewPageType HTTP/1.1
HOST: www.example.com
Content-Length: 202
Content-Type: application/x-www-form-urlencoded
Cookie: auth=7BD56AB559A9...9265DAE7DF2B

Request Data:
Unencoded Data:
json={
   "name":"ExampleHtmlPage",
   "baseId":"a866eeb2-1e6a-4e31-931a-d1839dc29418",
   "image":"Html"
}&token=7AdbNHZQBtwc...RPTEK8UvSUQ=

Url-encoded Data:
json=%7b%0d%0a+++...%22%0d%0a%7d&token=7AdbNHZQBtwc...TEK8UvSUQ%3d

Response Headers:
HTTP/1.1 200 OK
Set-Cookie: auth=14EC04D08379...29515FD2B69; path=/
Content-Type: text/javascript; charset=UTF-8
Content-Length: 102

Response Data:
{"id":"5fbb9e8f-7e0f-433a-8b71-2eb10f7d04a2",
"name":"ExampleHtmlPage","image":"Html","groupName":null}

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

Input Object:
{
    name:"ExampleHtmlPage",
    baseId:"a866eeb2-1e6a-4e31-931a-d1839dc29418",
    image:"Html"
}

Returned Data:
{
    "id":"7aea1d43-478a-464d-8fb9-c6d7a786fd67",
    "name":"ExampleHtmlPage",
    "image":"Html",
    "groupName":null
}

Back to Page Types »