- Adjust the base URL of the API requests to the URL where the website is hosted.
- Every response is a JSON object with either of the two keys
data
anderrors
and astatus
key. - Every
errors
key is an object consisting of multiple errors with each error having atitle
key. status
key has200
for a successful request,400
for a bad request,401
for an unauthorized request and500
for an internal server error.- All API requests except the login route must be made with the token.
- All dates parameter in the request must be of the format yyyy-mm-dd
- In the new user registration page, make dropdowns for the role key with the values "admin", "write", "read".
- Send the token key for all the API requests except the login route.
- In the new rake registration page, make dropdowns for railway key with the railway zone code values
- In the new coach registration page, make dropdown for the rake number key (get the list of rake numbers for the current rakes)
- In the coach registration page, make dropdown for the type key with the values "trailer", "driving", "motor" and "handicapped"
- In the new coach status and position page, make dropdown for the coach number key (get the list of coach numbers for the current coaches)
- In the shell received page display the list of coaches present in the shell received line plus the paint shop and the total quantity.
- Convert / to _ if {rake_num} or {coach_num} is present in the URL
Path | Description |
---|---|
/api/login |
User Login |
/api/logout |
User Logout |
/api/admin/newuser |
Admin Route for adding new users |
/api/admin/edituser |
Admin Route for editing an user's profile |
/api/admin/getall |
Admin Route for getting all the users' profile |
/api/admin/getuser |
Admin Route for getting an user's profile |
/api/user/profile |
User Route for getting his/her profile |
/api/user/editprofile |
User Route for editing his/her profile |
/api/rakes/new |
Route for adding a new rake |
/api/rakes/getall |
Route for getting all the rakes |
api/rakes/edit/{field_name} |
Route for editing a particular rake |
api/rakes/delete |
Route for deleting a particular rake |
/api/rakes/{rake_num} |
Route for getting a rake by it's number |
/api/rakes/{rake_num}/coaches |
Route for getting all the coaches of a rake number |
/api/rakes/{rake_num}/statuses |
Route for getting the statuses of all the coaches of a rake |
/api/rakes/{rake_num}/positions |
Route for getting the positions of all the coaches of a rake |
/api/coaches/new |
Route for adding a new coach |
api/coaches/edit/{field_name} |
Route for editing a particular coach |
api/coaches/delete |
Route for deleting a particular coach |
/api/coaches/getall |
Route for getting all the coaches |
/api/coaches/{coach_num} |
Route for getting a coach by its number |
/api/coaches/{coach_num}/status |
Route for getting the status of a coach |
/api/coaches/{coach_num}/position |
Route for getting the position of a coach |
/api/status/new |
Route for adding a new status of a coach |
/api/status/edit/{field_name} |
Route for editing an existing status of a coach |
/api/status/getall |
Route for getting all the statuses |
/api/position/new |
Route for adding a new position/editing an existing position of a coach |
/api/position/getall |
Route for getting all the positions |
{
"username": string,
"password": string
}
{
"data": {
"token": string,
"message": string
},
"status": 200
}
{
"token": string
}
{
"data": {
"message": string
},
"status": 200
}
Admin can add new users
Role should be "read"/"write"/"admin". "read" role allows only read access. "write" role allows adding new rakes, coaches, positions and statuses. "admin" role allows write access and access for adding new users, editing a user's profile and credentials.
Position means the rank of job eg. SSE or AWM
Position, E-Mail and Mobile are optional
{
"token": string,
"name": string,
"password": string,
"role": string,
"position": string,
"email": email,
"mobile" numeric,
}
{
"data": {
"message": string
},
"status": 200
}
Admin can edit user profile including credentials
{
"token": string,
"name": string,
"password": string,
"role": string,
"position": string,
"email": email,
"mobile" numeric,
}
{
"data": {
"message": string
},
"status": 200
}
Admin can get all the users' profile
{
"token": string
}
Considering only 2 users
{
"data": [
{
"name": string,
"username": string,
"role": string,
"position": string,
"email": email,
"mobile": numeric
},
{
"name": string,
"username": string,
"role": string,
"position": string,
"email": email,
"mobile": numeric
},
],
"status": 200
}
{
"token": string,
"username": string
}
{
"data":
{
"name": string,
"username": string,
"role": string,
"position": string,
"email": email,
"mobile": numeric
},
"status": 200
}
{
"token": string,
}
{
"data":
{
"name": string,
"username": string,
"role": string,
"position": string,
"email": email,
"mobile": numeric
},
"status": 200
}
User cannot change his password. He/She needs to request the admin.
Position, E-mail and Mobile are optional.
{
"token": string,
"name": string,
"role": string,
"position": string,
"email": email,
"mobile" numeric,
}
{
"data": {
"message": string
},
"status": 200
}
Only "write" and "admin" role users can add new rakes
{
"token": string,
"railway": string,
"rake_num": string,
"despatch": string
}
{
"data": {
"message": string
},
"status": 200
}
Only "write" and "admin" role users can edit rakes
Replace {field_name} with the field name you want to update. Field name must be in lower case.
old_rakenum
stands for the rake to be edited and it is required.
Only one parameter can be updated at a time.
{
"token": string,
"old_rakenum": string,
"railway": string,
"rake_num": string,
"despatch": date
}
{
"data": {
"message": string
},
"status": 200
}
Replace {rake_num} with the rake number
{
"token": string,
}
{
"data": {
"message": string
},
"status": 200
}
{
"token": string,
}
Considering only 2 rakes
{
"data": [
{
"railway": string,
"rake_num": string
},
{
"railway": string,
"rake_num": string
},
],
"status": 200
}
Replace {rake_num} with the rake number
{
"token": string,
}
{
"data": {
"railway": string,
"rake_num": string
},
"status": 200
}
Replace {rake_num} with the rake number
{
"token": string,
}
Considering only 2 coaches are present in the rake
{
"data": [
{
"coach_num": string,
"type": string
},
{
"coach_num": string,
"type": string
},
],
"status": 200
}
Replace {rake_num} with the rake number
{
"token": string,
}
Considering only 2 statuses
All date formats must be yyyy-mm-dd
{
"data": [
{
"shell_rec": date/null,
"intake": date/null,
"agency": string/null,
"conduit": date/null,
"coupler": date/null,
"ew_panel": date/null,
"roof_tray": date/null,
"ht_tray": date/null,
"ht_equip": date/null,
"high_dip": date/null,
"uf_tray": date/null,
"uf_trans": date/null,
"uf_wire": string/null,
"off_roof": date/null,
"roof_clear": date/null,
"off_ew": date/null,
"ew_clear": date/null,
"mech_pan": string/null,
"off_tf": date/null,
"tf_clear": date/null,
"tf_prov": date/null,
"lf_load": date/null,
"off_pow": date/null,
"power_hv": date/null,
"off_dip": date/null,
"dip_clear": date/null,
"lower": date/null,
"off_cont": date/null,
"cont_hv": date/null,
"load_test": date/null,
"rmvu": date/null,
"panto": date/null,
"pcp_clear": date/null,
"bu_form": date/null,
"rake_form": date/null,
"remarks": string/null,
"coach_num": string
},
{
"shell_rec": date/null,
"intake": date/null,
"agency": string/null,
"conduit": date/null,
"coupler": date/null,
"ew_panel": date/null,
"roof_tray": date/null,
"ht_tray": date/null,
"ht_equip": date/null,
"high_dip": date/null,
"uf_tray": date/null,
"uf_trans": date/null,
"uf_wire": string/null,
"off_roof": date/null,
"roof_clear": date/null,
"off_ew": date/null,
"ew_clear": date/null,
"mech_pan": string/null,
"off_tf": date/null,
"tf_clear": date/null,
"tf_prov": date/null,
"lf_load": date/null,
"off_pow": date/null,
"power_hv": date/null,
"off_dip": date/null,
"dip_clear": date/null,
"lower": date/null,
"off_cont": date/null,
"cont_hv": date/null,
"load_test": date/null,
"rmvu": date/null,
"panto": date/null,
"pcp_clear": date/null,
"bu_form": date/null,
"rake_form": date/null,
"remarks": string/null,
"coach_num": string
},
],
"status": 200
}
Replace {rake_num} with the rake number
{
"token": string,
}
Considering only 2 positions
{
"data": [
{
"linename": string,
"stage": integer/null,
"lineno":integer/null,
"coach_num": string
},
{
"linename": string,
"stage": integer/null,
"lineno":integer/null,
"coach_num": string
},
],
"status": 200
}
Type is trailer, driving, motor or handicapped.
Only "write" and "admin" role users can add new coaches
{
"token": string
"coach_num": string,
"rake_num": string,
"type": string
}
{
"data": {
"message": string
},
"status": 200
}
Only "write" and "admin" role users can edit coaches
Replace {field_name} with the field name you want to update. Field name must be in lower case.
old_coachnum
stands for the coach to be edited and is required.
Only one parameter can be updated at a time
{
"token": string,
"old_coachnum": string,
"coach_num": string,
"rake_num": string,
"type": string
}
{
"data": {
"message": string
},
"status": 200
}
Replace {coach_num} with the coach number
{
"token": string,
}
{
"data": {
"message": string
},
"status": 200
}
Considering only 2 coaches
{
"token": string,
}
{
"data": [
{
"coach_num": string,
"type": string,
"rake_num": string
},
{
"coach_num": string,
"type": string,
"rake_num": string
},
],
"status": 200
}
Replace {coach_num} with the coach number
{
"token": string,
}
{
"data": {
"coach_num": string,
"type": string,
"rake_num": string
},
"status": 200
}
Replace {coach_num} with the coach number
{
"token": string,
}
{
"data": {
"shell_rec": date/null,
"intake": date/null,
"agency": string/null,
"conduit": date/null,
"coupler": date/null,
"ew_panel": date/null,
"roof_tray": date/null,
"ht_tray": date/null,
"ht_equip": date/null,
"high_dip": date/null,
"uf_tray": date/null,
"uf_trans": date/null,
"uf_wire": string/null,
"off_roof": date/null,
"roof_clear": date/null,
"off_ew": date/null,
"ew_clear": date/null,
"mech_pan": string/null,
"off_tf": date/null,
"tf_clear": date/null,
"tf_prov": date/null,
"lf_load": date/null,
"off_pow": date/null,
"power_hv": date/null,
"off_dip": date/null,
"dip_clear": date/null,
"lower": date/null,
"off_cont": date/null,
"cont_hv": date/null,
"load_test": date/null,
"rmvu": date/null,
"panto": date/null,
"pcp_clear": date/null,
"bu_form": date/null,
"rake_form": date/null,
"remarks": string/null,
"coach_num": string,
"rake_num": string
},
"status": 200
}
Replace {coach_num} with the coach number
{
"token": string,
}
{
"data": {
"linename": string,
"stage": string/null,
"lineno": integer/null,
"coach_num": string,
"rake_num": string
},
"status": 200
}
All date formats must be yyyy-mm-dd
This route is used only for adding a new statuses
coach_num
is required. Out of the other 29 parameters, at least one parameter must be sent in the request.
{
"token": string,
"coach_num": string,
"shell_rec": date/null,
"intake": date/null,
"agency": string/null,
"conduit": date/null,
"coupler": date/null,
"ew_panel": date/null,
"roof_tray": date/null,
"ht_tray": date/null,
"ht_equip": date/null,
"high_dip": date/null,
"uf_tray": date/null,
"uf_trans": date/null,
"uf_wire": string/null,
"off_roof": date/null,
"roof_clear": date/null,
"off_ew": date/null,
"ew_clear": date/null,
"mech_pan": string/null,
"off_tf": date/null,
"tf_clear": date/null,
"tf_prov": date/null,
"lf_load": date/null,
"off_pow": date/null,
"power_hv": date/null,
"off_dip": date/null,
"dip_clear": date/null,
"lower": date/null,
"off_cont": date/null,
"cont_hv": date/null,
"load_test": date/null,
"rmvu": date/null,
"panto": date/null,
"pcp_clear": date/null,
"bu_form": date/null,
"rake_form": date/null,
"remarks": string/null,
}
{
"data": {
"message": string
},
"status": 200
}
All date formats must be yyyy-mm-dd
Replace {field_name} with the field name you want to update. Field name must be in lower case.
This route is used for editing an existing status
coach_num
is required. Only one parameter can be updated at a time.
{
"token": string,
"coach_num": string,
"shell_rec": date/null,
"intake": date/null,
"agency": string/null,
"conduit": date/null,
"coupler": date/null,
"ew_panel": date/null,
"roof_tray": date/null,
"ht_tray": date/null,
"ht_equip": date/null,
"high_dip": date/null,
"uf_tray": date/null,
"uf_trans": date/null,
"uf_wire": string/null,
"off_roof": date/null,
"roof_clear": date/null,
"off_ew": date/null,
"ew_clear": date/null,
"mech_pan": string/null,
"off_tf": date/null,
"tf_clear": date/null,
"tf_prov": date/null,
"lf_load": date/null,
"off_pow": date/null,
"power_hv": date/null,
"off_dip": date/null,
"dip_clear": date/null,
"lower": date/null,
"off_cont": date/null,
"cont_hv": date/null,
"load_test": date/null,
"rmvu": date/null,
"panto": date/null,
"pcp_clear": date/null,
"bu_form": date/null,
"rake_form": date/null,
"remarks": string/null,
}
{
"data": {
"message": string
},
"status": 200
}
Considering only two statuses
{
"token": string,
}
{
"data": [
{
"shell_rec": date/null,
"intake": date/null,
"agency": string/null,
"conduit": date/null,
"coupler": date/null,
"ew_panel": date/null,
"roof_tray": date/null,
"ht_tray": date/null,
"ht_equip": date/null,
"high_dip": date/null,
"uf_tray": date/null,
"uf_trans": date/null,
"uf_wire": string/null,
"off_roof": date/null,
"roof_clear": date/null,
"off_ew": date/null,
"ew_clear": date/null,
"mech_pan": string/null,
"off_tf": date/null,
"tf_clear": date/null,
"tf_prov": date/null,
"lf_load": date/null,
"off_pow": date/null,
"power_hv": date/null,
"off_dip": date/null,
"dip_clear": date/null,
"lower": date/null,
"off_cont": date/null,
"cont_hv": date/null,
"load_test": date/null,
"rmvu": date/null,
"panto": date/null,
"pcp_clear": date/null,
"bu_form": date/null,
"rake_form": date/null,
"remarks": string/null,
"coach_num": string,
"rake_num": string
},
{
"shell_rec": date/null,
"intake": date/null,
"agency": string/null,
"conduit": date/null,
"coupler": date/null,
"ew_panel": date/null,
"roof_tray": date/null,
"ht_tray": date/null,
"ht_equip": date/null,
"high_dip": date/null,
"uf_tray": date/null,
"uf_trans": date/null,
"uf_wire": string/null,
"off_roof": date/null,
"roof_clear": date/null,
"off_ew": date/null,
"ew_clear": date/null,
"mech_pan": string/null,
"off_tf": date/null,
"tf_clear": date/null,
"tf_prov": date/null,
"lf_load": date/null,
"off_pow": date/null,
"power_hv": date/null,
"off_dip": date/null,
"dip_clear": date/null,
"lower": date/null,
"off_cont": date/null,
"cont_hv": date/null,
"load_test": date/null,
"rmvu": date/null,
"panto": date/null,
"pcp_clear": date/null,
"bu_form": date/null,
"rake_form": date/null,
"remarks": string/null,
"coach_num": string,
"rake_num": string
},
],
"status": 200
}
This route is used both for adding a new status and editing an existing status
coach_num
is required. Out of the other 3 parameters, at least one parameter must be sent in the request.
{
"token": string,
"coach_num": string,
"linename": string,
"lineno": integer,
"stage": integer
}
{
"data": {
"message": string
},
"status": 200
}
Considering only two positions
{
"token": string,
}
{
"data": [
{
"linename": string,
"stage": integer/null,
"lineno": integer/null,
"coach_num": string,
"rake_num": string
},
{
"linename": string,
"stage": integer/null,
"lineno": integer/null,
"coach_num": string,
"rake_num": string
},
],
"status": 200
}
Considering only two positions
linename
is required
lineno
andstage
are optional
{
"token": string,
"linename": string,
"lineno": integer,
"stage": integer
}
{
"data": [
{
"linename": string,
"stage": integer/null,
"lineno": integer/null,
"coach_num": string,
"rake_num": string
},
{
"linename": string,
"stage": integer/null,
"lineno": integer/null,
"coach_num": string,
"rake_num": string
},
],
"status": 200
}