forked from jsoto0025/VariaMosPLE
-
Notifications
You must be signed in to change notification settings - Fork 12
Project management api
aolopezeafit edited this page Jul 28, 2023
·
5 revisions
Get the user's projects.
| Parameter | Value |
|---|---|
| URL | /getprojects/«user id» |
| Verb | GET |
| Authentication | Bearer |
| Response | { "projects": [ { "id": 1, "name": "Project 1" }, { "id": 2, "name": "Project 2" }, ...] } |
| Exception response | Http response code 40x, body: {message:«message error»} |
- Load only if user is authenticated.
- Get user's projects (own and shared).
Notes:
- Add name attribute in table project.
Get the user's project.
| Parameter | Value |
|---|---|
| Verb | GET |
| URL | /getproject/«projectid» |
| Authentication | Bearer |
| Response | «project json» |
| Exception response | Http response code 40x, body: {message:«message error»} |
- Load content only if the user is authenticated and the project is either owned by the user or shared with them.
Save the user's project.
| Parameter | Value |
|---|---|
| Verb | PUT |
| URL | /saveproject/«projectid» |
| Authentication | Bearer |
| Payload | «project json» |
| Response | 200 OK |
| Exception response | Http response code 40x, body: {message:«message error»} |
- Save content only if the user is authenticated and the project is either owned by the user or shared with them with "Modify permission".
Notes:
- Add table permission_project and add foreing key in table user_project
Share the user project with other users.
| Parameter | Value |
|---|---|
| Verb | PUT |
| URL | /shareproject/«projectid» |
| Authentication | Bearer |
| Payload | {"users": [{"userId": «user id»,"permissionIds": [«permission ids»]},...]} |
| Response | 200 OK |
| Exception response | Http response code 40x, body: {message:«message error»} |
- Save content only if the user is authenticated and the project is either owned by the user or shared with them with "Modify permission".
Get the project users.
| Parameter | Value |
|---|---|
| Verb | GET |
| URL | /usersproject/«projectid» |
| Authentication | Bearer |
| Response | {"users": [{"userId": «user id»,"permissionIds": [«permission ids»]},...]} |
| Exception response | Http response code 40x, body: {message:«message error»} |
- Load content only if the user is authenticated and the project is either owned by the user or shared with them.
Find user by email.
| Parameter | Value |
|---|---|
| Verb | GET |
| URL | /finduser/«user email» |
| Authentication | Bearer |
| Response | {"userId": «user id», "userName": «user name», "userEmail": «user email»} |
| Exception response | Http response code 40x, body: {message:«message error»} |
- Load content only if the user is authenticated.
Get the permissions list
| Parameter | Value |
|---|---|
| Verb | GET |
| URL | /permissionproject |
| Authentication | Bearer |
| Response | {[{"permissionId": «permission id»,"permissionName": «permission name»},...]} |
| Exception response | Http response code 40x, body: {message:«message error»} |
- Load content only if the user is authenticated.