{"info":{"_postman_id":"bfa50d53-27c9-4be9-8009-121d6ce8e398","name":"Flask App APIs Documentation","description":"<html><head></head><body><p>This document provides an overview and documentation of a Python script that creates a Flask web application connected to a MongoDB database. The application offers various API routes for managing student and student task data. Below is a detailed breakdown of the code, including explanations for each route.</p>\n<hr>\n<h2 id=\"requirements\">Requirements</h2>\n<ul>\n<li>Python 3</li>\n<li>Flask</li>\n<li>Flask-PyMongo</li>\n<li>MongoDB</li>\n</ul>\n<hr>\n<h2 id=\"setup\">Setup</h2>\n<ol>\n<li>Ensure that Python and the required dependencies are installed.</li>\n<li>Start a MongoDB server on <code>mongodb://localhost:27017</code> with a database named <code>school</code>.</li>\n</ol>\n<hr>\n<h2 id=\"brief-code-explanation\">Brief Code Explanation</h2>\n<h3 id=\"imports\">Imports</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-python\">from flask import Flask, jsonify, request\nfrom flask_pymongo import PyMongo\nfrom datetime import datetime\n\n</code></pre>\n<p>The script imports necessary libraries for creating a Flask application, interacting with a MongoDB database, and managing date values for the database.</p>\n<h3 id=\"flask-app-initialization\">Flask App Initialization</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-python\">app = Flask(__name__)\napp.config['MONGO_URI'] = 'mongodb://localhost:27017/school'\nmongo = PyMongo(app)\n\n</code></pre>\n<p>Here, a Flask app is created, and it is configured to use the specified MongoDB URI. A connection to the MongoDB database is established using Flask-PyMongo.</p>\n<h3 id=\"add_student-route----post-\"><strong><code>add_student</code></strong> Route - [ POST ]</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-python\">@app.route('/add_student', methods=['POST'])\ndef add_student():\n    # Extract data from the request\n    # ...\n    # Insert student data into the database\n    # ...\n    # Return a success response\n    # ...\n\n</code></pre>\n<p>This route allows the addition of a single student to the database. It extracts data from the JSON request and inserts it into the MongoDB <code>students</code> collection. The route returns a success response upon completion.</p>\n<h3 id=\"add_students-route----post-\"><code>add_students</code> Route - [ POST ]</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-python\">@app.route('/add_students', methods=['POST'])\ndef add_students():\n    # Extract data from the request\n    # ...\n    # Insert multiple students into the database\n    # ...\n    # Return a success response\n    # ...\n\n</code></pre>\n<p>This route is used for adding multiple students to the database in a single request. It expects a list of student objects in the request's JSON body and inserts them into the <code>students</code> collection.</p>\n<h3 id=\"get_single_student-route----get-\"><code>get_single_student</code> Route - [ GET ]</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-python\">@app.route(&amp;#x27;/get_student/&lt;student_id&gt;&amp;#x27;, methods=[&amp;#x27;GET&amp;#x27;])\ndef get_single_student(student_id):\n    # Find a single student by student_id\n    # ...\n    # Return the student as JSON\n    # ...\n\n</code></pre>\n<p>This route retrieves a single student's data by their <code>student_id</code> and returns it as a JSON response.</p>\n<h3 id=\"get_all_students-route----get-\"><code>get_all_students</code> Route - [ GET ]</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-python\">@app.route('/get_students', methods=['GET'])\ndef get_all_students():\n    # Find all students in the database\n    # ...\n    # Return a list of students as JSON\n    # ...\n\n</code></pre>\n<p>This route retrieves all student data from the database and returns it as a list of JSON objects.</p>\n<h3 id=\"update_student-route----put-\"><code>update_student</code> Route - [ PUT ]</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-python\">@app.route(&amp;#x27;/update_student/&lt;student_id&gt;&amp;#x27;, methods=[&amp;#x27;PUT&amp;#x27;])\ndef update_student(student_id):\n    # Extract data from the request\n    # ...\n    # Update the student's data in the database\n    # ...\n    # Return a success response\n    # ...\n\n</code></pre>\n<p>This route allows the update of a student's data by their <code>student_id</code>. It extracts the updated data from the request and updates the corresponding record in the database.</p>\n<h3 id=\"soft_delete_student-route---delete-\"><code>soft_delete_student</code> Route -[ DELETE ]</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-python\">@app.route(&amp;#x27;/soft_delete_student/&lt;student_id&gt;&amp;#x27;, methods=[&amp;#x27;DELETE&amp;#x27;])\ndef soft_delete_student(student_id):\n    # Soft delete a student by setting 'is_deleted' to True\n    # ...\n    # Return a success response\n    # ...\n\n</code></pre>\n<p>This route soft deletes a student by setting their <code>is_deleted</code> field to True, indicating that they are marked for deletion.</p>\n<h3 id=\"hard_delete_student-route---delete\"><code>hard_delete_student</code> Route - DELETE</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-python\">@app.route(&amp;#x27;/hard_delete_student/&lt;student_id&gt;&amp;#x27;, methods=[&amp;#x27;DELETE&amp;#x27;])\ndef hard_delete_student(student_id):\n    # Hard delete a student by removing the record from the database\n    # ...\n    # Return a success response\n    # ...\n\n</code></pre>\n<p>This route hard deletes a student by completely removing their record from the database.</p>\n<h3 id=\"student-tasks-routes\">Student Tasks Routes</h3>\n<p>The script also includes a set of API routes for managing student tasks. These routes have a similar structure to the student-related routes but are focused on tasks associated with students. They allow the addition, retrieval, update, and soft and hard deletion of student tasks.</p>\n<h3 id=\"error-handling\">Error Handling</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-python\">@app.errorhandler(404)\ndef not_found(error=None):\n    # Handle 404 errors by returning a custom JSON response\n    # ...\n\n</code></pre>\n<p>The script defines an error handler for 404 errors, returning a custom JSON response indicating that the requested resource was not found.</p>\n<h3 id=\"run-the-application\">Run the Application</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-python\">if __name__ == '__main__':\n    app.run(debug=True)\n\n</code></pre>\n<p>This section starts the Flask application with debugging enabled if the script is executed directly.</p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"30488427","collectionId":"bfa50d53-27c9-4be9-8009-121d6ce8e398","publishedId":"2s9YR9YsmV","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"publishDate":"2023-10-19T04:57:45.000Z"},"item":[{"name":"MongoDB Database","item":[],"id":"a693942e-9dd1-4217-b6a5-032efa8e935f","description":"<p>This document provides instructions for initializing a MongoDB database named \"<em><strong>school</strong></em>\" with two collections: \"<em>students</em>\" and \"<em>student_tasks</em>.\" It includes details about the format of each collection and provides sample documents for each.</p>\n<hr />\n<h1 id=\"database-initialization\">Database Initialization</h1>\n<h2 id=\"mongodb-connection\">MongoDB Connection</h2>\n<p>To initialize the \"school\" database, you can use the MongoDB command-line client or a MongoDB GUI tool like MongoDB Compass. Connect to your MongoDB server and execute the following commands:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-powershell\">use school\n\n</code></pre>\n<p>This command switches to the \"school\" database. If the database doesn't exist, it will be created.</p>\n<h2 id=\"collection-students\">Collection: \"students\"</h2>\n<h3 id=\"format\">Format</h3>\n<p>The \"students\" collection stores information about students. It has the following fields:</p>\n<ul>\n<li><code>student_id</code>: String (unique identifier for each student)</li>\n<li><code>first_name</code>: String (first name of the student)</li>\n<li><code>last_name</code>: String (last name of the student)</li>\n<li><code>age</code>: Integer (age of the student)</li>\n<li><code>gender</code>: String (gender of the student)</li>\n<li><code>image</code>: String (URL to the student's image)</li>\n<li><code>active</code>: Boolean (whether the student is active)</li>\n<li><code>is_deleted</code>: Boolean (whether the student is deleted)</li>\n<li><code>created</code>: Timestamp (date and time of creation)</li>\n<li><code>created_by</code>: String (creator's name)</li>\n<li><code>last_updated</code>: Timestamp (date and time of the last update)</li>\n<li><code>last_updated_by</code>: String (name of the user who last updated)</li>\n</ul>\n<h3 id=\"sample-data\">Sample Data</h3>\n<p>Here are three example documents to initialize the \"students\" collection:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"student_id\": \"1\",\n    \"first_name\": \"John\",\n    \"last_name\": \"Doe\",\n    \"age\": 20,\n    \"gender\": \"Male\",\n    \"image\": \"https://example.com/johndoe.jpg\",\n    \"active\": true,\n    \"is_deleted\": false,\n    \"created\": new Date(\"2020-05-01\"),\n    \"created_by\": \"Admin\",\n    \"last_updated\": new Date(),\n    \"last_updated_by\": \"Admin\"\n}\n\n</code></pre>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"student_id\": \"2\",\n    \"first_name\": \"Alice\",\n    \"last_name\": \"Smith\",\n    \"age\": 22,\n    \"gender\": \"Female\",\n    \"image\": \"https://example.com/alicesmith.jpg\",\n    \"active\": true,\n    \"is_deleted\": false,\n    \"created\": new Date(\"2020-05-02\"),\n    \"created_by\": \"Admin\",\n    \"last_updated\": new Date(),\n    \"last_updated_by\": \"Admin\"\n}\n\n</code></pre>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"student_id\": \"3\",\n    \"first_name\": \"Bob\",\n    \"last_name\": \"Johnson\",\n    \"age\": 19,\n    \"gender\": \"Male\",\n    \"image\": \"https://example.com/bobjohnson.jpg\",\n    \"active\": true,\n    \"is_deleted\": false,\n    \"created\": new Date(\"2020-05-03\"),\n    \"created_by\": \"Admin\",\n    \"last_updated\": new Date(),\n    \"last_updated_by\": \"Admin\"\n}\n\n</code></pre>\n<h2 id=\"collection-student_tasks\">Collection: \"student_tasks\"</h2>\n<h3 id=\"format-1\">Format</h3>\n<p>The \"student_tasks\" collection stores information about student tasks. It has the following fields:</p>\n<ul>\n<li><code>task_id</code>: String (unique identifier for each task)</li>\n<li><code>student_id</code>: String (identifier of the student who submitted the task)</li>\n<li><code>score</code>: Float (the score received for the task)</li>\n<li><code>is_deleted</code>: Boolean (whether the task is deleted)</li>\n<li><code>created</code>: Timestamp (date and time of creation)</li>\n<li><code>created_by</code>: String (creator's name)</li>\n<li><code>last_updated</code>: Timestamp (date and time of the last update)</li>\n<li><code>last_updated_by</code>: String (name of the user who last updated)</li>\n</ul>\n<h3 id=\"sample-data-1\">Sample Data</h3>\n<p>Here are three example documents to initialize the \"student_tasks\" collection:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"task_id\": \"task1\",\n    \"student_id\": \"1\",\n    \"score\": 95.5,\n    \"is_deleted\": false,\n    \"created\": new Date(\"2020-05-10\"),\n    \"created_by\": \"Admin\",\n    \"last_updated\": new Date(\"202-05-30\"),\n    \"last_updated_by\": \"Admin\"\n}\n\n</code></pre>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"task_id\": \"task2\",\n    \"student_id\": \"1\",\n    \"score\": 88.0,\n    \"is_deleted\": false,\n    \"created\": new Date(\"2020-05-30\"),\n    \"created_by\": \"Admin\",\n    \"last_updated\": new Date(\"2020-06-10\"),\n    \"last_updated_by\": \"Admin\"\n}\n\n</code></pre>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"task_id\": \"task3\",\n    \"student_id\": \"2\",\n    \"score\": 92.5,\n    \"is_deleted\": false,\n    \"created\": new Date(\"2020-06-25\"),\n    \"created_by\": \"Admin\",\n    \"last_updated\": new Date(\"2020-08-20\"),\n    \"last_updated_by\": \"Admin\"\n}\n\n</code></pre>\n<p>You can use these example documents as a starting point for your \"students\" and \"student_tasks\" collections in the \"school\" database. Customize and insert more data as needed for your application.</p>\n<h2 id=\"adding-the-sample-data\">Adding the sample data</h2>\n<p>after typing <code>use school</code> you should have the following display</p>\n<img src=\"https://content.pstmn.io/b848f5de-36ec-4845-ae71-ecaaa53ba98d/aW1hZ2UucG5n\" alt=\"terminal%20view\" width=\"175\" height=\"163\" />\n\n<p>Adding the data into the collections will follow the following format <code>db..insertOne()</code> to insert a single student record.</p>\n<h3 id=\"examples\">Examples:</h3>\n<p>For the \"<em><strong>students</strong></em>\" collection we can insert the first sample record as follows:</p>\n<p><img src=\"https://content.pstmn.io/452d722f-1bb1-48cb-8ccc-76e8d20ef0f3/aW1hZ2UucG5n\" alt=\"adding%20sample%20data%20through%20the%20terminal%20to%20students%20collection\n&lt;br&gt;\n&lt;br&gt;\n&lt;br&gt;\n&lt;br&gt;\n&lt;br&gt;\" width=\"470\" height=\"408\" /></p>\n<p>For the \"<em><strong>student_tasks</strong></em>\" collection we can insert the first sample record as follows:</p>\n<img src=\"https://content.pstmn.io/b33abdc3-f170-4db5-8f30-6a0f711b7b16/aW1hZ2UucG5n\" alt=\"adding%20sample%20data%20through%20the%20terminal%20to%20student_tasks%20collection\" width=\"462\" height=\"340\" />","_postman_id":"a693942e-9dd1-4217-b6a5-032efa8e935f"},{"name":"API Requests","item":[{"name":"students collection","item":[{"name":"add Single student","id":"b4ef68e0-73f1-4d50-acc8-9c24ae2b5ff7","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"student_id\": \"1002059080\",\r\n    \"first_name\": \"Osama\",\r\n    \"last_name\": \"hisham\",\r\n    \"age\": 21,\r\n    \"gender\": \"Male\",\r\n    \"image\": \"https://example.com/Osama.jpg\",\r\n    \"active\": true,\r\n    \"is_deleted\": false,\r\n    \"created\": \"2020-05-01\",\r\n    \"created_by\": \"Admin\",\r\n    \"last_updated\": \"2023-10-18\",\r\n    \"last_updated_by\": \"Admin\"\r\n}\r\n","options":{"raw":{"language":"json"}}},"url":"http://127.0.0.1:5000/add_student","description":"<p>This is a <code>POST</code> method with a route to add a single student to the \"<em><strong>students</strong></em>\" collection in the school database</p>\n","urlObject":{"protocol":"http","port":"5000","path":["add_student"],"host":["127","0","0","1"],"query":[],"variable":[]}},"response":[],"_postman_id":"b4ef68e0-73f1-4d50-acc8-9c24ae2b5ff7"},{"name":"add Multiple students","id":"d6b3e4b0-1fdf-4272-b41c-3316b1f7b887","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"[\r\n    {\r\n        \"student_id\": \"1002059090\",\r\n        \"first_name\": \"Ahmed\",\r\n        \"last_name\": \"Raffat\",\r\n        \"age\": 23,\r\n        \"gender\": \"Male\",\r\n        \"image\": \"https://example.com/Ahmed.jpg\",\r\n        \"active\": true,\r\n        \"is_deleted\": false,\r\n        \"created\": \"2020-01-01\",\r\n        \"created_by\": \"Admin\",\r\n        \"last_updated\": \"2023-10-18\",\r\n        \"last_updated_by\": \"Admin\"\r\n    },\r\n    {\r\n        \"student_id\": \"1002051002\",\r\n        \"first_name\": \"Yousef\",\r\n        \"last_name\": \"Ahmed\",\r\n        \"age\": 22,\r\n        \"gender\": \"Male\",\r\n        \"image\": \"https://example.com/Yousef.jpg\",\r\n        \"active\": true,\r\n        \"is_deleted\": false,\r\n        \"created\": \"2021-09-01\",\r\n        \"created_by\": \"Admin\",\r\n        \"last_updated\": \"2023-10-18\",\r\n        \"last_updated_by\": \"Admin\"\r\n    }\r\n]","options":{"raw":{"language":"json"}}},"url":"http://127.0.0.1:5000/add_students","description":"<p>This is a <code>POST</code> method with a route to add multiple students to the \"<em>students</em>\" collection in the school database</p>\n","urlObject":{"protocol":"http","port":"5000","path":["add_students"],"host":["127","0","0","1"],"query":[],"variable":[]}},"response":[],"_postman_id":"d6b3e4b0-1fdf-4272-b41c-3316b1f7b887"},{"name":"get Single student ","id":"2f629737-7edb-46e3-8700-b451040c9025","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"body":{"mode":"raw","raw":""},"url":"http://127.0.0.1:5000/get_student/1002059080","description":"<p>This is a <strong><code>GET</code></strong> method with a route to get a single student from the <em>\"students\"</em> collection 'based on their unique <strong>student_id</strong></p>\n","urlObject":{"protocol":"http","port":"5000","path":["get_student","1002059080"],"host":["127","0","0","1"],"query":[],"variable":[]}},"response":[],"_postman_id":"2f629737-7edb-46e3-8700-b451040c9025"},{"name":"get All students","id":"4b98a68d-661e-43da-a1df-881bafe11496","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://127.0.0.1:5000/get_students","description":"<p>This is a <code>GET</code> method with a route to get all the available student records from the \"<em><strong>students</strong></em>\" collection</p>\n","urlObject":{"protocol":"http","port":"5000","path":["get_students"],"host":["127","0","0","1"],"query":[],"variable":[]}},"response":[],"_postman_id":"4b98a68d-661e-43da-a1df-881bafe11496"},{"name":"Updating a Single student record ","id":"0e5b099a-46c1-4371-9d5f-2582ad0f1b7a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\r\n    \"student_id\": \"1002051222\",\r\n    \"first_name\": \"Bill\",\r\n    \"last_name\": \"Gates\",\r\n    \"age\": 67,\r\n    \"gender\": \"Male\",\r\n    \"image\": \"https://example.com/Bill.jpg\",\r\n    \"active\": true,\r\n    \"is_deleted\": false,\r\n    \"created\": \"2010-01-01\",\r\n    \"created_by\": \"Admin\",\r\n    \"last_updated\": \"2023-10-18\",\r\n    \"last_updated_by\": \"Admin\"\r\n}\r\n","options":{"raw":{"language":"json"}}},"url":"http://127.0.0.1:5000/update_student/1002051002","description":"<p>This is a <code>PUT</code> method with a route to update a single student record from the \"<em><strong>students</strong></em>\" collection</p>\n","urlObject":{"protocol":"http","port":"5000","path":["update_student","1002051002"],"host":["127","0","0","1"],"query":[],"variable":[]}},"response":[],"_postman_id":"0e5b099a-46c1-4371-9d5f-2582ad0f1b7a"},{"name":"soft deleting a student record","id":"4d1009fb-f8f2-465c-b7c8-9cb2001e31d6","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[],"url":"http://127.0.0.1:5000/soft_delete_student/1","description":"<p>This is a <code>DELETE</code> method with a route to soft delete a single student record by setting the <em>is_delted</em> property to true</p>\n","urlObject":{"protocol":"http","port":"5000","path":["soft_delete_student","1"],"host":["127","0","0","1"],"query":[],"variable":[]}},"response":[],"_postman_id":"4d1009fb-f8f2-465c-b7c8-9cb2001e31d6"},{"name":"hard deleting a student record","id":"0702a069-423a-4f6b-9b0a-a3ce30a01a18","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[],"url":"http://127.0.0.1:5000/hard_delete_student/1","description":"<p>This is a <code>DELETE</code> method with a route to hard delete a single student record by removing the entire record using the student_id</p>\n","urlObject":{"protocol":"http","port":"5000","path":["hard_delete_student","1"],"host":["127","0","0","1"],"query":[],"variable":[]}},"response":[],"_postman_id":"0702a069-423a-4f6b-9b0a-a3ce30a01a18"}],"id":"ff0b45a2-d354-4126-8bef-5afe131cb2be","description":"<p>The following requests are done on the <em><strong>students</strong></em> collection inside the <em><strong>school database</strong></em></p>\n","_postman_id":"ff0b45a2-d354-4126-8bef-5afe131cb2be"},{"name":"student_tasks collection","item":[{"name":"getting a single student task","id":"335b65a9-8242-4217-ade1-4ba8fe5ca906","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://127.0.0.1:5000/get_student_task/task1","description":"<p>This is a <code>GET</code> method with a route to retrieve a single student task from the <em><strong>\"student_tasks\"</strong></em> collection</p>\n","urlObject":{"protocol":"http","port":"5000","path":["get_student_task","task1"],"host":["127","0","0","1"],"query":[],"variable":[]}},"response":[],"_postman_id":"335b65a9-8242-4217-ade1-4ba8fe5ca906"},{"name":"Get all student tasks","id":"ec9cc898-46be-4c83-b4fe-7c4a26f1f68c","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://127.0.0.1:5000/get_student_tasks/1","description":"<p>This is a <code>GET</code> method with a route to retrieve all tasks for a single student</p>\n","urlObject":{"protocol":"http","port":"5000","path":["get_student_tasks","1"],"host":["127","0","0","1"],"query":[],"variable":[]}},"response":[],"_postman_id":"ec9cc898-46be-4c83-b4fe-7c4a26f1f68c"},{"name":"Adding a single task","id":"7467786e-be7e-4a05-9086-5ccb059e65fa","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n  \"task_id\": \"task2\",\r\n  \"student_id\": \"2\",\r\n  \"score\": 85.32,\r\n  \"is_deleted\": false,\r\n  \"created\": \"2020-10-18\",\r\n  \"created_by\": \"Admin\",\r\n  \"last_updated\": \"2020-11-26\",\r\n  \"last_updated_by\": \"Admin\"\r\n}","options":{"raw":{"language":"json"}}},"url":"http://127.0.0.1:5000/add_student_task","description":"<p>This is a POST method with a route to add a single student task to the \"student_tasks\" collection in the school database</p>\n","urlObject":{"protocol":"http","port":"5000","path":["add_student_task"],"host":["127","0","0","1"],"query":[],"variable":[]}},"response":[],"_postman_id":"7467786e-be7e-4a05-9086-5ccb059e65fa"},{"name":"Updating a single task","id":"20bba47b-6764-4edc-b9e2-259794ce69e2","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\r\n  \"task_id\": \"task2.1\",\r\n  \"student_id\": \"2\",\r\n  \"score\": 95.32,\r\n  \"is_deleted\": false,\r\n  \"created\": \"2020-10-18\",\r\n  \"created_by\": \"Admin\",\r\n  \"last_updated\": \"2020-11-30\",\r\n  \"last_updated_by\": \"Admin\"\r\n}","options":{"raw":{"language":"json"}}},"url":"http://127.0.0.1:5000/update_student_task/task2","description":"<p>This is a PUT method with a route to update a single student task based on the task_id</p>\n","urlObject":{"protocol":"http","port":"5000","path":["update_student_task","task2"],"host":["127","0","0","1"],"query":[],"variable":[]}},"response":[],"_postman_id":"20bba47b-6764-4edc-b9e2-259794ce69e2"},{"name":"Soft delete a single task","id":"bdb3c4a4-efed-41e6-a26b-41b7d5b68569","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[],"body":{"mode":"raw","raw":"","options":{"raw":{"language":"json"}}},"url":"http://127.0.0.1:5000/soft_delete_student_task/task2.1","description":"<p>This is a DELETE method with a route to soft delte a single student task from the \"student_tasks\" collection in the school database using the task_id</p>\n","urlObject":{"protocol":"http","port":"5000","path":["soft_delete_student_task","task2.1"],"host":["127","0","0","1"],"query":[],"variable":[]}},"response":[],"_postman_id":"bdb3c4a4-efed-41e6-a26b-41b7d5b68569"},{"name":"Hard delete a single task","id":"31a5e523-5c1b-4830-aebb-82363c6bd05c","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[],"body":{"mode":"raw","raw":"","options":{"raw":{"language":"json"}}},"url":"http://127.0.0.1:5000/hard_delete_student_task/task2.1","description":"<p>This is a DELETE method with a route to hard delete a single student task from the \"student_tasks\" collection in the school database using the task_id</p>\n","urlObject":{"protocol":"http","port":"5000","path":["hard_delete_student_task","task2.1"],"host":["127","0","0","1"],"query":[],"variable":[]}},"response":[],"_postman_id":"31a5e523-5c1b-4830-aebb-82363c6bd05c"}],"id":"2df76a69-cca9-437e-a885-8865c168371f","description":"<p>The following requests are done on the <em><strong>student_tasks</strong></em> collection inside the <em><strong>students database</strong></em></p>\n","_postman_id":"2df76a69-cca9-437e-a885-8865c168371f"}],"id":"ec7ddaee-70c1-470b-83f8-076849787ea8","description":"<p>Before we can test our requests we need to ensure that the Flask application is currently running on port <code>http://127.0.0.1:5000</code></p>\n<p>go to the directory that you have saved your app.py script file in and type <code>python app.py</code> to run the script</p>\n<img src=\"https://content.pstmn.io/d9606b42-1e63-44fe-8aa0-370adcc29be5/aW1hZ2UucG5n\" width=\"642\" height=\"151\" />\n\n<p>&gt; The terminal should be open throught the testing of requests</p>\n","_postman_id":"ec7ddaee-70c1-470b-83f8-076849787ea8"}]}