Skip to content

Latest commit

 

History

History
200 lines (132 loc) · 9.79 KB

README.md

File metadata and controls

200 lines (132 loc) · 9.79 KB

tdm_server

This api is developed for our mobile development project - Cars renting app -

Endpoints

POST /login Login to cars renting app
Body
name type data type description
Phon Number required String N/A
Password required String N/A
Responses
http code content-type response
200 application/json Login successfull with JWT token
404 application/json User not found
500 application/json Server error
POST /register Create account in renting car app
Body
name type data type description
phoneNumber required String N/A
creditCardNumber required String N/A
creditCardExpiration required String N/A
drivingLicense required String N/A
Responses
http code content-type response
400 application/json Information not complete
400 application/json Phone number existe
200 application/json JWT token with the generated password
500 application/json Server error
GET /api/users Get all users of the app

Require authentication/authorization

Responses
http code content-type response
200 application/json List of users
500 application/json Server error
GET /api/cars Get all Cars

Require authentication

Responses
http code content-type response
200 application/json List of cars
500 application/json Server error
GET /api/cars/:idCar Get car by id
Parameters
name type data type description
idCar required String N/A
Responses
http code content-type response
200 application/json One car
404 application/json Car not found
500 application/json Server error
GET /api/user/carsRented/:phone Get Cars rented by user
Parameters
name type data type description
phone required String N/A
Responses
http code content-type response
200 application/json List of cars rented
500 application/json Server error
POST /api/reserve/:phone/:idCar Reserve a car by id=idCar
Parameters
name type data type description
phone required String N/A
idCar required String N/A
Responses
http code content-type response
200 application/json List of cars rented
404 application/json Not Found
500 application/json Server error
POST /api/endreserve/:phone/:idCar End reservation of user with car of id=idCar
Parameters
name type data type description
phone required String N/A
idCar required String N/A
Responses
http code content-type response
200 application/json End reservation successfully
404 application/json Car Not Found / User not found
500 application/json Server error
POST /api/editinfo/:phone Edit user information
Parameters
name type data type description
phone required String N/A
Body
name type data type description
phoneNumber Not required unless changed String N/A
password Not required unless changed String N/A
creditCardNumber Not required unless changed String N/A
Responses
http code content-type response
200 application/json Edited Information
404 application/json User not found
500 application/json Information already exists in another user
500 application/json Server error

API Documentation

You can see the documentation here: API Documentation

NOTE: The server is not deployed for the moment