copyControl()

Pixelsilk API function to make a copy of a control with its settings and skins--requires the advanced-admin-access permission
Parameters:
controlId: the unique identifier of the control

Output:
The function copyControl returns an object containing the new control

C# Example:
Guid controlId = <control's id>;
object newControl = CopyControl(controlId);
Note the capital first letter of the C# method.

HTTP Example:
Request Headers:
POST /api2/copyControl HTTP/1.1
HOST: www.example.com
Content-Length: 123
Content-Type: application/x-www-form-urlencoded
Cookie: auth=F69B6F81CD9E...24765F8CBF0C

Request Data:
Unencoded Data:
json={
   "controlId":"d83198a3-1e97-4d4c-b9d6-3b78d4649f43"
}&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=FA9AACA6BF51...048FB7A4CB7; path=/
Content-Type: text/javascript; charset=UTF-8
Content-Length: 117

Response Data:
{"id":"abeb1b0e-76d6-411c-8f90-b836ca55298c", "name":"CopyofExampleHtmlWebbox","type":"HtmlWebbox","availableTo":null}

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

Input Object:
{
    controlId:"93e407d2-cf0e-4ac8-afae-d08fd19fd38d"
}

Returned Data:
{
    "id":"f4faecf7-d0c3-4d8a-a6b7-e34549168f90",
    "name":"CopyofAPITextWebbox",
    "type":"TextWebbox",
    "availableTo":null,
    "groupName":null
}

Back to Controls »