-
Notifications
You must be signed in to change notification settings - Fork 0
Managing_users
The users endpoint is used to list/update and remove users.
ALMOST ALL USERS ENDPOINT REQUIRE AN ADMIN AUTHORISATION The following/{} endpoint does not require admin authorisation.
- Create a get method, so the user can be shown.
- Create an update method, so users can be changed.
- Create a remove method, so users can be removed.
The get endpoints do not use any body text.
-
/api/usersreturns all users.
[
{
"id": 1,
"first_name": "Adonis",
"insertion": "van",
"last_name": "Dare",
"email": "test@test.nl",
"email_verified_at": "2020-04-28T13:19:13.000000Z",
"postal_code": "5673RE",
"role": "rockstar",
"created_at": "2020-04-28T13:19:13.000000Z",
"updated_at": "2020-04-28T13:19:13.000000Z"
}
]
-
[]- There are no users to show
200 OK - returns a JSON object with all users.
The put endpoints do not require anything in the body. Only add the fields you want to change to the body.
-
/api/users/[id]returns the entire (edited) user.-
first_name(string, max:191) - The first name. -
insertion(nullable, max:191) - The insertion. -
last_name(string, max:191) - The last name. -
postal_code(NL|DE|BE Postal code) - The postal code. -
password(string, max:191) - The users password. -
role(string has to be: guest, partner, rockstar or admin) - Change the users role
-
- Errors are equal to the
create endpoint - No error will be trown when the body is empty
200 OK - returns a JSON object with the updated user data.
The delete endpoint does not require anything in the body.
-
/api/users/[id]removes the user and returns it.
404 Not found - The requested user does not exist
200 OK - returns a JSON object with the removed user.
The get endpoint does not require anything in the body.
-
/api/users/following/hostsreturns the hosts followed by the user.
404 Not found - The requested user does not exist
200 OK - returns a JSON object containing all hosts followed by the current user.
The get endpoint does not require anything in the body.
-
/api/users/following/categoriesreturns the categories followed by the user.
404 Not found - The requested user does not exist
200 OK - returns a JSON object containing all categories followed by the current user.