updatePageTypeField()

Pixelsilk API function to save changes to a page type's field--requires the advanced-admin-access permission
Parameters:
pageTypeId: the unique identifier of the page type
input: a page type field object

Output:
The function updatePageTypeField returns void.

C# Example:
For this example imagine that a page type field object called pageTypeFieldObj has been created.
Guid pageTypeId = <page type's id>;
object pageTypeField = pageTypeFieldObj;
UpdatePageTypeField(pageTypeId, pageTypeField);
Note the capital first letter of the C# method.

HTTP Example:
Request Headers:
POST /api2/updatePageTypeField HTTP/1.1
HOST: www.example.com
Content-Length: 1011
Content-Type: application/x-www-form-urlencoded
Cookie: auth=406B7FA40691...0D442208CD5F

Request Data:
Unencoded Data:
json={
   "pageTypeId":"56e7e8e2-fb4a-4aea-8bdb-d335f0e83462",
   "input":{
      "id":"dd141238-9819-4916-9f00-e9ac5de638f1",
      "name":"Title",
      "defaultField":true,
      "type":"Text",
      "defaultValue":null,
      "properties":{
         "lengthProperty":0,
         "defaultText":"",
         "regEx":"",
         "isRequired":false,
         "isHide":false,
         "isVerify":false,
         "errorLength":"Max length exceeded",
         "errorRequired":"* Required",
         "errorFormat":"The text is not formatted correctly",
         "errorVerify":"The fields are not the same"
      },
      "listProperties":{

      }
   }
}&token=7AdbNHZQBtwc...RPTEK8UvSUQ=

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

Response Headers:
HTTP/1.1 200 OK
Set-Cookie: auth=431E550DBBA9...AC0B07C35FB; path=/
Content-Type: text/javascript; charset=UTF-8
Content-Length: 2

Response Data:
{}

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

Input Object:
{
    pageTypeId:"56e7e8e2-fb4a-4aea-8bdb-d335f0e83462",
    input:{
        id:"dd141238-9819-4916-9f00-e9ac5de638f1",
        name:"Title",
        defaultField:true,
        type:"Text",
        defaultValue:null,
        properties:{
            lengthProperty:0,
            defaultText:"",
            regEx:"",
            isRequired:true,
            isHide:false,
            isVerify:false,
            errorLength:"Max length exceeded",
            errorRequired:"* Required",
            errorFormat:"The text is formatted incorrectly",
            errorVerify:"The fields are not the same"
        }
    }
}

Returned Data:
{}

Back to Page Types »