@ -218,6 +219,43 @@ For any unsuccsesful attempt, you will receive a 401 error response.
}
}
```
```
### List Users (Admin Ability Required)
To list the users, make an `HTTP GET` call to the following route, with Admin Token obtained from Admin Login. Add this token as a standard `Bearer Token` to your API call.
```shell
http://localhost:8000/api/users
```
**API Payload & Response**
No payload required for this call.
You will get a JSON response with all users available in your project.
```json
[
{
"id": 1,
"name": "Hydra Admin",
"email": "admin@hydra.project"
},
{
"id": 2,
"name": "Test User",
"email": "test@hydra.project"
},
]
```
For any unsuccsesful attempt or wrong token, you will receive a 401 error response.
```json
{
"message": "Unauthenticated."
}
```
### Update a User (User/Admin Ability Required)
### Update a User (User/Admin Ability Required)
To update an existing user, make a `HTTP PUT` request to the following route. Replace {userid} with actual user id. You must includ a Bearer token obtained from User/Admin authentication. A bearer admin token can update any user. A bearer user token can only update the authenticated user by this token.
To update an existing user, make a `HTTP PUT` request to the following route. Replace {userid} with actual user id. You must includ a Bearer token obtained from User/Admin authentication. A bearer admin token can update any user. A bearer user token can only update the authenticated user by this token.