CloudDocs
User
The User API provides methods for managing and creating Weebly Cloud users.
FIELDS
- email (string)
The email address of a user. This is used as the username (ex: "[email protected]")
- test_mode (boolean)
Denotes whether a user is a test user or not. Test users are meant to be used when testing the API or general Weebly Cloud functionality. When true, a user will be created in test mode and the account will not be charged. (ex: "1")
- loginLink (url)
A one-time link that will direct users to the editor for the last site that was modified in the account. The link will only work if the user account is enabled and has at least one site associated with it. (ex: "http://www.weebly.com/editor/login.php?t=189179fc306466d9fd283a2cefd8b093&redirect=toSite.php%3Fsite=509462188631598754") - language (string)
A two letter language code to set as the user's default language.
GET /user/USER_ID
Returns the details for a given Weebly user associated with your Weebly Cloud account.
Example CURL Request
curl https://api.weeblycloud.com/hosts/user/USER_ID \ -H "X-Public-Key: YOURAPIKEY" \ -H "X-Signed-Request-Hash: YOURSECRETHASH"
Example Response
{ "user": { "email": "[email protected]", "test_mode": true, "language": "en" } }
POST /user
Creates a Weebly user in your Weebly Cloud account. The email address must be unique to all of Weebly or an error will be thrown. If your account is in test mode, all users created through the API will be flagged as test users.
- Required: email
- Optional: test_mode, language
Example CURL Request
curl https://api.weeblycloud.com/hosts/user \ -X POST \ -d '{ "email": "[email protected]", "test_mode": true, "language": "en" }' \ -H "Content-type: application/json" \ -H "X-Public-Key: YOURAPIKEY" \ -H "X-Signed-Request-Hash: YOURSECRETHASH"
Example Response
{ "user": { "user_id": "39793399", "email": "[email protected]", "test_mode": true, "language": "en" } }
PUT /user/USER_ID
Updates an existing Weebly user in your Weebly Cloud account.
- Required: email
- Optional: test_mode, language
Example CURL Request
curl https://api.weeblycloud.com/hosts/user/USER_ID \ -X PUT \ -d '{ "email": "[email protected]", "test_mode": false, "language": "en" }' \ -H "Content-type: application/json" \ -H "X-Public-Key: YOURAPIKEY" \ -H "X-Signed-Request-Hash: YOURSECRETHASH"
Example Response
{ "user": { "email": "[email protected]", "test_mode": false, "language": "en" } }
PATCH /user/USER_ID
Updates the provided fields of an existing Weebly user in your Weebly Cloud account.
- Optional: email, test_mode, language
Example CURL Request
curl https://api.weeblycloud.com/hosts/user/USER_ID \ -X PATCH \ -d '{ "email": "[email protected]" }' \ -H "Content-type: application/json" \ -H "X-Public-Key: YOURAPIKEY" \ -H "X-Signed-Request-Hash: YOURSECRETHASH"
Example Response
{ "user": { "email": "[email protected]", "test_mode": false, "language": "en" } }
POST /user/USER_ID/enable
Enables a user account after an account has been disabled. Enabling a user account will allow users to log into the editor. When a user is created, their account is automatically enabled.
Example CURL Request
curl https://api.weeblycloud.com/hosts/user/USER_ID/enable \ -X POST \ -H "X-Public-Key: YOURAPIKEY" \ -H "X-Signed-Request-Hash: YOURSECRETHASH"
Example Response
{ "success": true }
POST /user/USER_ID/disable
Disables a user account. When a user account is disabled, the user will no longer be able to log into the editor. If an attempt to create a login link is made on a disabled account an error is thrown.
Example CURL Request
curl https://api.weeblycloud.com/hosts/user/USER_ID/disable \ -X POST \ -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 editor for the last site that was modified in the account. This method requires that the account is enabled and that the account has at least one site.
Example CURL Request
curl https://api.weeblycloud.com/hosts/user/USER_ID/loginLink \ -X POST \ -H "X-Public-Key: YOURAPIKEY" \ -H "X-Signed-Request-Hash: YOURSECRETHASH"
Example Response
{ "link": "http://www.weebly.com/editor/login.php?t=c4e48646d7943bdaab0992fdbb5c9594&redirect=toSite.php%3Fsite=682490944919028999" }
Site Info
|
More
|
|