Users
Get all users
You can access the list of 3 users by using the /users
endpoint.
Request:
Response:
Get a single user
You can get a single user by adding the id
as a parameter: /users/{id}
Request:
Response:
Create a user
You can create a new user by sending an object like the following to /users/
Request:
Response:
Note that the password is encrypted, you can also feel free to add the attribute
phone
to the creation body.
Update a user
You can update a user exists by sending an object like the following and adding the id
as a parameter: /users/{id}
Request:
Response:
Note that is not necessary to send all user attributes, just send the attributes that want to update.
Delete a user
You can delete an existing user by sending the request using id
as a parameter: /users/{id}
Request:
Response:
Note that you have to be an authorized user with the admin role to be able to delete a user.
Check the email
You can verify if an email is already registered in the API.
Request:
Response:
This feature is so useful for features like showing a message in a form and verifying the email before creating a user. For example:
Schema User
Attribute | Type | Description |
---|---|---|
id | string | The id of the user. |
name | string | The name of the user. |
string | The email of the user. | |
password | string | The password of the user. |
phone | number | The phone number of the user. |
isActive | boolean | Whether the user is active or inhabilitated. |
role | string | The role of the user is user, super-user or admin. |