getPageTypeFields()
Pixelsilk API function to get the fields in a page type--requires the advanced-admin-access permission
Parameters:
pageTypeId: the unique identifier of the page type
Output:
The function getPageTypeFields returns a collection of page type field objects
C# Example:
Guid pageTypeId = <page type's id>;
IEnumerable<object> pageTypeFields = GetPageTypeFields(pageTypeId);
Note the capital first letter of the C# method.
HTTP Example:
Request Headers:
POST /api2/getPageTypeFields HTTP/1.1
HOST: www.example.com
Content-Length: 124
Content-Type: application/x-www-form-urlencoded
Cookie: auth=5D888FF871A1...B243650A6E5F
Request Data:
Unencoded Data:
json={
"pageTypeId":"56e7e8e2-fb4a-4aea-8bdb-d335f0e83462"
}&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=35254A598117...34E88474A78; path=/
Content-Type: text/javascript; charset=UTF-8
Content-Length: 1483
Response Data:
[{
"id":"ec9243a0-3044-42df-a054-f527a32ae809",
"name":"BriefDescription",
"defaultField":true,
"type":"Multiline Text",
"defaultValue":null,
"properties":{
"lengthProperty":0,
"defaultText":"",
"isRequired":false,
"errorLength":"Max length exceeded",
"errorRequired":"* Required"},
"listProperties":{}
},
{
"id":"9a82316a-5499-4cc3-9466-32a9ca584019",
"name":"FullDescription",
"defaultField":true,"type":"HTML",
"defaultValue":null,
"properties":{
"errorRequired":"* Required",
"isRequired":false},
"listProperties":{}
}]
NOTE: Some of the fields have been removed to make this easier to look at.
JavaScript Example:
Method Call:
pixelsilk2.getPageTypeFields(input, callback);
Input Object:
{
pageTypeId:"56e7e8e2-fb4a-4aea-8bdb-d335f0e83462"
}
Returned Data:
[
{
"id":"ec9243a0-3044-42df-a054-f527a32ae809",
"name":"BriefDescription",
"defaultField":true,
"type":"Multiline Text",
"defaultValue":null,
"properties":{
"lengthProperty":0,
"defaultText":"",
"isRequired":false,
"errorLength":"Max length exceeded",
"errorRequired":"* Required"
}
},
{
"id":"9a82316a-5499-4cc3-9466-32a9ca584019",
"name":"FullDescription",
"defaultField":true,
"type":"HTML",
"defaultValue":null,
"properties":{
"errorRequired":"* Required",
"isRequired":false
}
}
]
NOTE: many of the fields have been removed to make this easier to read.
Back to Page Types »