Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
projet-cdaw
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Thibaut Felten
projet-cdaw
Commits
b7301862
Commit
b7301862
authored
Nov 22, 2020
by
thibaut-felten
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
End doc
parent
680771c2
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
105 additions
and
5 deletions
+105
-5
README.md
backend/MVC/README.md
+3
-3
delete_user.md
backend/MVC/doc/delete_user.md
+18
-0
get_user.md
backend/MVC/doc/get_user.md
+1
-1
get_users.md
backend/MVC/doc/get_users.md
+1
-1
post_user.md
backend/MVC/doc/post_user.md
+43
-0
put_user.md
backend/MVC/doc/put_user.md
+39
-0
No files found.
backend/MVC/README.md
View file @
b7301862
...
...
@@ -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}`
backend/MVC/doc/delete_user.md
0 → 100644
View file @
b7301862
# 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"`
backend/MVC/doc/get_user.md
View file @
b7301862
# User
#
GET
User
Used to retrieve the information of one user
...
...
backend/MVC/doc/get_users.md
View file @
b7301862
#
U
sers
#
GET u
sers
Used to retrieve the information of all users.
...
...
backend/MVC/doc/post_user.md
0 → 100644
View file @
b7301862
# 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"`
backend/MVC/doc/put_user.md
0 → 100644
View file @
b7301862
# 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"`
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment