Contents:
This API call creates a new user account.
When creating an account, the user must specify an e-mail address, a username, and optionally a display name. The username is used in the URL of the user's profile on the website. By default the profile is not visible, unless the user has specifically added any user-generated content such as a Photomap submission.
A successful submission will issue an e-mail, which the user must click on to validate the account and thereby complete the user creation process.
In subsequent validation using the user.validate call, or using the login form on the website, users can use either their username or e-mail address as the identity to validate against.
Usernames and e-mail addresses are unique, i.e. a user cannot have multiple accounts against a single e-mail address.
Security: Passwords are not stored in plain text but instead only as a hash. (Hashes are automatically upgraded upon login as newer algorithms become available.) Also, as with the rest of the API, this method requires use of HTTPS.
Example which creates a new user account, triggering an e-mail for validation.
POST https://api.cyclestreets.net/v2/user.create ( [username] => myusername [password] => mypassword1978 [email] => user@example.com [name] => Sam Smith )
Result:
{ "successmessage": "Please check your e-mail to confirm the account creation." }
This call requires a POST operation, to avoid us logging user credentials in the server logs.
If successful, a JSON object as above, containing a single field successmessage
, the value of which is a string that should be passed on to the user.
JSON object containing an error key and a text string.
The error string from this method is suitable for passing directly on to the user.
Example errors (text string may vary):
{ "error": "There was a problem creating the account. Please try again later." }
{ "error": "The password must include at least one letter and number." }