-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi_docs.yaml
More file actions
695 lines (653 loc) · 20.3 KB
/
Copy pathapi_docs.yaml
File metadata and controls
695 lines (653 loc) · 20.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
openapi: 3.0.0
info:
title: LaunchPad Placement Portal API
version: 1.0.0
description: |
REST API for the LaunchPad campus placement portal.
**Authentication:** Most endpoints require an `Authentication-Token` header.
Log in via `/auth/login` to get your token, then click "Authorize" above and paste it.
servers:
- url: http://localhost:5001/api
paths:
# Auth
/auth/login:
post:
summary: Login user
description: Returns an auth token on successful login.
tags: [Auth]
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/LoginRequest"
example:
email: admin@test.com
password: admin123
responses:
"200":
description: Login successful — returns token
content:
application/json:
schema:
type: object
properties:
token: { type: string }
user: { type: object }
profile: { type: object }
"401": { description: Invalid credentials }
/auth/register:
post:
summary: Register new user
description: Create a student or company account.
tags: [Auth]
requestBody:
required: true
content:
application/json:
schema:
oneOf:
- $ref: "#/components/schemas/RegisterStudent"
- $ref: "#/components/schemas/RegisterCompany"
examples:
student:
summary: Student registration
value:
email: newstudent@student.edu
password: password123
role: student
name: John Doe
phone: "+91 9999999999"
branch: Computer Science
cgpa: 8.5
company:
summary: Company registration
value:
email: hr@acme.com
password: password123
role: company
company_name: Acme Corp
industry: Technology
location: Mumbai
responses:
"201": { description: Registration successful }
"400": { description: Validation error }
"409": { description: Email already taken }
/auth/logout:
post:
summary: Logout current user
tags: [Auth]
security:
- TokenAuth: []
responses:
"200": { description: Logged out }
"401": { description: Unauthorized }
/auth/me:
get:
summary: Get current logged-in user details
tags: [Auth]
security:
- TokenAuth: []
responses:
"200":
description: Current user info and profile
content:
application/json:
schema:
type: object
properties:
user: { type: object }
profile: { type: object }
"401": { description: Unauthorized }
/auth/public/analytics:
get:
summary: Public analytics summary
description: No authentication required. Returns aggregate placement stats for the landing page.
tags: [Auth]
responses:
"200":
description: Public stats
content:
application/json:
schema:
type: object
properties:
students: { type: integer }
companies: { type: integer }
drives: { type: integer }
placements: { type: integer }
# Admin
/admin/companies:
get:
summary: List companies
tags: [Admin]
security:
- TokenAuth: []
parameters:
- name: status
in: query
schema: { type: string, enum: [approved, pending, blacklisted] }
description: Filter companies by status
- name: search
in: query
schema: { type: string }
description: Search by name or industry
responses:
"200": { description: Companies list }
"403": { description: Forbidden — admin role required }
/admin/companies/{company_id}/approve:
put:
summary: Approve company
tags: [Admin]
security:
- TokenAuth: []
parameters:
- { name: company_id, in: path, required: true, schema: { type: integer } }
responses:
"200": { description: Company approved }
/admin/companies/{company_id}/reject:
put:
summary: Reject company
tags: [Admin]
security:
- TokenAuth: []
parameters:
- { name: company_id, in: path, required: true, schema: { type: integer } }
responses:
"200": { description: Company rejected }
/admin/companies/{company_id}/blacklist:
put:
summary: Toggle company blacklist
tags: [Admin]
security:
- TokenAuth: []
parameters:
- { name: company_id, in: path, required: true, schema: { type: integer } }
responses:
"200": { description: Blacklist status toggled }
/admin/companies/{company_id}/deactivate:
put:
summary: Toggle company active status
tags: [Admin]
security:
- TokenAuth: []
parameters:
- { name: company_id, in: path, required: true, schema: { type: integer } }
responses:
"200": { description: Active status toggled }
/admin/drives:
get:
summary: List placement drives
tags: [Admin]
security:
- TokenAuth: []
parameters:
- name: status
in: query
schema: { type: string, enum: [pending, approved, closed] }
description: Filter drives by status
responses:
"200": { description: Drives list }
/admin/drives/{drive_id}/approve:
put:
summary: Approve drive
tags: [Admin]
security:
- TokenAuth: []
parameters:
- { name: drive_id, in: path, required: true, schema: { type: integer } }
responses:
"200": { description: Drive approved }
/admin/drives/{drive_id}/reject:
put:
summary: Reject drive
tags: [Admin]
security:
- TokenAuth: []
parameters:
- { name: drive_id, in: path, required: true, schema: { type: integer } }
responses:
"200": { description: Drive rejected }
/admin/students:
get:
summary: List students
tags: [Admin]
security:
- TokenAuth: []
parameters:
- name: search
in: query
schema: { type: string }
description: Search by name, phone, or branch
responses:
"200": { description: Students list }
/admin/students/{student_id}/blacklist:
put:
summary: Toggle student blacklist
tags: [Admin]
security:
- TokenAuth: []
parameters:
- { name: student_id, in: path, required: true, schema: { type: integer } }
responses:
"200": { description: Blacklist status toggled }
/admin/students/{student_id}/deactivate:
put:
summary: Toggle student active status
tags: [Admin]
security:
- TokenAuth: []
parameters:
- { name: student_id, in: path, required: true, schema: { type: integer } }
responses:
"200": { description: Active status toggled }
/admin/analytics:
get:
summary: Admin dashboard analytics
description: Cached for 120 seconds.
tags: [Admin]
security:
- TokenAuth: []
responses:
"200":
description: Analytics data with summary, status breakdown, top companies, branch stats
# Company
/company/profile:
get:
summary: Get company profile
tags: [Company]
security:
- TokenAuth: []
responses:
"200": { description: Company profile data }
put:
summary: Update company profile
tags: [Company]
security:
- TokenAuth: []
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/UpdateCompanyProfile"
example:
name: Google LLC
description: Updated company description
website: https://google.com
location: Mountain View, CA
industry: Technology
responses:
"200": { description: Profile updated }
/company/drives:
get:
summary: List company's drives
tags: [Company]
security:
- TokenAuth: []
responses:
"200": { description: List of drives }
post:
summary: Create a placement drive
description: Company must be approved. Drive is created in pending state awaiting admin approval.
tags: [Company]
security:
- TokenAuth: []
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/CreateDrive"
example:
title: Backend Engineer 2026
role_offered: Software Engineer
package_lpa: 15.0
location: Bangalore
eligibility_cgpa: 7.5
eligible_branches: ["Computer Science", "Electronics"]
deadline: "2026-12-31T23:59:59+05:30"
description: Looking for strong backend engineers with Python/Go experience.
responses:
"201": { description: Drive created (pending approval) }
"400": { description: Validation error }
"403": { description: Company not approved or blacklisted }
/company/drives/{drive_id}:
put:
summary: Update a drive
tags: [Company]
security:
- TokenAuth: []
parameters:
- { name: drive_id, in: path, required: true, schema: { type: integer } }
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/UpdateDrive"
example:
description: Updated drive description
status: closed
responses:
"200": { description: Drive updated }
"403": { description: Not your drive }
/company/drives/{drive_id}/applications:
get:
summary: List applications for a drive
tags: [Company]
security:
- TokenAuth: []
parameters:
- { name: drive_id, in: path, required: true, schema: { type: integer } }
responses:
"200": { description: Applications list }
"403": { description: Access denied }
/company/applications/{app_id}/status:
put:
summary: Update application status
description: |
Valid transitions:
- applied → shortlisted, rejected
- shortlisted → selected, rejected
When setting status to `selected`, `joining_date` is required.
When setting status to `rejected`, `feedback` is required.
tags: [Company]
security:
- TokenAuth: []
parameters:
- { name: app_id, in: path, required: true, schema: { type: integer } }
requestBody:
required: true
content:
application/json:
schema:
type: object
required: [status]
properties:
status:
type: string
enum: [shortlisted, rejected, selected]
joining_date:
type: string
format: date
description: Required when status is `selected` (YYYY-MM-DD)
feedback:
type: string
description: Required when status is `rejected`
example:
status: shortlisted
responses:
"200": { description: Status updated }
"400": { description: Invalid transition }
/company/applications/{app_id}/interview:
post:
summary: Schedule interview
description: Only for shortlisted applications. One interview per application.
tags: [Company]
security:
- TokenAuth: []
parameters:
- { name: app_id, in: path, required: true, schema: { type: integer } }
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/ScheduleInterview"
example:
scheduled_at: "2026-06-15T10:00:00+05:30"
location: Google Meet
interview_type: online
notes: Technical screening round
responses:
"201": { description: Interview scheduled }
"400": { description: Application not shortlisted }
"409": { description: Interview already scheduled }
/company/applications/export:
post:
summary: Export company applications and placements as CSV via email
description: Triggers a Celery task. CSV is sent to the company's email.
tags: [Company]
security:
- TokenAuth: []
responses:
"200": { description: Export task queued }
# Student
/student/profile:
get:
summary: Get student profile
tags: [Student]
security:
- TokenAuth: []
responses:
"200": { description: Student profile data }
put:
summary: Update student profile
tags: [Student]
security:
- TokenAuth: []
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/UpdateStudentProfile"
example:
name: Alok Kumar
branch: Computer Science
cgpa: 9.2
phone: "+91 9876543210"
skills: Python, Flask, Vue.js
experience: "2 internships at startups"
responses:
"200": { description: Profile updated }
/student/resume:
get:
summary: Download resume
tags: [Student]
security:
- TokenAuth: []
responses:
"200":
description: PDF file download
content:
application/pdf:
schema:
type: string
format: binary
"404": { description: No resume uploaded }
post:
summary: Upload resume (PDF only)
tags: [Student]
security:
- TokenAuth: []
requestBody:
required: true
content:
multipart/form-data:
schema:
type: object
required: [resume]
properties:
resume:
type: string
format: binary
description: PDF file
responses:
"200": { description: Resume uploaded }
"400": { description: No file or invalid format }
/student/drives:
get:
summary: Browse open placement drives
description: Returns approved, open drives the student is eligible for.
tags: [Student]
security:
- TokenAuth: []
parameters:
- name: search
in: query
schema: { type: string }
description: Search by title, role, or company name
- name: branch
in: query
schema: { type: string }
description: Filter by branch eligibility
- name: min_package
in: query
schema: { type: number }
description: Minimum package in LPA
responses:
"200": { description: Eligible drives list }
/student/apply/{drive_id}:
post:
summary: Apply to a placement drive
description: ATS score is computed automatically from resume and drive description.
tags: [Student]
security:
- TokenAuth: []
parameters:
- { name: drive_id, in: path, required: true, schema: { type: integer } }
requestBody:
content:
application/json:
schema:
type: object
properties:
cover_letter: { type: string }
example:
cover_letter: Excited about this opportunity!
responses:
"201": { description: Application submitted }
"400": { description: Ineligible or deadline passed }
"409": { description: Already applied }
/student/applications:
get:
summary: Track applications
tags: [Student]
security:
- TokenAuth: []
responses:
"200": { description: Student's applications list }
/student/applications/{app_id}/withdraw:
put:
summary: Withdraw application
description: Only applications with status "applied" can be withdrawn.
tags: [Student]
security:
- TokenAuth: []
parameters:
- { name: app_id, in: path, required: true, schema: { type: integer } }
responses:
"200": { description: Application withdrawn }
"400": { description: Cannot withdraw (wrong status) }
/student/applications/export:
post:
summary: Export applications as CSV via email
description: Triggers a Celery task. CSV is sent to the student's email.
tags: [Student]
security:
- TokenAuth: []
responses:
"200": { description: Export task queued }
/student/placements:
get:
summary: View secured placements
tags: [Student]
security:
- TokenAuth: []
responses:
"200": { description: Student's placements list }
components:
securitySchemes:
TokenAuth:
type: apiKey
in: header
name: Authentication-Token
description: Paste the token returned by POST /auth/login
schemas:
LoginRequest:
type: object
required: [email, password]
properties:
email: { type: string, format: email }
password: { type: string, minLength: 8 }
RegisterStudent:
type: object
required: [email, password, role, name, phone, branch]
properties:
email: { type: string, format: email }
password: { type: string, minLength: 8 }
role: { type: string, enum: [student] }
name: { type: string }
phone: { type: string }
branch: { type: string }
cgpa: { type: number }
skills: { type: string }
experience: { type: string }
RegisterCompany:
type: object
required: [email, password, role, company_name]
properties:
email: { type: string, format: email }
password: { type: string, minLength: 8 }
role: { type: string, enum: [company] }
company_name: { type: string }
description: { type: string }
website: { type: string }
location: { type: string }
industry: { type: string }
hr_contact: { type: string }
UpdateCompanyProfile:
type: object
properties:
name: { type: string }
description: { type: string }
website: { type: string }
location: { type: string }
industry: { type: string }
UpdateStudentProfile:
type: object
properties:
name: { type: string }
branch: { type: string }
cgpa: { type: number }
phone: { type: string }
skills: { type: string }
experience: { type: string }
CreateDrive:
type: object
required: [title, deadline]
properties:
title: { type: string }
description: { type: string }
role_offered: { type: string }
package_lpa: { type: number }
location: { type: string }
eligibility_cgpa: { type: number, default: 0 }
eligible_branches:
type: array
items: { type: string }
deadline: { type: string, format: date-time, description: "ISO 8601 with timezone" }
UpdateDrive:
type: object
properties:
title: { type: string }
description: { type: string }
role_offered: { type: string }
package_lpa: { type: number }
location: { type: string }
eligibility_cgpa: { type: number }
eligible_branches:
type: array
items: { type: string }
deadline: { type: string, format: date-time }
status: { type: string, enum: [open, closed, cancelled] }
ScheduleInterview:
type: object
required: [scheduled_at]
properties:
scheduled_at: { type: string, format: date-time, description: "ISO 8601 with timezone" }
location: { type: string }
interview_type: { type: string, enum: [in-person, online], default: in-person }
notes: { type: string }