Users
#
Basic conceptsThe project API provides users
resource out of the box.
This includes all CRUD actions on users
like a regular API resource and also the endpoint for authentication.
#
Registering/Creating usersPOST
https://{app-id}.essentialz.cloud/users
User registration/creation is very simple. You should just make a POST
request to /users
with three parameters email
,
password
and provider
. Provider is always equal to email
. Example request could look like this:
- fetch
- curl
After successful registration/creation you will receive response object that look like this:
#
Get all usersGET
https://{app-id}.essentialz.cloud/users
To get all users you should make a GET
request to /users
. Basic example using fetch:
- fetch
- curl
Response is an array of user objects:
#
Get userGET
https://{app-id}.essentialz.cloud/users/{user-id}
To get user you should make GET
request to /users/{user-id}
where user-id
is a value of user object id property. Using fetch request can
look like this (don't forget to add {authorization : Bearer XXXXX}
header, where XXXXX
is your token):
- fetch
- curl
Response has following fields:
#
Update usersPUT
https://{app-id}.essentialz.cloud/users/{user-id}
To update user you should send a PUT
request to /users/{user-id}
where user-id
is a value of user object id property. Request
body should have everything you want to update about user. For example if you want to update user details object with his new address
you could write, using fetch:
- fetch
- curl
As a response you will receive user object with updated properties.
#
Deleting usersDELETE
https://{app-id}.essentialz.cloud/users/{user-id}
If you want to delete a user you should send DELETE
request at /users/{user-id}
where user-id
is a value of user object id property.
An example request using fetch:
- fetch
- curl