Base URL
https://innoversebd.bdix.cloud/bupPOST /api/v1/register
Content-Type: application/json
{
"username": "24230115084",
"password": "securepass123", //required
"email": "student@example.com", //required
"first_name": "John", //required
"last_name": "Doe", //required
"batch": "56th", //required
"program": "bba",
"bio": "Optional bio text",
"profile_pic": "https://example.com/pic.jpg",
"current_position": "Software Engineer",
"current_company": "Tech Corp",
"is_cr": false
}Response (201 Created):
{
"message": "Registration successful",
"user": {
"id": 1,
"username": "24230115084",
"email": "student@example.com",
"first_name": "John",
"last_name": "Doe"
},
"student_profile": {
"uni_id": "24230115084",
"batch": "56th",
"program": "bba",
"is_cr": false,
"is_verified": false,
"profile_pic": "https://example.com/pic.jpg"
}
}Error Response (400 Bad Request):
{
"message": "Registration failed",
"errors": {
"username": ["A user with this university ID already exists."],
"email": ["A user with this email already exists."]
}
}POST /api/v1/login
Content-Type: application/json
{
"username": "24230115084", // Can be uni_id, email, or phone
"password": "securepass123"
}Response (200 OK):
{
"refresh": "eyJ0eXAiOiJKV1QiLCJhbGc...",
"access": "eyJ0eXAiOiJKV1QiLCJhbGc...",
"user": {
"id": 1,
"username": "24230115084",
"email": "student@example.com",
"role": "Student", // or "CR" if is_cr is true
"student_profile": {
"first_name": "John",
"last_name": "Doe",
"uni_id": "24230115084",
"batch": "56th",
"program": "bba",
"is_verified": false,
"is_cr": false
}
}
}POST /auth/token/refresh
Content-Type: application/json
{
"refresh": "eyJ0eXAiOiJKV1QiLCJhbGc..."
}Response (200 OK):
{
"access": "eyJ0eXAiOiJKV1QiLCJhbGc..."
}GET /api/v1/logout
Authorization: Bearer <access_token>Response: Redirects to login page and blacklists the access token.
GET /api/v1/profile/Query Parameters:
batch- Filter by batch title (exact match, case-insensitive)program- Filter by program name (exact match, case-insensitive)is_cr- Filter by CR status (true/false)company- Fuzzy search by company nameposition- Fuzzy search by job position
Examples:
GET /api/v1/profile/
GET /api/v1/profile/?batch=56th
GET /api/v1/profile/?program=bba&is_cr=true
GET /api/v1/profile/?company=google
GET /api/v1/profile/?batch=56th&program=bba&is_cr=falseResponse (200 OK):
{
"count": 2,
"filters": {
"batch": "56th",
"program": "bba",
"is_cr": null,
"company": null,
"position": null
},
"results": [
{
"id": 1,
"first_name": "John",
"last_name": "Doe",
"uni_id": "24230115084",
"bio": "Bio text",
"profile_pic": "https://example.com/pic.jpg",
"batch": "56th",
"program": "bba",
"current_job_position": "Software Engineer",
"current_company": "Tech Corp",
"email": "student@example.com",
"phone": "01712345678",
"linkedin": "https://linkedin.com/in/johndoe",
"facebook": "https://facebook.com/johndoe",
"instagram": "https://instagram.com/johndoe",
"is_cr": false,
"is_verified": false
}
]
}GET /api/v1/profile/{id}/Response (200 OK):
{
"id": 1,
"first_name": "John",
"last_name": "Doe",
"uni_id": "24230115084",
"bio": "Bio text",
"profile_pic": "https://example.com/pic.jpg",
"batch": "56th",
"program": "bba",
"current_job_position": "Software Engineer",
"current_company": "Tech Corp",
"email": "student@example.com",
"phone": "01712345678",
"linkedin": "https://linkedin.com/in/johndoe",
"facebook": "https://facebook.com/johndoe",
"instagram": "https://instagram.com/johndoe",
"is_cr": false,
"is_verified": false
}Error Response (404 Not Found):
{
"message": "Profile not found"
}PUT /api/v1/profile/{id}/
Authorization: Bearer <access_token>
Content-Type: application/json
{
"first_name": "John",
"last_name": "Doe",
"bio": "Updated bio",
"profile_pic": "https://example.com/new-pic.jpg",
"current_job_position": "Senior Software Engineer",
"current_company": "New Company",
"phone": "01712345678",
"linkedin": "https://linkedin.com/in/johndoe",
"facebook": "https://facebook.com/johndoe",
"instagram": "https://instagram.com/johndoe"
}Note: uni_id and is_verified are read-only fields and cannot be updated.
Response (200 OK):
{
"id": 1,
"first_name": "John",
"last_name": "Doe",
"uni_id": "najib2@gmail.com",
"bio": "Updated bio",
"profile_pic": "https://example.com/new-pic.jpg",
"batch": "GEN15",
"program": "bba",
"current_job_position": "Senior Software Engineer",
"current_company": "New Company",
"email": "najib2@gmail.com",
"phone": "01712345678",
"linkedin": "https://linkedin.com/in/johndoe",
"facebook": "https://facebook.com/johndoe",
"instagram": "https://instagram.com/johndoe",
"is_cr": false,
"is_verified": false
}PATCH /api/v1/profile/{id}/
Authorization: Bearer <access_token>
Content-Type: application/json
{
"bio": "Updated bio only",
"current_company": "New Company"
}Response (200 OK):
{
"id": 1,
"first_name": "John",
"last_name": "Doe",
"uni_id": "najib2@gmail.com",
"bio": "Updated bio",
"profile_pic": "https://example.com/new-pic.jpg",
"batch": "GEN15",
"program": "bba",
"current_job_position": "Senior Software Engineer",
"current_company": "New Company",
"email": "najib2@gmail.com",
"phone": "01712345678",
"linkedin": "https://linkedin.com/in/johndoe",
"facebook": "https://facebook.com/johndoe",
"instagram": "https://instagram.com/johndoe2",
"is_cr": false,
"is_verified": false
}Error Response (400 Bad Request):
{
"field_name": ["Error message"]
}GET /api/v1/search?q=keywordQuery Parameters:
q(required) - Search keyword (minimum 2 characters)
Search Fields (with relevance scoring):
- University ID (exact match - highest priority: 100)
- First/Last name (exact: 90, starts with: 80, contains: 50)
- Email (exact: 70, contains: 25)
- Phone (exact: 65, contains: 25)
- Batch title/session (40)
- Program name (35)
- Company name (30)
- Job position (30)
- Bio (lowest priority: 10)
Results are ordered by relevance score, then by first and last name. Limited to 50 results.
Examples:
GET /api/v1/search?q=john
GET /api/v1/search?q=24230115084
GET /api/v1/search?q=software
GET /api/v1/search?q=56thResponse (200 OK):
{
"query": "john",
"count": 2,
"results": [
{
"id": 1,
"first_name": "John",
"last_name": "Doe",
"uni_id": "24230115084",
"batch": "56th",
"program": "bba",
"bio": "Bio text",
"profile_pic": "https://example.com/pic.jpg",
"current_job_position": "Software Engineer",
"current_company": "Tech Corp",
"email": "student@example.com",
"phone": "01712345678",
"linkedin": "https://linkedin.com/in/johndoe",
"facebook": "https://facebook.com/johndoe",
"instagram": "https://instagram.com/johndoe",
"is_cr": false,
"is_verified": false
}
]
}Response for short query (200 OK):
{
"message": "Search query must be at least 2 characters",
"results": []
}Response for empty query (200 OK):
{
"message": "Please provide a search query",
"results": []
}GET /api/v1/admin/verify/
Authorization: Bearer <access_token>Response (200 OK):
[
{
"id": 2,
"first_name": "Raiyana",
"last_name": "Noor",
"uni_id": "24230115136",
"bio": "Abeder Crush.",
"profile_pic": "http://example.com/profile.jpg",
"batch": "GEN15",
"program": "bba",
"current_job_position": "Student",
"current_company": "BOOP",
"email": "raiyana@gmail.com",
"phone": null,
"linkedin": null,
"facebook": null,
"instagram": null,
"is_cr": false,
"is_verified": false
}
]POST /api/v1/admin/verify/{id}/verify/
Authorization: Bearer <access_token>Response (200 OK):
{
"message": "Profile verified successfully",
"profile": {
"id": 3,
"first_name": "Raiyana",
"last_name": "Noor",
"uni_id": "raiyana2@gmail.com",
"bio": null,
"profile_pic": null,
"batch": "GEN15",
"program": "bba",
"current_job_position": null,
"current_company": null,
"email": "raiyana2@gmail.com",
"phone": null,
"linkedin": null,
"facebook": null,
"instagram": null,
"is_cr": false,
"is_verified": true
}
}Error Response (404 Not Found):
{
"message": "Profile not found"
}id- Primary key (auto-generated)first_name- Student's first name (max 30 chars)last_name- Student's last name (max 30 chars)uni_id- University ID (max 20 chars, unique)bio- Student biography (optional, text)profile_pic- Profile picture URL (optional)batch- Foreign key to Batchprogram- Foreign key to Programcurrent_job_position- Current job title (optional, max 200 chars)current_company- Current company name (optional, max 200 chars)email- Email address (unique, required)phone- Phone number (optional, max 15 chars)linkedin- LinkedIn profile URL (optional)facebook- Facebook profile URL (optional)instagram- Instagram profile URL (optional)is_cr- Class Representative status (boolean, default: false)is_verified- Verification status (boolean, default: false)
Read-only fields: uni_id, is_verified
title- Batch title (e.g., "56th")session- Session year (e.g., "2021-2022")
name- Program name (e.g., "bba", "mba")
title- Role title
The API uses JWT (JSON Web Tokens) for authentication. Include the access token in the Authorization header:
Authorization: Bearer <access_token>
Token Lifetimes:
- Access Token: 24 hours
- Refresh Token: 100 days
Token Rotation:
ROTATE_REFRESH_TOKENS: FalseBLACKLIST_AFTER_ROTATION: True
Multi-Field Login: Users can log in using any of:
- University ID (username)
- Email address
- Phone number
The custom authentication backend (MultiFieldAuthBackend) automatically determines which field is being used.
POST /api/v1/register- Student registrationPOST /api/v1/login- User loginPOST /auth/token/refresh- Token refreshGET /api/v1/profile/- List all profilesGET /api/v1/profile/{id}/- Get single profileGET /api/v1/search- Search students
PUT /api/v1/profile/{id}/- Update profile (full)PATCH /api/v1/profile/{id}/- Update profile (partial)GET /api/v1/logout- LogoutGET /api/v1/admin/verify/- List unverified profilesPOST /api/v1/admin/verify/{id}/verify/- Verify profile
400 Bad Request:
{
"message": "Registration failed",
"errors": {
"username": ["A user with this university ID already exists."],
"email": ["This field is required."]
}
}401 Unauthorized:
{
"detail": "Authentication credentials were not provided."
}404 Not Found:
{
"message": "Profile not found"
}500 Internal Server Error:
{
"detail": "Internal server error"
}- Multi-field search with relevance scoring
- Searches across: name, uni_id, email, phone, batch, program, company, position, bio
- Results ordered by relevance
- Minimum query length: 2 characters
- Maximum results: 50
- Filter by batch, program, CR status
- Fuzzy search by company and position
- Combine multiple filters
- Results ordered by CR status first, then alphabetically
- Student: Regular student user
- CR (Class Representative): Student with CR privileges
- Role automatically determined based on
is_crfield
- New students are unverified by default (
is_verified: false) - Admin can verify students through verification endpoint
- List all unverified profiles for review
- CORS Enabled: Yes
- Allowed Origins: All (
CORS_ALLOW_ALL_ORIGINS = True) - Note: Should be restricted in production
Current: SQLite3
Location: backend/db.sqlite3
- Username vs uni_id: The
usernamein the User model stores theuni_idvalue - Email/Phone Login: The custom authentication backend handles lookups in both User and StudentProfile models
- Profile Updates:
uni_idandis_verifiedcannot be updated through the API - Search Optimization: Uses
select_related()to reduce database queries - Token Blacklisting: Logout functionality blacklists tokens for security
Last edited: 07/11/2025