CloudDocs
Site
The Site API provides methods for managing and creating sites owned by your Weebly Cloud users.
Fields
- site_title (string)
Title given to a site (ex: "Sample Site")
- domain (url)
The FQDN of the site (ex: "www.samplesite.com")
- is_published (boolean)
Represents the publish status of a site. (ex: "1")
- allow_ssl (boolean)
A site can have ssl if it is using a package built on the Weebly business plan and an explicit call to /site/allowSSL has been made. By default this value is set to 0. If this value is set to 1, then the user is displayed an option to enable SSL under Site settings. (ex: "1")
- brand_name (string)
Your brand name. Displays in the footer of any free sites. If not set on the site level, the brand_name set at the account level will be used. Passing a value of NULL will ensure the site uses the value defined at the account level. (ex: "My Brand Name")
- brand_url (string)
Full url to your website. The link in the footer of a published site will go to this site. If not set on the site level, the brand_url set at the account level will be used. Passing a value of NULL will ensure the site uses the value defined at the account level. (ex: "http://www.mybrand.com/")
- publish_upsell_url (string)
Full url to your publish promotion. This url will be loaded in an iframe (640px W by 200px H) upon site publish and can be used to advertise other services. If not set on the site level, the publish_upsell_url set at the account level will be used. Passing a value of NULL will ensure the site uses the value defined at the account level. (ex. "http://www.mybrand.com/upsell.php")
- upgrade_url (string)
Full url to your upgrade manager. When a user is editing a site they may be prompted to upgrade their account to take advantage of more features. This url will be loaded into a popup window to prompt the user to upgrade their account. This upgrade url will be used on all sites in the Weebly Cloud account. If not set on the site level, the upgrade_url set at the account level will be used. Passing a value of NULL will ensure the site uses the value defined at the account level. (ex: "http://www.mybrand.com/upgrade.php")
- publish_host (string)
The hostname of the remote host that hosts the published site. (ex: "ftp.myhost.com")
- publish_username (string)
The username used to authenticate to the publish_host. (ex: "jplumber")
- publish_password (string)
The password used to authenticate to the publish_host. (ex: "test1234")
- publish_path (string)
The absolute path of the remote host that hosts published site. (ex: "/home/myuser/html/")
GET /user/USER_ID/site/SITE_ID
Retrieves site details for the given USER_ID and SITE_ID combination.
Example CURL Request
curl https://api.weeblycloud.com/hosts/user/USER_ID/site/SITE_ID \ -H "X-Public-Key: YOURAPIKEY" \ -H "X-Signed-Request-Hash: YOURSECRETHASH"
Example Response
{ "site": { "site_id":"267059354604126441" "domain": "www.website.com", "site_title": "My Great Site", "brand_name": "Not the default Brand", "brand_url": "http://www.notyourdefaultbrand.com/", "upgrade_url": null, "publish_upsell_url": null, "allow_ssl": false } }
GET /user/USER_ID/site
Retrieves all the sites for a given user
Example CURL Request
curl https://api.weeblycloud.com/hosts/user/USER_ID/site \ -H "X-Public-Key: YOURAPIKEY" \ -H "X-Signed-Request-Hash: YOURSECRETHASH"
Example Response
{ "sites": [ { "site_id":"267059354604126441" "domain": "www.website.com", "site_title": "My Great Site", "brand_name": "Not the default Brand", "brand_url": "http://www.notyourdefaultbrand.com/", "upgrade_url": null, "publish_upsell_url": null, "allow_ssl": false }, { "site_id":"401578460740148767" "domain": "www.anotherwebsite.com", "site_title": "Another Site", "brand_name": null, "brand_url": null, "upgrade_url": null, "publish_upsell_url": null, "allow_ssl": false } ] }
Creates a new site for a given user. The domain must be unique. If optional parameters are not provided, then defaults defined at the Weebly Cloud account level will be used.
- Required: domain
- Optional: brand_name, brand_url, publish_upsell_url, upgrade_url, package_id
Example CURL Request
curl https://api.weeblycloud.com/hosts/user/USER_ID/site \ -X POST \ -d '{ "domain": "test882220359.com", "site_title": "My Amazing Website" }' \ -H "Content-type: application/json" \ -H "X-Public-Key: YOURAPIKEY" \ -H "X-Signed-Request-Hash: YOURSECRETHASH"
Example Response
{ "site": { "site_id": "683054028363759481", "domain": "test882220359.com", "site_title": "My Amazing Website", "brand_name": null, "brand_url": null, "upgrade_url": null, "publish_upsell_url": null, "allow_ssl": false } }
PUT /user/USER_ID/site/SITE_ID
Updates a given user's site. The domain must be unique. If optional parameters are not provided, then defaults defined at the Weebly Cloud account level will be used.
- Required: domain
- Optional: brand_name, brand_url, publish_upsell_url, upgrade_url, allow_ssl
Example CURL Request
curl https://api.weeblycloud.com/hosts/user/USER_ID/site/SITE_ID \ -X PUT \ -d '{ "domain": "www.test-site.com", "site_title": "Sample Site", "brand_name": "Test Brand", "brand_url": "http:\/\/www.brand.com\/", "upgrade_url": null, "publish_upsell_url": "http:\/\/www.brand.com\/upsell.html", "allow_ssl": false }' \ -H "Content-type: application/json" \ -H "X-Public-Key: YOURAPIKEY" \ -H "X-Signed-Request-Hash: YOURSECRETHASH"
Example Response
{ "site": { "site_id": "267059354604126441", "domain": "www.test-site.com", "site_title": "Sample Site", "brand_name": "Test Brand", "brand_url": "http://www.brand.com/", "upgrade_url": null, "publish_upsell_url": "http://www.brand.com/upsell.html", "allow_ssl": false } }
PATCH /user/USER_ID/site/SITE_ID
Updates the provided properties of a given user's site. The domain must be unique. If optional parameters are not provided, then defaults defined at the Weebly Cloud account level will be used.
- Optional: domain, brand_name, brand_url, publish_upsell_url, upgrade_url, allow_ssl
Example CURL Request
curl https://api.weeblycloud.com/hosts/user/USER_ID/site/SITE_ID \ -X PATCH \ -d '{ "domain": "www.test-site-secured.com", "site_title": "Sample SSL Site", "allow_ssl": true }' \ -H "Content-type: application/json" \ -H "X-Public-Key: YOURAPIKEY" \ -H "X-Signed-Request-Hash: YOURSECRETHASH"
Example Response
{ "site": { "site_id": "267059354604126441", "domain": "www.test-site-secured.com", "site_title": "Sample SSL Site", "brand_name": "Test Brand", "brand_url": "http://www.brand.com/", "upgrade_url": null, "publish_upsell_url": "http://www.brand.com/upsell.html", "allow_ssl": true } }
Publishes a given site for a given user.
Example CURL Request
curl https://api.weeblycloud.com/hosts/user/USER_ID/site/SITE_ID/publish \ -X POST \ -H "Content-type: application/json" \ -H "X-Public-Key: YOURAPIKEY" \ -H "X-Signed-Request-Hash: YOURSECRETHASH"
Example Response
{ "success": true }
POST /user/USER_ID/site/SITE_ID/unpublish
Unpublishes the given site for a given user. The site can be published again after it is unpublished.
Example CURL Request
curl https://api.weeblycloud.com/hosts/user/USER_ID/site/SITE_ID/unpublish \ -X POST \ -H "Content-type: application/json" \ -H "X-Public-Key: YOURAPIKEY" \ -H "X-Signed-Request-Hash: YOURSECRETHASH"
Example Response
{ "success": true }
Generates a one-time link that will direct users to the site specified. This method requires that the account is enabled.
Example CURL Request
curl https://api.weeblycloud.com/hosts/user/USER_ID/site/SITE_ID/loginLink \ -X POST \ -H "Content-type: application/json" \ -H "X-Public-Key: YOURAPIKEY" \ -H "X-Signed-Request-Hash: YOURSECRETHASH"
Example Response
{ "link": "http://www.weebly.com/editor/login.php?t=55ac062cfdba5a7c7ae5fe8c228d1635&redirect=toSite.php%3Fsite=895826994839270359" }
Sets publish credentials for a given site. If a user's site will not be hosted by Weebly, publish credentials can be provided. When these values are set, the site will be published to the location specified.
Example CURL Request
curl https://api.weeblycloud.com/hosts/user/USER_ID/site/SITE_ID/setPublishCredentials \ -X POST \ -d '{ "publish_host": "ftp.myhost.com", "publish_username": "ftpuser", "publish_password": "password1234", "publish_path": "\/home\/ftpuser\/html\/" }' \ -H "Content-type: application/json" \ -H "X-Public-Key: YOURAPIKEY" \ -H "X-Signed-Request-Hash: YOURSECRETHASH"
Example Response
{ "success": true }
DELETE /user/USER_ID/site/SITE_ID
Deletes the Weebly site. The site will no longer show up to the user.
Example CURL Request
curl https://api.weeblycloud.com/hosts/user/USER_ID/site/SITE_ID \ -X DELETE \ -H "X-Public-Key: YOURAPIKEY" \ -H "X-Signed-Request-Hash: YOURSECRETHASH"
Example Response
{ "success": true }
Site Info
|
More
|
|