----------------------------------------------------------------Methods--------------------------------------------------------- GET:
- /booking URL Encoding Method call
Input Params:
- uuid : Unique User ID
- from_station : From station
- to_station: To station
- date_time: 20220615090105; Format: YYYYMMDDhhmmss
- class: Class as 1st or 2nd; valid input: 1 or 2
- no_of_passenger: Number of passengers
- special_service_flag: Special Service Flag
- seats: Number of seats to reserve
- food_service: Food Service required
- luggage_service: Luggage Service required
Output Params:
- uuid: Unique User ID
- from_station_name: From station name
- from_station_id: From station id
- to_station_name: To station name
- to_station_id: To station id
- train_date: Train date which was given in input
- class: Class as 1st or 2nd; valid input: 1 or 2
- amount: Amount/Person
- total_amount: Total Amount
- no_of_passenger: Number of passengers
- special_service_flag: Special Service Flag
- seat: Number of seats to reserve
- food_service: Food Service required
- luggage_service: Luggage Service required
- connecting: Is the train connecting train
- connecting_station: Connecting station name
- connecting_station_id: Connecting station id
- is_connection: Is the request valid
- train_list_count: Number of options to choose from
- path: path of train
- train_list: List of train 20.1 count_no: Count number 20.2 train_time_id: train time ID 20.3 train_id: train ID 20.4 train_start_time: Train start time 20.5 train_end_time: Train end time 20.6 train_type: Train type as ICE or RE/B; type 1 = ICE and type 2 = RE/B
- via: 1 when connecting train path 21.1 train_list_count: Connecting number of options 21.2 path: path of train 21.3 train_list: Connecting list of train 21.3.1 count_no: count number 21.3.2 train_time_id: train time ID 21.3.3 train_id: train ID 21.3.4 train_start_time: Train start time 21.3.5 train_end_time: Train end time 21.3.6 train_type: Train type as ICE or RE/B; type 1 = ICE and type 2 = RE/B
Result: { "uuid": "abc", "from_station_name": "erfurt", "from_station_id": "11", "to_station_name": "frankfurt", "to_station_id": "1", "class": "2", "amount": 52.5, "total_amount": 105, "no_of_passenger": "2", "special_service_flag": "true", "seats": "2", "food_service": "true", "luggage_service": "false", "connecting": 0, "is_connection": 1, "train_list_count": 4, "path": "start-erfurt-frankfurt-end", "train_list": [ { "count_no": 0, "train_time_id": "102", "train_id": "1017", "train_start_time": "09:00:00", "train_end_time": "10:00:00", "train_type": "2" }, { "count_no": 1, "train_time_id": "98", "train_id": "1016", "train_start_time": "10:00:00", "train_end_time": "11:00:00", "train_type": "1" }, { "count_no": 2, "train_time_id": "103", "train_id": "1017", "train_start_time": "11:00:00", "train_end_time": "12:00:00", "train_type": "2" }, { "count_no": 3, "train_time_id": "104", "train_id": "1017", "train_start_time": "13:00:00", "train_end_time": "14:00:00", "train_type": "2" } ] }
Result: { "uuid": "abc", "from_station_name": "erfurt", "from_station_id": "11", "to_station_name": "munich", "to_station_id": "5", "class": "2", "amount": 52.5, "total_amount": 588, "no_of_passenger": "2", "special_service_flag": "true", "seats": "2", "food_service": "true", "luggage_service": "false", "connecting": 1, "connecting_station": "frankfurt", "connecting_train_id": "1", "is_connection": 1, "train_list_count": 4, "path": "start-erfurt-frankfurt-end", "train_list": [ { "count_no": 0, "train_time_id": "98", "train_id": "1016", "train_start_time": "10:00:00", "train_end_time": "11:00:00", "train_type": "1" }, { "count_no": 1, "train_time_id": "103", "train_id": "1017", "train_start_time": "11:00:00", "train_end_time": "12:00:00", "train_type": "2" }, { "count_no": 2, "train_time_id": "104", "train_id": "1017", "train_start_time": "13:00:00", "train_end_time": "14:00:00", "train_type": "2" }, { "count_no": 3, "train_time_id": "105", "train_id": "1017", "train_start_time": "15:00:00", "train_end_time": "16:00:00", "train_type": "2" } ], "via": { "train_list_count": 4, "path": "start-frankfurt-stuttgart-augsburg-nurnburg-munich-end", "train_list": [ { "count_no": 1, "train_time_id": "8", "train_id": "1002", "train_start_time": "12:00:00", "train_end_time": "14:00:00", "train_type": "2" }, { "count_no": 2, "train_time_id": "2", "train_id": "1001", "train_start_time": "15:00:00", "train_end_time": "17:00:00", "train_type": "1" }, { "count_no": 3, "train_time_id": "2", "train_id": "1001", "train_start_time": "15:00:00", "train_end_time": "17:00:00", "train_type": "1" }, { "count_no": 4, "train_time_id": "10", "train_id": "1002", "train_start_time": "18:00:00", "train_end_time": "20:00:00", "train_type": "2" } ] } }
Result: { "uuid": "abc", "from_station_name": "hamburg", "from_station_id": "3", "to_station_name": "munich", "to_station_id": "5", "class": "2", "amount": 252, "total_amount": 987, "no_of_passenger": "2", "special_service_flag": "true", "seats": "2", "food_service": "true", "luggage_service": "false", "connecting": 1, "connecting_station": "frankfurt", "connecting_train_id": "1", "is_connection": 1, "train_list_count": 4, "path": "start-hamburg-hannover-frankfurt-end", "train_list": [ { "count_no": 0, "train_time_id": "75", "train_id": "1012", "train_start_time": "11:00:00", "train_end_time": "16:00:00", "train_type": "2" }, { "count_no": 1, "train_time_id": "76", "train_id": "1012", "train_start_time": "13:00:00", "train_end_time": "18:00:00", "train_type": "2" }, { "count_no": 2, "train_time_id": "70", "train_id": "1011", "train_start_time": "14:00:00", "train_end_time": "19:00:00", "train_type": "1" }, { "count_no": 3, "train_time_id": "77", "train_id": "1012", "train_start_time": "15:00:00", "train_end_time": "20:00:00", "train_type": "2" } ], "via": { "train_list_count": 4, "path": "start-frankfurt-stuttgart-augsburg-nurnburg-munich-end", "train_list": [ { "count_no": 1, "train_time_id": "10", "train_id": "1002", "train_start_time": "18:00:00", "train_end_time": "20:00:00", "train_type": "2" }, { "count_no": 2, "train_time_id": "3", "train_id": "1001", "train_start_time": "20:00:00", "train_end_time": "22:00:00", "train_type": "1" }, { "count_no": 3, "train_time_id": "3", "train_id": "1001", "train_start_time": "20:00:00", "train_end_time": "22:00:00", "train_type": "1" }, { "count_no": 4, "train_time_id": "11", "train_id": "1002", "train_start_time": "22:00:00", "train_end_time": "00:00:00", "train_type": "2" } ] } }
- /equire/{uuid}
Link: http://3.220.176.193/index.php/train/enquire/ab123 Output: { "uuid": "ab123", "status": "complete", "train_time_id": "99", "from_station_id": "11", "to_station_id": "1", "train_date": "2022-06-30", "train_start_time": "14:00:00", "train_end_time": "15:00:00", "class": "2", "booking_time": "2022-06-27 17:23:06", "connecting": "0", "payment_status": "COMPLETE", "amount": "105.00", "no_of_passenger": "2", "special_service_flag": true, "seats": "2", "seat_no": "1,2", "food_service": true, "luggage_service": true }
POST:
- /booking/{uuid}
- uuid
- train_time_id
- from_station_id
- to_station_id
- train_start_time
- train_end_time
- train_date
- class
- booking_time = current_timestamp()
- connecting
- connecting_station_id
- connecting_train_time_id
- connecting_train_start_time
- connecting_train_end_time
- payment_status
- amount
- no_of_passenger
- special_service_flag
- seats
- food_service
- luggage_service
Output:
- status: API call status
- uuid
- payment_status
- special_service_flag
- seat_no
- via_seat_no
Test 1: http://3.220.176.193/index.php/train/booking/abc123 Input: { "train_time_id":99, "from_station_id":"11", "to_station_id":"1", "train_start_time":"14:40:00", "train_end_time":"15:00:00", "train_date":"2022-06-30", "class":2, "connecting":0, "payment_status":"INCOMPLETE", "amount":105, "no_of_passenger":3, "special_service_flag":true, "seats":3, "food_service": true, "luggage_service": true } Output:
{ "status": "complete", "uuid": "abc123", "payment_status": "INCOMPLETE", "special_service_flag": true, "seat_no": "5,6,7" }
Test 2: http://3.220.176.193/index.php/train/booking/abc123
Input: { "train_time_id":99, "from_station_id":11, "to_station_id":5, "train_start_time":"14:40:00", "train_end_time":"15:00:00", "train_date":"2022-06-30", "class":2, "connecting":1, "connecting_station_id": 1, "connecting_train_time_id": 9, "connecting_train_start_time": "16:00:00", "connecting_train_end_time": "18:00:00", "payment_status":"INCOMPLETE", "amount":588, "no_of_passenger":2, "special_service_flag":"true", "seats":2, "food_service": "true", "luggage_service": "false" }
Output: { "status": "complete", "uuid": "abc456", "payment_status": "INCOMPLETE", "special_service_flag": "true", "seat_no": "8,9", "via_seat_no": "3,4" }
PUT:
- /booking/{uuid} Link: http://3.220.176.193/index.php/train/booking/ab123 Input: { "payment_status": "COMPLETE", "special_service_flag": true, "seat_no": 2, "food_service": true, "luggage_service": true }
Output: { "uuid": "ab123", "status": "complete", "seat_no": "1,2" }
DELETE:
- /booking/{uuid} Link: http://3.220.176.193/index.php/train/booking/ab123 Output: { "uuid": "ab123", "status": "complete" }
--------------------------------------------------- Required Database details to FE --------------------------------------------------------- station frankfurt cologne hamburg berlin munich dortmund hannover stuttgart augsburg nurnberg erfurt leipzig