Commit b7301862 authored by thibaut-felten's avatar thibaut-felten

End doc

parent 680771c2
......@@ -7,13 +7,13 @@ Open endpoints require no Authentication.
* [Login](doc/login.md) : `POST /api/login/`
* [Get all users data](doc/get_users.md) : `GET /api.php/users/`
* [Show data of a user](doc/get_user.md) : `GET /api.php/user/{id}`
* Create a new user : `POST /api.php/user/{id}`
* Delete a user : `DELETE /api.php/user/{id}` Should be a closed endpoint.
* [Create a new user](doc/post_user.md) : `POST /api.php/user/`
* [Delete a user](doc/delete_user.md) : `DELETE /api.php/user/{id}` Should be a closed endpoint.
## Endpoints that require Authentication
Closed endpoints require a valid Token to be included in the header of the
request.
* Update data : `PUT /api.php/user/{id}`
* [Update user informations](doc/put_user.md) : `PUT /api.php/user/{id}`
# DELETE User
Used to delete a user account.
**URL** : `/api.php/user/{id}`
**Method** : `DELETE`
**Auth required** : NOT FOR THE MOMENT BUT WORKING ON IT
## Success Response
**Code** : `200 OK`
**Content example**
`"User deleted"`
# User
# GET User
Used to retrieve the information of one user
......
# Users
# GET users
Used to retrieve the information of all users.
......
# POST User
Used to create a new user
**URL** : `/api.php/user/`
**Method** : `POST`
**Auth required** : NO
**Data constraints**
```json
{
"USER_LOGIN":"[login which does not already exists]",
"USER_PASSWORD":"[encrypted password]",
"USER_EMAIL":"[valid email address]",
"USER_ROLE":"[int corresponding to the role of the user]",
"USER_FIRSTNAME":"[First name of the user]",
"USER_LASTNAME":"[Last name of the user]"
}
```
**Data example**
```json
{
"USER_LOGIN":"test",
"USER_PASSWORD":"$2y$12$d.e18TWr661D9/spQRbE/u5HwK1yNUCDSyAlQwVGZLckBZAOofCmy",
"USER_EMAIL":"test@example.com",
"USER_ROLE":"1",
"USER_FIRSTNAME":"test",
"USER_LASTNAME":"test"
}
```
## Success Response
**Code** : `200 OK`
**Content example**
`"User created"`
# PUT User
Used to update a new user
**URL** : `/api.php/user/{id}`
**Method** : `PUT`
**Auth required** : YES
**Data constraints**
```json
{
"USER_LOGIN":"[login which does not already exists]",
"USER_EMAIL":"[valid email address]",
"USER_FIRSTNAME":"[First name of the user]",
"USER_LASTNAME":"[Last name of the user]"
}
```
**Data example**
```json
{
"USER_LOGIN":"test",
"USER_EMAIL":"test@example.com",
"USER_FIRSTNAME":"test",
"USER_LASTNAME":"test"
}
```
## Success Response
**Code** : `200 OK`
**Content example**
`"User updated"`
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment