Base API link: https://api-notey.herokuapp.com/
Function | URL |
---|---|
Register a user | /api/1.0/user/register |
Register a user
This registers a user and hashes the password in the database. With ajax you can call this function with the approporiate url.
You'll need three values:
- userName
- password
Example:
userName: $('#userName').val(),
email: $('#userEmail').val(),
password: $('#userPassword').val()
There are two errors that can occur:
- 409, which means that there is a duplicate user name
- 400, which means that one or more fields are mepty
All error messages come in a JSON-Object meaning there is different parts to the message:
Type | Datatype |
---|---|
success | bool |
messageCode | int |
errorMessage | String |
Example:
{ success: false, errorCode: 400, errorMessage: "You have to fill all fields!" }
result.errorMessage will become You have to fill all fields