Commit 680771c2 authored by thibaut-felten's avatar thibaut-felten

Doc maj

parent ae807c23
......@@ -5,8 +5,8 @@
Open endpoints require no Authentication.
* [Login](doc/login.md) : `POST /api/login/`
* Get all users data : `GET /api.php/users/`
* Show data of a user : `GET /api.php/user/{id}`
* [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.
......
# User
Used to retrieve the information of one user
**URL** : `/api.php/user/{id}`
**Method** : `GET`
**Auth required** : NO
## Success Response
**Code** : `200 OK`
**Content example**
```json
{
"USER_ID": "1",
"USER_LOGIN": "loginRoot3",
"USER_EMAIL": "toto@gmail.com",
"USER_PASSWORD": "$2y$12$d.e18TWr661D9/spQRbE/u5HwK1yNUCDSyAlQwVGZLckBZAOofCmy",
"USER_FIRSTNAME": "root",
"USER_LASTNAME": "root",
"USER_ROLE": "1"
}
```
# Users
Used to retrieve the information of all users.
**URL** : `/api.php/users/`
**Method** : `GET`
**Auth required** : NO
## Success Response
**Code** : `200 OK`
**Content example**
```json
{"USER_ID":"1","USER_LOGIN":"loginRoot3","USER_EMAIL":"toto@gmail.com","USER_PASSWORD":"$2y$12$d.e18TWr661D9\/spQRbE\/u5HwK1yNUCDSyAlQwVGZLckBZAOofCmy","USER_FIRSTNAME":"root","USER_LASTNAME":"root","USER_ROLE":"1"},{"USER_ID":"3","USER_LOGIN":"cunlogin","USER_EMAIL":"emailtest@test.com","USER_PASSWORD":"test","USER_FIRSTNAME":"test","USER_LASTNAME":"test","USER_ROLE":"1"}
```
<!-- LOGIN -->
# Login
Used to collect a Token for a registered User.
......@@ -42,9 +40,19 @@ Used to collect a Token for a registered User.
## Error Response
### Missing field
**Condition** : Missing field pwd or login.
**Code** : `422`
**Content** : `login and pwd fields are mandatory`
### Wrong password or login
**Condition** : Wrong combination login/password.
**Code** : `422`
**Content** : `wrong credentials`
\ No newline at end of file
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