It is a technical quiz API, build purely using Python (programming language), Django and Django-Rest-Framework (opensource framework written in python).
Listing the features of the API
- Custom User Model (with email and username as unique mandatory fields)
- Profile Model (auto-created when user register using signals)
- One-To-One Relationship b/w Custom-User and Profile Model
- JWT (Json-Web-Token) Authentication
- Authenticated users can only update their own User Profile
API Endpoints defines the structure of the API and how end users access data from our application using the HTTP methods - GET, POST, PUT, DELETE.
Endpoint | HTTP Method | CURD Method | Result |
---|---|---|---|
user |
POST | CREATE | Create a new user |
search/<user_name> |
GET | READ | Get a user profile |
token |
POST | CREATE | Create access & refresh token |
token/refresh |
POST | CREATE | Get new access token |
profile/<user_name> |
GET, PUT, PATCH | READ & UPDATE | Get a user profile and update your profile |
-
User Registration (Creating a New User)
- POST
http://localhost:8000/api/v1/user/
- Body
{ "email": "testuser2@gmail.com", "user_name": "testuser2", "password": "testuser2" }
- Body
- POST
-
Search Profiles
- GET
http://localhost:8000/api/v1/search/testuser2
- Response
{ "id": 3, "user": { "user_name": "testuser2", "email": "testuser2@gmail.com" }, "about": "Hello, I am testuser2.", "location": "India", "birth_date": "2021-01-01", "gender": "Male" }
- Response
- GET
-
Access Token/Refresh Token
- POST
http://localhost:8000/api/v1/token/
- Body
{ "email": "testuser2@gmail.com", "password": "testuser2" }
- Body
- POST
-
Refresh Token
- POST
http://localhost:8000/api/v1/token/refresh/
- Body
{ "email": "testuser2@gmail.com", "password": "testuser2", "refresh": <your-refresh-token> }
- Body
- POST
-
User Profile (Required Access Token for Authentication)
- GET
http://localhost:8000/api/v1/profile/testuser1
- Response
{ "id": 5, "about": "Hello, I am modified testuser1.", "location": "India", "birth_date": "2020-01-11", "gender": "Male" }
- Response
- PUT
http://localhost:8000/api/v1/profile/testuser1/
- Body
{ "about": "Hello, I am testuser1.", "location": "Australia", "birth_date": "2020-01-11", "gender": "Male" }
- Body
- PATCH
http://localhost:8000/api/v1/profile/testuser1/
- Body
{ "location": "India", "birth_date": "2020-01-21" }
- Body
- GET
Listing the upcoming features of the API
- Create Tech Quiz Model
- Tech Quiz Model API Endpoints
- User can delete own account
- User can create Tech Quiz
- View TestCase