API
URL
- http://serveurpi.ddns.net/MBAL/api - Début de la requête
TO DO
- Request : <_http://serveurpi.ddns.net/MBAL/oauth/token?grant_type=password&username=admin&password=Valentin34>
- Response :
JSON -> access_token
TO add at each header of a request
-
URL
</user/login>
-
Method:
POST
-
Data Params
Required:
username=[string]
password=[string]
-
Success Response:
- Code: 200
Content:{ session_id : UYHJGF-457686-HKJKH }
- Code: 200
-
Error Response:
- Code: 500 INTERNAL_SERVER_ERROR
-
URL
</user/logout/{session_id}>
-
Method:
GET
-
Data Params
Required:
session_id=[string]
-
Success Response:
- Code: 200
Content:{ Response : String }
- Code: 200
-
Error Response:
- Code: 500 INTERNAL_SERVER_ERROR
-
URL
</user/create>
-
Method:
POST
-
Data Params
Required:
name=[string]
prenom=[string]
mail=[string]
password=[string]
num_tel=[string]
role=[string] -> USER
-
Success Response:
- Code: 200
Content:{ Response : String }
- Code: 200
-
Error Response:
- Code: 500 INTERNAL_SERVER_ERROR
-
URL
</user/activate/{id}>
-
Method:
GET
-
Data Params
Required:
id=[string] -> present in mail sent
-
Success Response:
- Code: 200
Content:{ Response : String }
- Code: 200
-
Error Response:
- Code: 500 INTERNAL_SERVER_ERROR
-
URL
</user/getSessionIdByUsername/{username}/> Le dernier / est important !
-
Method:
GET
-
Data Params
Required:
username=[string] -> mail address
-
Success Response:
- Code: 200
Content:{ Response : String }
- Code: 200
-
Error Response:
- Code: 500 INTERNAL_SERVER_ERROR
-
URL
</user/deleteUser>
-
Method:
POST
-
Data Params
Required:
username=[string] -> mail address
-
Success Response:
- Code: 200
Content:{ Response : String }
- Code: 200
-
Error Response:
- Code: 500 INTERNAL_SERVER_ERROR
-
URL
</user/updateUser>
-
Method:
POST
-
Data Params
Required (blank if attribute not to be updated) :
session_id=[string] -> actual session
name=[string]
prenom=[string]
password=[string]
numero_telephone=[string]
-
Success Response:
- Code: 200
Content:{ Response : String }
- Code: 200
-
Error Response:
- Code: 500 INTERNAL_SERVER_ERROR
-
URL
</user/checkIfPasswordCorrect>
-
Method:
POST
-
Data Params
Required :
username=[string] -> mail address
password=[string]
-
Success Response:
- Code: 200
Content:{ Response : String }
- Code: 200
-
Error Response:
- Code: 500 INTERNAL_SERVER_ERROR
-
URL
</user/setFamilyForUser>
-
Method:
POST
-
Data Params
Required :
session_id=[string] -> actual session id
name_family=[string]
password_family=[string]
-
Success Response:
- Code: 200
Content:{ Response : String }
- Code: 200
-
Error Response:
- Code: 500 INTERNAL_SERVER_ERROR
-
URL
</getUserByName/{username}/>
-
Method:
GET
-
Data Params
Required :
username=[string]
-
Success Response:
- Code: 200
Content:JSON -> attribute : nom,prenom,mail,creation_date,numero_telephone, token_telephone,nom_photo_profil,isActivated, Family(name,creation_date)
- Code: 200
-
Error Response:
- Code: 500 INTERNAL_SERVER_ERROR
-
URL
</user/getUsersByFamilyName/{family_name}>
-
Method:
GET
-
Data Params
Required :
family_name=[String]
-
Success Response:
- Code: 200
Content:{ JSON -> List of users }
- Code: 200
-
Error Response:
- Code: 500 INTERNAL_SERVER_ERROR
-
URL
</user/getPathProfilePicture/{session_id}>
-
Method:
GET
-
Data Params
Required :
session_id=[string] -> actual session id
-
Success Response:
- Code: 200
Content:{ Response : String }
- Code: 200
-
Error Response:
- Code: 500 INTERNAL_SERVER_ERROR
-
URL
</user/setProfilePicture>
-
Method:
POST
-
Data Params
Required :
session_id=[string] -> actual session id
uploadfile=[File] -> Multipart File
-
Success Response:
- Code: 200
Content:{ Response : String }
- Code: 200
-
Error Response:
- Code: 500 INTERNAL_SERVER_ERROR
-
URL
</user/files/{filename}>
-
Method:
GET
-
Data Params
Required :
filename=[String] -> name_profile_picture
-
Success Response:
- Code: 200
Content:{ Picture To Download }
- Code: 200
-
Error Response:
- Code: 500 INTERNAL_SERVER_ERROR