updateControlProperties()

Pixelsilk API function to update the properties of a control--requires the advanced-admin-access permission
Parameters:
controlId: the unique identifier of the control
properties: the collection of properties as key/value pairs
permissions: the list of permissions for the property

Output:
The function updateControlProperties returns void.

C# Example:
Guid controlId = <control's id>;
IDictionary<string, string> properties = propertyDictionary;
IList<object> permissions = permissionList;
UpdateControlProperties(controlId, properties, permissions);
Note the capital first letter of the C# method.

HTTP Example:
Request Headers:
POST /api2/updateControlProperties HTTP/1.1
HOST: www.example.com
Content-Length: 871
Content-Type: application/x-www-form-urlencoded
Cookie: auth=8331D662FA33...CE9E28D6033F

Request Data:
Unencoded Data:
json={
   "controlId":"d83198a3-1e97-4d4c-b9d6-3b78d4649f43",
   "properties":{
      "Inheritance":"SingleInstance",
      "PageList":"",
      "IsInclude":"False"
   },
   "permissions":[
      {
         "id":"28702460-372d-4815-a594-92b9864b1085",
         "role":"Administrators",
         "permissions":[
            "edit-webbox",
            "view-webbox"
         ]
      },
      {
         "id":"b69a7b39-7d88-47bf-835c-2baf14781aaa",
         "role":"Everyone",
         "permissions":[
            "view-webbox"
         ]
      }
   ]
}&token=7AdbNHZQBtwc...RPTEK8UvSUQ=

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

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

Response Data:
{}

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

Input Object:
{
    controlId:"74456de0-6bb2-4640-b2f3-e9d84d39ae7c",
    properties:{
        "Inheritance":"SingleInstance",
        "PageList":"",
        "IsInclude":"False"
    },
    permissions:[
        {
            "id":"28702460-372d-4815-a594-92b9864b1085",
            "role":"Administrators",
            "permissions":[
                "edit-webbox",
                "view-webbox"
            ]
        },
        {
            "id":"b69a7b39-7d88-47bf-835c-2baf14781aaa",
            "role":"Everyone",
            "permissions":[
                "view-webbox"
            ]
        }
    ]
}

Returned Data:
{}

Back to Controls »