CloudDocs
Theme
The Theme API provides methods for managing and creating Weebly themes for your Weebly Cloud users.
Fields
- theme_name (string)
Name given to a theme (ex: "My Red Theme")
- is_custom (boolean)
Depicts whether the theme is a custom theme or not. Custom themes are added by a user or added via the Weebly Cloud API. (ex: "1")
- date_created (timestamp)
Date when the theme was added to the user's account. (ex: "2014-06-06 01:07:53")
- theme_zip (url)
Publicly accessible url that points to the zip file containing the theme contents. This is only used when adding a theme to a site (ex: "http://myhost.com/custom_theme.zip")
GET /user/USER_ID/theme
Lists all themes available to the given user. An optional flag of "custom_only" can be included to only show custom themes.
Example CURL Request
curl https://api.weeblycloud.com/hosts/user/USER_ID/theme \ -H "X-Public-Key: YOURAPIKEY" \ -H "X-Signed-Request-Hash: YOURSECRETHASH"
Example Response
{ "data": [ { "theme_id": "43829593181038559", "theme_name": "Light", "date_created": "2012-06-06 01:07:53", "is_custom": false }, { "theme_id": "617936838395342932", "theme_name": "Enterprise", "date_created": "2013-01-09 13:41:39", "is_custom": false } ] }
POST /user/USER_ID/theme
Creates a new theme in the user account. NOTE: theme_zip must be publicly accessible and follow the structure for custom themes.
Example CURL Request
curl https://api.weeblycloud.com/hosts/user/USER_ID/theme \ -X POST \ -d '{ "theme_name": "Green Monster", "theme_zip": "https:\/\/myhost.com\/greenmonster.zip" }' \ -H "Content-type: application/json" \ -H "X-Public-Key: YOURAPIKEY" \ -H "X-Signed-Request-Hash: YOURSECRETHASH"
Example Response
{ "theme_id": "328910311176743925" }
Sets the theme for a given site. This theme change takes place immediately, but won't be seen on the published site until next publish. An "is_custom" flag is required in order to distinguish between Weebly themes and custom themes.
Example CURL Request
curl https://api.weeblycloud.com/hosts/user/USER_ID/site/SITE_ID/theme \ -X POST \ -d '{ "theme_id": "328910311176743925", "is_custom": true }' \ -H "Content-type: application/json" \ -H "X-Public-Key: YOURAPIKEY" \ -H "X-Signed-Request-Hash: YOURSECRETHASH"
Example Response
{ "success": true }
Site Info
|
More
|
|