Test Results (Madison Lopez)
=====================================
Introduction
In this article, we will be discussing the test results of the API endpoints for the student management system. The API endpoints include creating a student, logging in, getting a student, marking a course completed, planning a course, getting courses, getting a course by ID, getting a course by code, getting courses by major, getting majors, getting a major by ID, getting major students, creating a course plan, and getting requirements.
Creating a Student
The first API endpoint we will be testing is the creation of a student. This endpoint is used to create a new student in the system.
Request
curl -X 'POST' \
'https://group-project-365-iq6d.onrender.com/students' \
-H 'accept: application/json' \
-H 'access_token: ec1586c96d616d3cc66297ae09ef12af' \
-H 'Content-Type: application/json' \
-d '{
"first_name": "Bingus",
"last_name": "Khan",
"email": "bk@globmail.com",
"major_id": 1,
"password": "string"
}'
Response
{
"first_name": "Bingus",
"last_name": "Khan",
"email": "bk@globmail.com",
"major_id": 1,
"id": 12
}
Logging In
The next API endpoint we will be testing is the login endpoint. This endpoint is used to log in a student to the system.
Request
curl -X 'POST' \
'https://group-project-365-iq6d.onrender.com/login/bk%40globmail.com?password=string' \
-H 'accept: application/json' \
-H 'access_token: ec1586c96d616d3cc66297ae09ef12af' \
-d ''
Response
{
"id": 12,
"first_name": "Bingus",
"last_name": "Khan",
"email": "bk@globmail.com",
"major_id": 1,
"completed_courses": [
{
"id": 1,
"department_code": "CSC",
"course_number": 101,
"units": 4,
"title": "Fundamentals of Computer Science I",
"grade": "A+",
"quarter_taken": "Fall 2025"
}
]
}
Getting a Student
The next API endpoint we will be testing is the get student endpoint. This endpoint is used to get a student's information from the system.
Request
curl -X 'GET' \
'https://group-project-365-iq6d.onrender.com/students/12' \
-H 'accept: application/json' \
-H 'access_token: ec1586c96d616d3cc66297ae09ef12af'
Response
{
"id": 12,
"first_name": "Bingus",
"last_name": "Khan",
"email": "bk@globmail.com",
major_id": 1,
"completed_courses": [
{
"id": 1,
"department_code": "CSC",
"course_number": 101,
"units": 4,
"title": "Fundamentals of Computer Science I",
"grade": "A+",
"quarter_taken": "Fall 2025"
}
],
"planned_courses": []
}
Marking a Course Completed
The next API endpoint we will be testing is the mark course completed endpoint. This endpoint is used to mark a course as completed for a student.
Request
curl -X 'POST' \
'https://group-project-365-iq6d.onrender.com/mark_course_completed?student_id=12' \
-H 'accept: */*' \
-H 'access_token: ec1586c96d616d3cc66297ae09ef12af' \
-H 'Content-Type: application/json' \
-d '{
"course_id": 1,
"grade": "A+",
"quarter_taken": "Fall 2025"
}'
Response
204 | Successful Response
Planning a Course
The next API endpoint we will be testing is the plan course endpoint. This endpoint is used to plan a course for a student.
Request
curl -X 'POST' \
'https://group-project-365-iq6d.onrender.com/plan_course?student_id=12' \
-H 'accept: */*' \
-H 'access_token: ec1586c96d616d3cc66297ae09ef12af' \
-H 'Content-Type: application/json' \
-d '{
"course_id": 2,
"planned_quarter": "Winter 2026"
}'
Response
204 | Successful Response
Getting Courses
The next API endpoint we will be testing is the get courses endpoint. This endpoint is used to get a list of courses from the system.
Request
curl -X 'GET' \
'https://group-project-365-iq6d.onrender.com/courses/?skip=0&limit=3' \
-H 'accept: application/json' \
-H 'access_token: ec1586c96d616d3cc66297ae09ef12af'
Response
[
{
"id": 1,
"department_code": "CSC",
"course_number": 101,
"units": 4,
"title": "Fundamentals of Computer Science I",
"description": "Introduction to programming and problem solving using Python"
},
{
"id": 2,
"department_code": "CSC",
"course_number": 202,
"units": 4,
"title": "Data Structures",
"description": "Implementation and analysis of fundamental data structures"
},
{
"id": 3,
"department_code": "CSC",
"course_number": 203,
"units": 4,
"title": "Project-Based Object-Oriented Programming and Design",
"description": "Object-oriented programming and design principles"
}
]
a Course by ID
The next API endpoint we will be testing is the get course by ID endpoint. This endpoint is used to get a course by its ID from the system.
Request
curl -X 'GET' \
'https://group-project-365-iq6d.onrender.com/courses/9' \
-H 'accept: application/json' \
-H 'access_token: ec1586c96d616d3cc66297ae09ef12af'
Response
{
"id": 9,
"department_code": "CSC",
"course_number": 445,
"units": 4,
"title": "Software Engineering",
"description": "Software development lifecycle and methodologies"
}
Getting a Course by Code
The next API endpoint we will be testing is the get course by code endpoint. This endpoint is used to get a course by its code from the system.
Request
curl -X 'GET' \
'https://group-project-365-iq6d.onrender.com/courses/code/csc/101' \
-H 'accept: application/json' \
-H 'access_token: ec1586c96d616d3cc66297ae09ef12af'
Response
{
"detail": "Course not found"
}
Getting Courses by Major
The next API endpoint we will be testing is the get courses by major endpoint. This endpoint is used to get a list of courses by major from the system.
Request
curl -X 'GET' \
'https://group-project-365-iq6d.onrender.com/courses/major/2' \
-H 'accept: application/json' \
-H 'access_token: ec1586c96d616d3cc66297ae09ef12af'
Response
[]
Getting Majors
The next API endpoint we will be testing is the get majors endpoint. This endpoint is used to get a list of majors from the system.
Request
curl -X 'GET' \
'https://group-project-365-iq6d.onrender.com/majors/' \
-H 'accept: application/json' \
-H 'access_token: ec1586c96d616d3cc66297ae09ef12af'
Response
[
{
"id": 1,
"name": "Computer Science",
"description": "Bachelor of Science in Computer Science"
},
{
"id": 2,
"name": "Software Engineering",
"description": "Bachelor of Science in Software Engineering"
},
{
"id": <br/>
# Test Results (Madison Lopez) Q&A
=====================================
## Q: What is the purpose of the API endpoints?
A: The API endpoints are used to interact with the student management system, allowing users to create students, log in, get student information, mark courses completed, plan courses, get courses, get courses by ID, get courses by code, get courses by major, get majors, get major students, create course plans, and get requirements.
## Q: How do I create a student using the API?
A: To create a student, you can use the `POST` method on the `/students` endpoint, passing in the student's information in the request body.
## Q: What information do I need to provide to create a student?
A: You will need to provide the student's first name, last name, email, major ID, and password.
## Q: How do I log in a student using the API?
A: To log in a student, you can use the `POST` method on the `/login` endpoint, passing in the student's email and password.
## Q: What information do I get when I log in a student?
A: When you log in a student, you will get the student's ID, first name, last name, email, major ID, and completed courses.
## Q: How do I get a student's information using the API?
A: To get a student's information, you can use the `GET` method on the `/students/{id}` endpoint, replacing `{id}` with the student's ID.
## Q: What information do I get when I get a student's information?
A: When you get a student's information, you will get the student's ID, first name, last name, email, major ID, completed courses, and planned courses.
## Q: How do I mark a course completed using the API?
A: To mark a course completed, you can use the `POST` method on the `/mark_course_completed` endpoint, passing in the course ID, grade, and quarter taken.
## Q: What information do I need to provide to mark a course completed?
A: You will need to provide the course ID, grade, and quarter taken.
## Q: How do I plan a course using the API?
A: To plan a course, you can use the `POST` method on the `/plan_course` endpoint, passing in the course ID and planned quarter.
## Q: What information do I need to provide to plan a course?
A: You will need to provide the course ID and planned quarter.
## Q: How do I get a list of courses using the API?
A: To get a list of courses, you can use the `GET` method on the `/courses` endpoint.
## Q: What information do I get when I get a list of courses?
A: When you get a list of courses, you will get a list of courses, each with its ID, department code, course number, units, title, and description.
## Q: How do I get a course by ID using the API?
A: To get a course by ID, you can use the `GET` method on the `/courses/{id}` endpoint, replacing `{id}` with the course ID.
## Q: What information do I get when I get a course by ID?
A: When you get a course by ID, you will get the course's ID, code, course number, units, title, and description.
## Q: How do I get a course by code using the API?
A: To get a course by code, you can use the `GET` method on the `/courses/code/{department_code}/{course_number}` endpoint, replacing `{department_code}` with the department code and `{course_number}` with the course number.
## Q: What information do I get when I get a course by code?
A: When you get a course by code, you will get the course's ID, department code, course number, units, title, and description.
## Q: How do I get a list of courses by major using the API?
A: To get a list of courses by major, you can use the `GET` method on the `/courses/major/{major_id}` endpoint, replacing `{major_id}` with the major ID.
## Q: What information do I get when I get a list of courses by major?
A: When you get a list of courses by major, you will get a list of courses, each with its ID, department code, course number, units, title, and description.
## Q: How do I get a list of majors using the API?
A: To get a list of majors, you can use the `GET` method on the `/majors` endpoint.
## Q: What information do I get when I get a list of majors?
A: When you get a list of majors, you will get a list of majors, each with its ID, name, and description.
## Q: How do I get a major by ID using the API?
A: To get a major by ID, you can use the `GET` method on the `/majors/{id}` endpoint, replacing `{id}` with the major ID.
## Q: What information do I get when I get a major by ID?
A: When you get a major by ID, you will get the major's ID, name, and description.
## Q: How do I get a list of major students using the API?
A: To get a list of major students, you can use the `GET` method on the `/majors/{major_id}/students` endpoint, replacing `{major_id}` with the major ID.
## Q: What information do I get when I get a list of major students?
A: When you get a list of major students, you will get a list of students, each with its ID, first name, last name, and email.
## Q: How do I create a course plan using the API?
A: To create a course plan, you can use the `GET` method on the `/planner/create_course_plan` endpoint, passing in the student ID.
## Q: What information do I get when I create a course plan?
A: When you create a course plan, you will get a list of quarters, each with its quarter name and courses.
## Q: How do I get requirements using the API?
A: To get requirements, you can use the `GET` method on the `/planner/requirements` endpoint, passing in the student ID.
## Q: What information do I get when I get requirements?
A: When you get requirements, you will get a list of courses, each with its ID, department code, course number, units, title, and description.