copyTheme()
Pixelsilk API function to duplicate a theme--requires the edit-skin permission
Parameters:
themeId: the unique identifier of the theme to be copied
Output:
The function copyTheme returns the copy as a theme object
C# Example:
Guid themeId = <id of theme to be copied>;
object themeCopy = CopyTheme(themeId);
Note the capital first letter of the C# method.
HTTP Example:
Request Headers:
POST /api2/copyTheme HTTP/1.1
HOST: www.example.com
Content-Length: 121
Content-Type: application/x-www-form-urlencoded
Cookie: auth=78485682D4A6...306A8D4C855A
Request Data:
Unencoded Data:
json={
"themeId":"5c610500-d09d-4683-8414-8bd9033f7336"
}&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=E72E370B5F5D...070FDAA1B1B; path=/
Content-Type: text/javascript; charset=UTF-8
Content-Length: 87
Response Data:
{"id":"d501fcf7-bff9-4696-b54a-380e67dbf16f","name":"Copy 2 of Default","groupName":""}
JavaScript Example:
Method Call:
pixelsilk2.copyTheme(input, callback);
Input Object:
{
themeId:"b6d75673-3b03-43e2-ad61-d122a6dcc080"
}
Returned Data:
{
"id":"48fc8381-4fb7-4c12-8f4b-396332dff468",
"name":"Copy of NewTheme",
"groupName":""
}
Back to Themes »