Define a new user
This API allows registering a user:
Verb | POST |
Resource | /api/user/v1/register |
Content type | application/x-www-form-urlencoded |
Body | name=<name>& email=<email>& password=<password> |
Where:
Field | Description |
name | The user name |
The user email address | |
password | The user password |
Response code
The expected response code is 201
Response data
The response data is a JSON object with the following structure:
{ | Field | Description |
“status”: “success, | Request successful | |
“data”: { | Response data | |
“user_id”: “<user Id>” | User ID (int) | |
“user_secret”:”<user secret>” | A base64 encoded 32 byte secret | |
} | ||
} |
Update a user password
This API allows to update an existing user password:
Verb | PATCH |
Resource | /api/user/v1/changepassword |
Content type | application/x-www-form-urlencoded |
Body | email=<email>& oldpassword=<old password>& newpassword=<new password> |
Where:
Field | Description |
The user email address | |
oldpassword | The user current password |
newpassword | The desired new user password |
Response code
The expected response codes are:
200: OK
422: wrong old password
Response data
The response data is a JSON object with the following structure:
{ | Field | Description |
“status”: “success”, | Request successful | |
} |
Reset a user password
This API allows resetting a user password (backend generated)
Verb | PATCH |
Resource | /api/user/v1/resetpassword |
Content type | application/x-www-form-urlencoded |
Body | email=<email> |
Where:
Field | Description |
The user email address |
Response code
The expected response code is 200
Response data
The response data is a JSON object with the following structure:
{ | Field | Description |
“status”: “success, | Request successful | |
“data”: { | Response data | |
"email": "<email>", | The user email | |
"password": "<new password>” | The new generated password | |
} | ||
} |