getPageTypeFieldValues()

Pixelsilk API function to get the values for a page type (choices in a drop-down, for example)--requires the advanced-admin-access permission
Parameters:
pageTypeId: the unique identifier of the page type
fieldId: the unique identifier of the field

Output:
The function getPageTypeFieldValues returns a collection of item list property objects.

C# Example:
Guid pageTypeId = <page type's id>;
Guid fieldId = <field's id>;
IList fieldValues = GetPageTypeFieldValues(pageTypeId, fieldId);
Note the capital first letter of the C# method.

HTTP Example:
Request Headers:
POST /api2/getPageTypeFieldValues HTTP/1.1
HOST: www.example.com
Content-Length: 194
Content-Type: application/x-www-form-urlencoded
Cookie: auth=9B474004EA68...A5BC554CE7FC

Request Data:
Unencoded Data:
json={
   "pageTypeId":"031ce0ac-24c1-4254-a7ec-82a4d7fe5c8e",
   "fieldId":"325770a4-5d4c-46eb-a7b1-3780efac8c78"
}&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=665AEEA00C93...B33BE3A4E3B; path=/
Content-Type: text/javascript; charset=UTF-8
Content-Length: 162

Response Data:
[{"id":"3fecb22e-43de-4f5c-8765-9e2333332942",
"listText":"a","listValue":"1"},
{"id":"4d1744d0-d964-47d1-bc46-119470aa5742",
"listText":"Test","listValue":"test1"}]

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

Input Object:
{
    pageTypeId:"031ce0ac-24c1-4254-a7ec-82a4d7fe5c8e",
    fieldId:"325770a4-5d4c-46eb-a7b1-3780efac8c78"
}

Returned Data:
[
    {
        "id":"3fecb22e-43de-4f5c-8765-9e2333332942",
        "listText":"a",
        "listValue":"1"
    },
    {
        "id":"4d1744d0-d964-47d1-bc46-119470aa5742",
        "listText":"Test",
        "listValue":"test1"
    }
]

Back to Page Types »