Users can create a new account by providing their information.
๐ Endpoint:POST https://www.ta2.today/api/signup/
๐ Request Example:
{
"username": "newuser123",
"email": "user@example.com",
"password": "password123",
"confirm_password": "password123"
}
๐ Response Example:
{
"message": "User registered successfully. Please login to continue."
}
User can log in using their credentials to receive access and refresh tokens.
๐ Endpoint:POST https://www.ta2.today/api/login/
๐ Request Example:
{
"username": "user123",
"password": "password123"
}
๐ Response Example:
{
"access": "ACCESS_TOKEN",
"refresh": "REFRESH_TOKEN"
}
Submit user details such as class, syllabus, and medium. This API requires authentication using an access token.
๐ Endpoint:POST https://www.ta2.today/submit-details/
๐ก๏ธ Authorization: Add the access token in the headers using the format:
Authorization: Bearer ACCESS_TOKEN
๐ Request Example:
{
"class_name": "10",
"syllabus": "CBSE",
"medium": "English"
}
๐ Response Example:
{
"message": "Details submitted successfully."
}
Fetch videos by chapter and topic number. Optionally, specify the medium (e.g., 'malayalam') as a query parameter.
Endpoint:GET https://www.ta2.today/videos/<chapter_number>/<topic_number>/
Example URL:
GET https://ta2.today/videos/1/1/?medium=malayalam
Response Example:
[
{
"id": 1,
"chapter": {
"id": 3,
"name": "เดธเดฎเดพเดจเตเดคเดฐเดถเตเดฐเตเดฃเดฟเดเตพ",
"chapter_number": 1,
"number_of_topics": 7
},
"topic": {
"id": 4,
"name": "เดธเดเดเตเดฏเดเตเดฐเดฎเดเตเดเตพ",
"topic_number": 1
},
"video_file": "https://sam1chapterstopics.s3.amazonaws.com/videos/chap1topic1.mp4"
}
]
Ask a question to the AI Tutor (General AI Response).
๐ Endpoint:POST https://www.ta2.today/get-response/
๐ Request Example:
{
"question": "What is 2 + 2?"
}
๐ Response Example:
{
"response": "2 + 2 is 4"
}
Get a GPT-4 AI-generated response.
๐ Endpoint:POST https://www.ta2.today/get-gpt-response/
๐ Request Example:
{
"question": "Explain Pythagoras theorem."
}
๐ Response Example:
{
"response": "The Pythagorean theorem states that in a right triangle, the square of the hypotenuse is equal to the sum of the squares of the other two sides."
}
Retrieve a list of all subjects.
๐ Endpoint:GET https://www.ta2.today/subjects/
๐ Response Example:
[
{
"id": 1,
"name": "Mathematics"
}
]
Fetch chapters of a specific subject.
๐ Endpoint:GET https://www.ta2.today/subjects/<subject_id>/chapters/
๐ Response Example:
[
{
"id": 1,
"name": "Arithmetic Sequence",
"subject_id": 1
"number_of_topics" :7
}
]
Retrieve an introduction to a specific chapter.
๐ Endpoint:GET https://www.ta2.today/chapters/<chapter_id>/intro/
๐ Response Example:
{
"intro": "Hi students, this chapter is Arithmetic Sequence and we have to cover 5 topics. The first topic is Number Pattern."
}
Fetch topics for a specific chapter.
๐ Endpoint:GET https://www.ta2.today/chapters/<chapter_id>/topics/
๐ Response Example:
[
{
"id": 1,
"name": "Number Pattern",
"topic_number": 1
},
{
"id": 2,
"name": "Algebra of Sequance",
"topic_number": 2
}
]
Mark a video as watched by the user. This API requires authentication using an access token.
๐ Endpoint:POST https://www.ta2.today/mark_video_watched/
๐ก๏ธ Authorization: Add the access token in the headers using the format:
Authorization: Bearer ACCESS_TOKEN
๐ Request Example:
{
"video_id": 123
}
๐ Response Example:
{
"message": "Video marked as watched successfully!"
}
๐ Error Responses:
{
"error": "Video ID is required!"
}
{
"error": "Video not found!"
}
Fetch the progress of a specific user by their user ID.
๐ Endpoint:GET https://www.ta2.today/user_progress/<user_id>/
๐ Response Example:
{
"username": "student123",
"subjects": [
{
"id": 1,
"name": "Mathematics",
"chapters": [
{
"id": 1,
"name": "Arithmetic Sequence",
"chapter_number": 1,
"topics": [
{
"id": 1,
"name": "Number Pattern",
"topic_number": 1,
"completed": true
},
{
"id": 2,
"name": "Series and Progressions",
"topic_number": 2,
"completed": false
}
]
}
]
}
]
}
๐ Error Response Example (User Not Found):
{
"error": "User not found"
}