addTheme()
Pixelsilk API function to add a theme to a site--requires the edit-skin permission
Parameters:
themeName: the name of the theme
Output:
The function addTheme returns a theme object containing the id, the name, and the groupName.
C# Example:
string themeName = "nameOfTheme";
object themeObj = AddTheme(themeName);
Note the capital first letter of the C# method.
HTTP Example:
Request Headers:
POST /api2/addTheme HTTP/1.1
HOST: www.example.com
Content-Length: 100
Content-Type: application/x-www-form-urlencoded
Cookie: auth=16C02BA65C85...346434711FDE
Request Data:
Unencoded Data:
json={
"themeName":"Example Theme"
}&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=200AB31107F9...5C668851360; path=/
Content-Type: text/javascript; charset=UTF-8
Content-Length: 83
Response Data:
{"id":"27a3cbe7-ee01-4820-908f-a6a333ad22ef","name":"Example Theme","groupName":""}
JavaScript Example:
Method Call:
pixelsilk2.addTheme(input, callback);
Input Object:
{
themeName:"ExampleTheme"
}
Returned Data:
{
"id":"b87f48ad-a660-492e-bba9-c0cd38a00492",
"name":"ExampleTheme",
"groupName":""
}
Back to Themes »