CloudDocs
User & site Provisioning
Creating a user
In order to create a Weebly user through the Weebly Cloud API an email address is needed. The email address must be unique to Weebly. An error will be thrown if an email address is provided that is already in use. A user id (ex. 32134607) is returned upon successful creation of a user. This user id should be saved to your system of record as you'll want to use it to maintain the user's account. Learn more about the User API.
curl https://api.weeblycloud.com/hosts/user \ -X POST \ -d '{ "email": "[email protected]" }' \ -H "Content-type: application/json" \ -H "X-Public-Key: YOURAPIKEY" \ -H "X-Signed-Request-Hash: YOURSECRETHASH"
Creating a site
When creating a Weebly site you must provide a user id and a domain name. Errors will be thrown if the user id is invalid or the domain name is already assigned to a Weebly site. A site id (ex. 447410440673519990) is returned upon successful creation of a site.
curl https://api.weeblycloud.com/hosts/user/USER_ID/site \ -X POST \ -d '{ "domain": "test-site.weebly.com" }' \ -H "Content-type: application/json" \ -H "X-Public-Key: YOURAPIKEY" \ -H "X-Signed-Request-Hash: YOURSECRETHASH"
There are many optional parameters that can be passed when creating a site. These can be referenced here. I will draw attention to the optional parameter package_id. If no package_id is provided, then the site will be assigned the default package. Packages control what the site has access to. You can learn more about packages here.
Site Info
|
More
|
|