EduCrudApi

CRUD JSON API over the existing Edu SQL Server tables. All responses are JSON; there is no XML formatter.

Authentication

Students sign in against tbl_student and receive a JSON Web Token. Send it on later requests as Authorization: Bearer <token>.

POST/api/auth/loginBody {"identifier":"…","password":"…"}, where identifier is the student's email or phone (email and phone also work as field names). Returns the token, its expiry and the student. 401 on any failure.
GET/api/auth/meThe signed-in student, re-read from the database. Requires a token.
POST/api/auth/change-passwordBody {"currentPassword":"…","newPassword":"…"}. Stores the new password BCrypt-hashed. Requires a token. 204 on success.

Every resource route below requires a token. Without one they answer 401. Only POST /api/auth/login and this page are anonymous. Any signed-in student may read and write every table — there is no per-role restriction yet.

Resources

Each resource below supports the same five operations, where {id} is the row's integer key.

ResourceCollectionFilters on GET (collection)
Courses/api/coursesbranchId, departId, q
Chapters/api/chapterscourseId, semId, subjectId, departmentId
Videos/api/videoscourseId, semId, subjectId, chapterId, vType
PDFs/api/pdfscourseId, semId, subjectId, chapterId
Students/api/studentsdepartment, course, flag, q
Student courses/api/studentcoursesstudId, courseId, subjectId, classId, status

Operations

GET/api/{resource}List rows. Paging: skip (default 0), take (default 100, max 500).
GET/api/{resource}/{id}One row, or 404.
POST/api/{resource}Insert. 201 with a Location header.
PUT/api/{resource}/{id}Update.
DELETE/api/{resource}/{id}Delete.

Extras