Spring Data Project

Postman API

This project demonstrates using an API through Postman to interact with database records and perform basic CRUD operations on the record in that database. In this example application, the idea is that the user is interacting with a database of JSON-formatted records of students and can search by each student's ID number, courses they are enrolled in, or by the section number of their classes.

By passing a JSON-formatted record in the request body of this HTTP POST request, a new student record is shown to be successfully added to the database of student records.

If a general GET request is made to the api without specifying id, course, or section data then all available student records are returned.

In these three screenshots you can see that if the GET request does specify an ID, course, or section number then only records with matching columns are returned.

Student records can also be updated, provided the user knows the student's ID number. By making a PUT request with the updated record data in the request body the api will search by ID to find the target record and then replace the old record data with the new data from the PUT request. This process requires the student's ID to ensure the correct record is replaced because it's the only search criteria in the api guaranteed to be unique and return only one record if it exists.

Just like the update method, records can be deleted from the database with a DELETE request made along with the student's ID number to ensure unique records are found to prevent accidentally deleting other records from the database. It's important to note that other ID numbers will not be shifted to fill the gap in ID numbers caused by deleting a record in order to preserve the integrity of the remaining ID numbers. If a DELETE request is made without a student ID parameter however, then all student records will be deleted instead, as shown in the second screenshot.