{"info":{"_postman_id":"3b4d2351-b547-4d42-a9b9-2fd163049f3b","name":"Task Management RESTful API","description":"<html><head></head><body><p><strong>Task Management REST API</strong></p>\n<p>This project involves creating a Task Management REST API using Go and the Gin Framework. The API is designed to manage tasks through basic CRUD (Create, Read, Update, Delete) operations, leveraging MongoDB for persistent data storage. Docker is utilized to containerize the application, ensuring consistent environments across development, testing, and production.</p>\n<p>The API includes endpoints to retrieve all tasks, view details of a specific task, update a task's details, delete a task, and create new tasks. It ensures proper error handling, response codes, and adheres to Go best practices. MongoDB is used for efficient data storage and retrieval, and Docker provides a reliable setup for running the application in various environments.</p>\n<p>Documentation is provided for all endpoints, detailing request payloads and response formats. The API is tested using Postman to verify functionality and ensure compliance with specifications, demonstrating a robust and scalable approach to task management.</p>\n<h3 id=\"instructions-for-testing-the-task-management-api\">Instructions for Testing the Task Management API</h3>\n<p>To test the Task Management API, follow these steps:</p>\n<h4 id=\"1-setup-and-installation\">1. <strong>Setup and Installation</strong></h4>\n<ol>\n<li>git clone <a href=\"https://github.com/solo21-12/task_management_API_gin\">https://github.com/solo21-12/task_management_API_gin.git</a></li>\n<li>cd <a href=\"https://github.com/solo21-12/task_management_API_gin\">task_management_API_gin</a></li>\n<li>go mod tidy</li>\n<li>make run</li>\n</ol>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"22911710","collectionId":"3b4d2351-b547-4d42-a9b9-2fd163049f3b","publishedId":"2sA3s7j8v6","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"publishDate":"2024-08-15T19:55:31.000Z"},"item":[{"name":"Authentication","item":[{"name":"register","id":"e71229b4-00c5-4074-bbf9-7fb4bb5fbcef","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"email\":\"test20@gmail.com\",\n    \"password\":\"strongpassword\"\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:8081/register","description":"<h3 id=\"register-user\">Register User</h3>\n<p>This endpoint allows the client to register a new user.</p>\n<h4 id=\"request-body\">Request Body</h4>\n<ul>\n<li><code>email</code> (string, required): The email of the user.</li>\n<li><code>password</code> (string, required): The password for the user account.</li>\n</ul>\n<h4 id=\"response\">Response</h4>\n<ul>\n<li><code>message</code> (string): A message indicating the result of the registration.</li>\n<li><code>user</code> (object):<ul>\n<li><code>id</code> (string): The unique identifier for the user.</li>\n<li><code>email</code> (string): The email address of the user.</li>\n<li><code>role</code> (string): The role of the user in the system.</li>\n</ul>\n</li>\n<li><code>accessToken</code> (string): Access token for the registered user.</li>\n</ul>\n","urlObject":{"protocol":"http","port":"8081","path":["register"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"25aed5b5-28a0-47e4-987b-068d0d5d787f","name":"test user register","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"email\":\"test255@gmail.com\",\n    \"password\":\"strongpassword\"\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:8081/register"},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Date","value":"Thu, 08 Aug 2024 13:33:57 GMT"},{"key":"Content-Length","value":"173"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"User registered successfully\",\n    \"user\": {\n        \"id\": \"66b4c9458104d6aa196b72c6\",\n        \"email\": \"test255@gmail.com\",\n        \"role\": \"user\"\n    }\n}"},{"id":"23d9eaa2-19c7-483f-8c55-c4227e54dccd","name":"user already exists","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"email\":\"test20@gmail.com\",\n    \"password\":\"strongpassword\"\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:8081/register"},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Date","value":"Sat, 10 Aug 2024 07:45:03 GMT"},{"key":"Content-Length","value":"66"}],"cookie":[],"responseTime":null,"body":"{\n    \"error\": \"user with email test20@gmail.com already exists\"\n}"}],"_postman_id":"e71229b4-00c5-4074-bbf9-7fb4bb5fbcef"},{"name":"login","id":"22ffd2e2-87cc-437f-bc0e-40d9dc2c144a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"email\":\"test20@gmail.com\",\n    \"password\":\"strongpassword\"\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:8081/login","description":"<h3 id=\"request-body\">Request Body</h3>\n<p>The request should include a JSON payload in the raw request body type with the following fields:</p>\n<ul>\n<li><code>email</code> (string): The email of the user.</li>\n<li><code>password</code> (string): The password of the user.</li>\n</ul>\n<h3 id=\"response\">Response</h3>\n<p>Upon successful login, the response will have a status code of 200 and a Content-Type of application/json. The response body will include a JSON object with the following fields:</p>\n<ul>\n<li><code>user</code> (object): An object containing the user details with the following fields:<ul>\n<li><code>id</code> (string): The user's ID.</li>\n<li><code>email</code> (string): The user's email.</li>\n<li><code>role</code> (string): The user's role.</li>\n</ul>\n</li>\n<li><code>accessToken</code> (string): The access token for the logged-in user.</li>\n</ul>\n<h4 id=\"example-response\">Example Response</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"user\": {\n        \"id\": \"\",\n        \"email\": \"\",\n        \"role\": \"\"\n    },\n    \"accessToken\": \"\"\n}\n\n</code></pre>\n","urlObject":{"protocol":"http","port":"8081","path":["login"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"1f26ade0-f4eb-4b28-a8a1-968b9f8d6c95","name":"user login","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"email\":\"test20@gmail.com\",\n    \"password\":\"strongpassword\"\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:8081/login"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Date","value":"Thu, 08 Aug 2024 13:32:21 GMT"},{"key":"Content-Length","value":"301"}],"cookie":[],"responseTime":null,"body":"{\n    \"user\": {\n        \"email\": \"test20@gmail.com\",\n        \"password\": \"strongpassword\"\n    },\n    \"token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6InRlc3QyMEBnbWFpbC5jb20iLCJyb2xlIjoidXNlciIsInVzZXJfaWQiOiI2NmI0YjU5ZmMxNTJmMWQwZTY4ZGNkZmQifQ.nzpAzwzkq8Ilymkn1WDRh9v_k2F31cp9HaSiu9HAJ8g\"\n}"},{"id":"f489c4e3-31b2-49b1-855a-b129cb3e1cd1","name":"invalid creaditional","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"email\":\"test@gmail.com\",\n    \"password\":\"strongpssword\"\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:8081/login"},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Date","value":"Sat, 10 Aug 2024 07:45:41 GMT"},{"key":"Content-Length","value":"44"}],"cookie":[],"responseTime":null,"body":"{\n    \"error\": \"invalid email or password\"\n}"},{"id":"1cbbf288-2fa2-437c-9b07-55c8e74d07e7","name":"no user found","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"email\":\"tes@gmail.com\",\n    \"password\":\"strongpssword\"\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:8081/login"},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Date","value":"Sat, 10 Aug 2024 07:46:02 GMT"},{"key":"Content-Length","value":"75"}],"cookie":[],"responseTime":null,"body":"{\n    \"error\": \"no user find with the given email address: tes@gmail.com\"\n}"}],"_postman_id":"22ffd2e2-87cc-437f-bc0e-40d9dc2c144a"}],"id":"15423946-13d2-48cb-ae07-5545ac813193","description":"<p>This section handles authentication for the Task Management API. It includes user registration and login functionalities, utilizing JSON Web Tokens (JWT) to secure access to protected endpoints. Upon successful login, users receive a JWT, which must be included in the header of subsequent requests to access restricted routes.</p>\n<p>To enhance security, the JWT is configured to expire every 30 minutes. Users will need to authenticate again to obtain a new token once the current one expires. This approach ensures that the system regularly verifies user identity and reduces the risk of unauthorized access.</p>\n","_postman_id":"15423946-13d2-48cb-ae07-5545ac813193"},{"name":"Task manager","item":[{"name":"Retrive all tasks","event":[{"listen":"test","script":{"id":"88735c07-6de4-4c9a-acb6-abe005efeced","exec":["var template = `","<style type=\"text/css\">","    .tftable {font-size:14px;color:#333333;width:100%;border-width: 1px;border-color: #87ceeb;border-collapse: collapse;}","    .tftable th {font-size:18px;background-color:#87ceeb;border-width: 1px;padding: 8px;border-style: solid;border-color: #87ceeb;text-align:left;}","    .tftable tr {background-color:#ffffff;}","    .tftable td {font-size:14px;border-width: 1px;padding: 8px;border-style: solid;border-color: #87ceeb;}","    .tftable tr:hover {background-color:#e0ffff;}","</style>","","<table class=\"tftable\" border=\"1\">","    <tr>","        <th>ID</th>","        <th>Title</th>","        <th>Description</th>","        <th>Due Date</th>","        <th>Status</th>","    </tr>","    ","    {{#each response}}","        <tr>","            <td>{{id}}</td>","            <td>{{title}}</td>","            <td>{{description}}</td>","            <td>{{due_date}}</td>","            <td>{{status}}</td>","        </tr>","    {{/each}}","</table>","`;","","function constructVisualizerPayload() {","    return {response: pm.response.json()}","}","","pm.visualizer.set(template, constructVisualizerPayload());"],"type":"text/javascript","packages":{}}}],"id":"cc53fe07-fa67-44d5-93dd-9a0f3b750434","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6InRlc3RAZ21haWwuY29tIiwiZXhwIjoiMjAyNC0wOC0xMFQxMToxNzoxNS40NDY2NDAwOTcrMDM6MDAiLCJyb2xlIjoiYWRtaW4iLCJ1c2VyX2lkIjoiNjZiNGI0ZDU1NzAxYjdhMTFkZjJmNzczIn0.x7J0f_B5_RrjnZSamvOUqF-3Q34rBTdZkcnATaLcFOc","type":"text"}],"url":"http://localhost:8081/tasks","description":"<p>This endpoint retrieves a list of tasks.</p>\n<h3 id=\"request\">Request</h3>\n<p>There are no request parameters for this endpoint.</p>\n<h3 id=\"response\">Response</h3>\n<ul>\n<li>Status: 200 OK</li>\n<li>Content-Type: application/json</li>\n</ul>\n<p>The response body will contain an array of tasks, where each task object includes the following properties:</p>\n<ul>\n<li>id (string): The unique identifier for the task.</li>\n<li>title (string): The title of the task.</li>\n<li>description (string): The description of the task.</li>\n<li>due_date (string): The due date of the task.</li>\n<li>status (string): The status of the task.</li>\n</ul>\n<p>Example response body:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">[\n    {\n        \"id\": \"task1\",\n        \"title\": \"Task 1\",\n        \"description\": \"Complete task 1\",\n        \"due_date\": \"2022-12-31\",\n        \"status\": \"in_progress\"\n    },\n    {\n        \"id\": \"task2\",\n        \"title\": \"Task 2\",\n        \"description\": \"Review task 2\",\n        \"due_date\": \"2022-11-15\",\n        \"status\": \"pending\"\n    }\n]\n\n</code></pre>\n","urlObject":{"protocol":"http","port":"8081","path":["tasks"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"2436664a-9718-4768-a7f8-f38a5e262d5a","name":"unauthorized","originalRequest":{"method":"GET","header":[],"url":"http://localhost:8081/tasks"},"status":"Unauthorized","code":401,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Date","value":"Sat, 10 Aug 2024 07:47:37 GMT"},{"key":"Content-Length","value":"24"}],"cookie":[],"responseTime":null,"body":"{\n    \"error\": \"Unauthorized\"\n}"},{"id":"3c56b54e-a7d6-49d2-9451-d4c1bb80aa58","name":"sucess","originalRequest":{"method":"GET","header":[{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6InRlc3RAZ21haWwuY29tIiwiZXhwIjoiMjAyNC0wOC0xMFQxMToxNzoxNS40NDY2NDAwOTcrMDM6MDAiLCJyb2xlIjoiYWRtaW4iLCJ1c2VyX2lkIjoiNjZiNGI0ZDU1NzAxYjdhMTFkZjJmNzczIn0.x7J0f_B5_RrjnZSamvOUqF-3Q34rBTdZkcnATaLcFOc","type":"text"}],"url":"http://localhost:8081/tasks"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Date","value":"Sat, 10 Aug 2024 07:48:05 GMT"},{"key":"Content-Length","value":"839"}],"cookie":[],"responseTime":null,"body":"[\n    {\n        \"id\": \"66b450c5e72e34cb6e8acc32\",\n        \"title\": \"Upwork done !\",\n        \"description\": \"waiting for the first job\",\n        \"due_date\": \"2025-08-06T12:31:42.663Z\",\n        \"status\": \"Pending\"\n    },\n    {\n        \"id\": \"66b453ff50832174c95a4c15\",\n        \"title\": \"Task five Completed\",\n        \"description\": \"Starting the next job\",\n        \"due_date\": \"2025-08-06T12:31:42.663Z\",\n        \"status\": \"Pending\"\n    },\n    {\n        \"id\": \"66b4d65352fffc86e9b12bcf\",\n        \"title\": \"New title updated\",\n        \"description\": \"First four\",\n        \"due_date\": \"2024-08-06T12:31:42.663Z\",\n        \"status\": \"Pending\"\n    },\n    {\n        \"id\": \"66b7133917422a81bd5f3734\",\n        \"title\": \"Task 4\",\n        \"description\": \"First four\",\n        \"due_date\": \"2024-08-06T12:31:42.663Z\",\n        \"status\": \"Pending\"\n    }\n]"}],"_postman_id":"cc53fe07-fa67-44d5-93dd-9a0f3b750434"},{"name":"Retrive a task based on ID","id":"d58747b9-f4fc-461c-8cc8-105b0476a8d8","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6InRlc3RAZ21haWwuY29tIiwiZXhwIjoiMjAyNC0wOC0xMFQxMToxNzoxNS40NDY2NDAwOTcrMDM6MDAiLCJyb2xlIjoiYWRtaW4iLCJ1c2VyX2lkIjoiNjZiNGI0ZDU1NzAxYjdhMTFkZjJmNzczIn0.x7J0f_B5_RrjnZSamvOUqF-3Q34rBTdZkcnATaLcFOc","type":"text"}],"url":"http://localhost:8081/tasks/66b450c5e72e34cb6e8acc32","description":"<h3 id=\"get-tasks1\">GET /tasks/1</h3>\n<p>This endpoint retrieves the details of a specific task identified by its ID.</p>\n<h4 id=\"request\">Request</h4>\n<p>No request body is required for this endpoint.</p>\n<h4 id=\"response\">Response</h4>\n<p>The response will be in JSON format and will contain the following fields:</p>\n<ul>\n<li><code>id</code> (string): The unique identifier of the task.</li>\n<li><code>title</code> (string): The title or name of the task.</li>\n<li><code>description</code> (string): A brief description of the task.</li>\n<li><code>due_date</code> (string): The due date of the task.</li>\n<li><code>status</code> (string): The current status of the task.</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"id\": \"\",\n  \"title\": \"\",\n  \"description\": \"\",\n  \"due_date\": \"\",\n  \"status\": \"\"\n}\n\n</code></pre>\n","urlObject":{"protocol":"http","port":"8081","path":["tasks","66b450c5e72e34cb6e8acc32"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"fb2bda60-8dc0-4b30-b24d-6041d77fbe46","name":"unauthorized","originalRequest":{"method":"GET","header":[],"url":"http://localhost:8081/tasks/3"},"status":"Unauthorized","code":401,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Date","value":"Sat, 10 Aug 2024 07:48:52 GMT"},{"key":"Content-Length","value":"24"}],"cookie":[],"responseTime":null,"body":"{\n    \"error\": \"Unauthorized\"\n}"},{"id":"1962cf80-be9d-49dc-9110-1fde91bc55f8","name":"invalid id format","originalRequest":{"method":"GET","header":[{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6InRlc3RAZ21haWwuY29tIiwiZXhwIjoiMjAyNC0wOC0xMFQxMToxNzoxNS40NDY2NDAwOTcrMDM6MDAiLCJyb2xlIjoiYWRtaW4iLCJ1c2VyX2lkIjoiNjZiNGI0ZDU1NzAxYjdhMTFkZjJmNzczIn0.x7J0f_B5_RrjnZSamvOUqF-3Q34rBTdZkcnATaLcFOc","type":"text"}],"url":"http://localhost:8081/tasks/3"},"status":"Not Found","code":404,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Date","value":"Sat, 10 Aug 2024 07:49:26 GMT"},{"key":"Content-Length","value":"90"}],"cookie":[],"responseTime":null,"body":"{\n    \"error\": \"invalid task ID format: the provided hex string is not a valid ObjectID\"\n}"},{"id":"8adfdbe9-7d4f-48ea-ae59-8c1d4c532ff5","name":"success","originalRequest":{"method":"GET","header":[{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6InRlc3RAZ21haWwuY29tIiwiZXhwIjoiMjAyNC0wOC0xMFQxMToxNzoxNS40NDY2NDAwOTcrMDM6MDAiLCJyb2xlIjoiYWRtaW4iLCJ1c2VyX2lkIjoiNjZiNGI0ZDU1NzAxYjdhMTFkZjJmNzczIn0.x7J0f_B5_RrjnZSamvOUqF-3Q34rBTdZkcnATaLcFOc","type":"text"}],"url":"http://localhost:8081/tasks/66b450c5e72e34cb6e8acc32"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Date","value":"Sat, 10 Aug 2024 07:49:48 GMT"},{"key":"Content-Length","value":"187"}],"cookie":[],"responseTime":null,"body":"{\n    \"id\": \"66b450c5e72e34cb6e8acc32\",\n    \"title\": \"Upwork done !\",\n    \"description\": \"waiting for the first job\",\n    \"due_date\": \"2025-08-06T12:31:42.663Z\",\n    \"status\": \"Pending\"\n}"}],"_postman_id":"d58747b9-f4fc-461c-8cc8-105b0476a8d8"},{"name":"Create a new task","event":[{"listen":"test","script":{"id":"08733fe8-a7ce-4b4d-a6cb-6e8c8fcd106c","exec":["","pm.test(\"Response status code is 201\", function () {","    pm.expect(pm.response.to.have.status(201));","});","","","pm.test(\"Response time is less than 500ms\", function () {","  pm.expect(pm.response.responseTime).to.be.below(500);","});","","","pm.test(\"Response has the required fields - id, title, description, due_date, and status\", function () {","    const responseData = pm.response.json();","    ","    pm.expect(responseData).to.be.an('object');","    pm.expect(responseData).to.include.all.keys('id', 'title', 'description', 'due_date', 'status');","});","","","pm.test(\"Id is a non-empty string\", function () {","  const responseData = pm.response.json();","  ","  pm.expect(responseData.id).to.be.a('string').and.to.have.lengthOf.at.least(1, \"Id should be a non-empty string\");","});","","","pm.test(\"Due date is in a valid date format\", function () {","  const responseData = pm.response.json();","  ","  pm.expect(responseData.due_date).to.match(/^\\d{4}-\\d{2}-\\d{2}$/);","});","",""],"type":"text/javascript","packages":{}}}],"id":"0e729b61-9c4c-47ea-a338-cc29ae95167e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6InRlc3RAZ21haWwuY29tIiwiZXhwIjoiMjAyNC0wOC0xMFQxMToxNzoxNS40NDY2NDAwOTcrMDM6MDAiLCJyb2xlIjoiYWRtaW4iLCJ1c2VyX2lkIjoiNjZiNGI0ZDU1NzAxYjdhMTFkZjJmNzczIn0.x7J0f_B5_RrjnZSamvOUqF-3Q34rBTdZkcnATaLcFOc","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"title\": \"Task 6 was challenging\",\n    \"description\": \"First four\",\n    \"due_date\": \"2024-08-06T15:31:42.663947465+03:00\",\n    \"status\": \"Pending\"\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:8081/tasks","description":"<h3 id=\"post-tasks\">POST /tasks</h3>\n<p>This endpoint is used to create a new task.</p>\n<h4 id=\"request-body\">Request Body</h4>\n<ul>\n<li><p><code>id</code> (text, required): The unique identifier for the task.</p>\n</li>\n<li><p><code>title</code> (text, required): The title of the task.</p>\n</li>\n<li><p><code>description</code> (text, optional): The description of the task.</p>\n</li>\n<li><p><code>due_date</code> (text, optional): The due date of the task.</p>\n</li>\n<li><p><code>status</code> (text, required): The status of the task.</p>\n</li>\n</ul>\n<h4 id=\"response\">Response</h4>\n<p>The response is in JSON format with the following schema:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"id\": \"\",\n    \"title\": \"\",\n    \"description\": \"\",\n    \"due_date\": \"\",\n    \"status\": \"\"\n}\n\n</code></pre>\n<h4 id=\"response-code\">Response Code</h4>\n<ul>\n<li>201: The task was successfully created.</li>\n</ul>\n","urlObject":{"protocol":"http","port":"8081","path":["tasks"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"23bc8ae4-cb4d-4366-ab8d-cbdb0e82d912","name":"unauthorized","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"id\": \"4\",\n    \"title\": \"Task 4\",\n    \"description\": \"First four\",\n    \"due_date\": \"2024-08-06T15:31:42.663947465+03:00\",\n    \"status\": \"Pending\"\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:8081/tasks"},"status":"Unauthorized","code":401,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Date","value":"Sat, 10 Aug 2024 07:50:39 GMT"},{"key":"Content-Length","value":"24"}],"cookie":[],"responseTime":null,"body":"{\n    \"error\": \"Unauthorized\"\n}"},{"id":"d06abb27-0a47-490a-950a-b0290f1628db","name":"forbidden","originalRequest":{"method":"POST","header":[{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6InRlc3QyMEBnbWFpbC5jb20iLCJleHAiOiIyMDI0LTA4LTEwVDExOjIwOjE2LjMzNDE3NTErMDM6MDAiLCJyb2xlIjoidXNlciIsInVzZXJfaWQiOiI2NmI0YjU5ZmMxNTJmMWQwZTY4ZGNkZmQifQ.BvYPsh885mJtQTwJgy6EutXx5HHPi6yM-E1OnWEfOA0","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"id\": \"4\",\n    \"title\": \"Task 4\",\n    \"description\": \"First four\",\n    \"due_date\": \"2024-08-06T15:31:42.663947465+03:00\",\n    \"status\": \"Pending\"\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:8081/tasks"},"status":"Forbidden","code":403,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Date","value":"Sat, 10 Aug 2024 07:51:11 GMT"},{"key":"Content-Length","value":"61"}],"cookie":[],"responseTime":null,"body":"{\n    \"error\": \"Forbidden only admin user can perform this action\"\n}"},{"id":"ecbd28e9-2065-4da4-b6f2-a169ece3d987","name":"success","originalRequest":{"method":"POST","header":[{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6InRlc3RAZ21haWwuY29tIiwiZXhwIjoiMjAyNC0wOC0xMFQxMToxNzoxNS40NDY2NDAwOTcrMDM6MDAiLCJyb2xlIjoiYWRtaW4iLCJ1c2VyX2lkIjoiNjZiNGI0ZDU1NzAxYjdhMTFkZjJmNzczIn0.x7J0f_B5_RrjnZSamvOUqF-3Q34rBTdZkcnATaLcFOc","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"title\": \"Task 6 was challenging\",\n    \"description\": \"First four\",\n    \"due_date\": \"2024-08-06T15:31:42.663947465+03:00\",\n    \"status\": \"Pending\"\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:8081/tasks"},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Date","value":"Sat, 10 Aug 2024 08:00:31 GMT"},{"key":"Content-Length","value":"229"}],"cookie":[],"responseTime":null,"body":"{\n    \"created task\": {\n        \"id\": \"66b71e1e9d5e348a9bdd3b3e\",\n        \"title\": \"Task 6 was challenging\",\n        \"description\": \"First four\",\n        \"due_date\": \"2024-08-06T12:31:42.663Z\",\n        \"status\": \"Pending\"\n    }\n}"}],"_postman_id":"0e729b61-9c4c-47ea-a338-cc29ae95167e"},{"name":"Update a task","id":"1a642cd3-4e86-4a3d-9976-3480830a9b47","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6InRlc3RAZ21haWwuY29tIiwiZXhwIjoiMjAyNC0wOC0xMFQxMToxNzoxNS40NDY2NDAwOTcrMDM6MDAiLCJyb2xlIjoiYWRtaW4iLCJ1c2VyX2lkIjoiNjZiNGI0ZDU1NzAxYjdhMTFkZjJmNzczIn0.x7J0f_B5_RrjnZSamvOUqF-3Q34rBTdZkcnATaLcFOc","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"id\": \"66b450c5e72e34cb6e8acc32\",\n    \"title\": \"Upwork not done\",\n    \"description\": \"waiting for the first job\",\n    \"due_date\": \"2025-08-06T12:31:42.663Z\",\n    \"status\": \"Active\"\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:8081/tasks/66b450c5e72e34cb6e8acc32","description":"<p>This endpoint allows updating a specific task identified by the ID in the URL. The request should include the task ID, title, description, due date, and status in the request body. The request body should be in JSON format.</p>\n<h3 id=\"request-body\">Request Body</h3>\n<ul>\n<li><code>id</code> (string): The ID of the task.</li>\n<li><code>title</code> (string): The title of the task.</li>\n<li><code>description</code> (string): The description of the task.</li>\n<li><code>due_date</code> (string): The due date of the task.</li>\n<li><code>status</code> (string): The status of the task.</li>\n</ul>\n<h3 id=\"response\">Response</h3>\n<p>The response will have a status code of 200 and a JSON body representing the updated task. The JSON schema for the response body is as follows:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"type\": \"object\",\n  \"properties\": {\n    \"id\": { \"type\": \"string\" },\n    \"title\": { \"type\": \"string\" },\n    \"description\": { \"type\": \"string\" },\n    \"due_date\": { \"type\": \"string\" },\n    \"status\": { \"type\": \"string\" }\n  }\n}\n\n</code></pre>\n","urlObject":{"protocol":"http","port":"8081","path":["tasks","66b450c5e72e34cb6e8acc32"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"368df1c6-83ed-4220-892a-0a569a33b659","name":"unauthorized","originalRequest":{"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\n    \"id\": \"3\",\n    \"title\": \"New Task\",\n    \"description\": \"Task three got updated\",\n    \"due_date\": \"2024-08-06T15:31:42.663947465+03:00\",\n    \"status\": \"Completed\"\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:8081/tasks/4"},"status":"Unauthorized","code":401,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Date","value":"Sat, 10 Aug 2024 07:51:49 GMT"},{"key":"Content-Length","value":"24"}],"cookie":[],"responseTime":null,"body":"{\n    \"error\": \"Unauthorized\"\n}"},{"id":"0c9fc323-9911-4de4-8dea-3f984e715774","name":"forbidden","originalRequest":{"method":"PUT","header":[{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6InRlc3QyMEBnbWFpbC5jb20iLCJleHAiOiIyMDI0LTA4LTEwVDExOjIwOjE2LjMzNDE3NTErMDM6MDAiLCJyb2xlIjoidXNlciIsInVzZXJfaWQiOiI2NmI0YjU5ZmMxNTJmMWQwZTY4ZGNkZmQifQ.BvYPsh885mJtQTwJgy6EutXx5HHPi6yM-E1OnWEfOA0","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"id\": \"66b450c5e72e34cb6e8acc32\",\n    \"title\": \"Upwork done !\",\n    \"description\": \"waiting for the first job\",\n    \"due_date\": \"2025-08-06T12:31:42.663Z\",\n    \"status\": \"Pending\"\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:8081/tasks/66b450c5e72e34cb6e8acc32"},"status":"Forbidden","code":403,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Date","value":"Sat, 10 Aug 2024 07:54:52 GMT"},{"key":"Content-Length","value":"61"}],"cookie":[],"responseTime":null,"body":"{\n    \"error\": \"Forbidden only admin user can perform this action\"\n}"},{"id":"2589d658-61fd-4033-8582-8cafdf2a0a45","name":"no update on the file","originalRequest":{"method":"PUT","header":[{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6InRlc3RAZ21haWwuY29tIiwiZXhwIjoiMjAyNC0wOC0xMFQxMToxNzoxNS40NDY2NDAwOTcrMDM6MDAiLCJyb2xlIjoiYWRtaW4iLCJ1c2VyX2lkIjoiNjZiNGI0ZDU1NzAxYjdhMTFkZjJmNzczIn0.x7J0f_B5_RrjnZSamvOUqF-3Q34rBTdZkcnATaLcFOc","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"id\": \"66b450c5e72e34cb6e8acc32\",\n    \"title\": \"Upwork done !\",\n    \"description\": \"waiting for the first job\",\n    \"due_date\": \"2025-08-06T12:31:42.663Z\",\n    \"status\": \"Pending\"\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:8081/tasks/66b450c5e72e34cb6e8acc32"},"status":"Not Found","code":404,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Date","value":"Sat, 10 Aug 2024 07:55:45 GMT"},{"key":"Content-Length","value":"56"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"No update has been made to the file\"\n}"},{"id":"6d4f9560-5466-43a3-92b3-edba6350bc73","name":"success","originalRequest":{"method":"PUT","header":[{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6InRlc3RAZ21haWwuY29tIiwiZXhwIjoiMjAyNC0wOC0xMFQxMToxNzoxNS40NDY2NDAwOTcrMDM6MDAiLCJyb2xlIjoiYWRtaW4iLCJ1c2VyX2lkIjoiNjZiNGI0ZDU1NzAxYjdhMTFkZjJmNzczIn0.x7J0f_B5_RrjnZSamvOUqF-3Q34rBTdZkcnATaLcFOc","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"id\": \"66b450c5e72e34cb6e8acc32\",\n    \"title\": \"Upwork not done\",\n    \"description\": \"waiting for the first job\",\n    \"due_date\": \"2025-08-06T12:31:42.663Z\",\n    \"status\": \"Pending\"\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:8081/tasks/66b450c5e72e34cb6e8acc32"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Date","value":"Sat, 10 Aug 2024 07:56:10 GMT"},{"key":"Content-Length","value":"189"}],"cookie":[],"responseTime":null,"body":"{\n    \"id\": \"66b450c5e72e34cb6e8acc32\",\n    \"title\": \"Upwork not done\",\n    \"description\": \"waiting for the first job\",\n    \"due_date\": \"2025-08-06T12:31:42.663Z\",\n    \"status\": \"Pending\"\n}"}],"_postman_id":"1a642cd3-4e86-4a3d-9976-3480830a9b47"},{"name":"Delete a task","id":"5325d47b-2290-47c2-ae97-16c948a9157d","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6InRlc3RAZ21haWwuY29tIiwiZXhwIjoiMjAyNC0wOC0xMFQxMToxNzoxNS40NDY2NDAwOTcrMDM6MDAiLCJyb2xlIjoiYWRtaW4iLCJ1c2VyX2lkIjoiNjZiNGI0ZDU1NzAxYjdhMTFkZjJmNzczIn0.x7J0f_B5_RrjnZSamvOUqF-3Q34rBTdZkcnATaLcFOc","type":"text"}],"url":"http://localhost:8081/tasks/66b450c5e72e34cb6e8acc32","description":"<h3 id=\"delete-task\">Delete Task</h3>\n<p>This endpoint sends an HTTP DELETE request to delete a specific task identified by the provided task ID.</p>\n<h4 id=\"request-body\">Request Body</h4>\n<p>This request does not require a request body.</p>\n<h4 id=\"response\">Response</h4>\n<p>The response will indicate the success or failure of the deletion operation.</p>\n","urlObject":{"protocol":"http","port":"8081","path":["tasks","66b450c5e72e34cb6e8acc32"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"756484fd-5a20-4131-9476-a2bd699dfa35","name":"forbidden","originalRequest":{"method":"DELETE","header":[{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6InRlc3QyMEBnbWFpbC5jb20iLCJleHAiOiIyMDI0LTA4LTEwVDExOjIwOjE2LjMzNDE3NTErMDM6MDAiLCJyb2xlIjoidXNlciIsInVzZXJfaWQiOiI2NmI0YjU5ZmMxNTJmMWQwZTY4ZGNkZmQifQ.BvYPsh885mJtQTwJgy6EutXx5HHPi6yM-E1OnWEfOA0","type":"text"}],"url":"http://localhost:8081/tasks/66b450c5e72e34cb6e8acc32"},"status":"Forbidden","code":403,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Date","value":"Sat, 10 Aug 2024 07:53:33 GMT"},{"key":"Content-Length","value":"61"}],"cookie":[],"responseTime":null,"body":"{\n    \"error\": \"Forbidden only admin user can perform this action\"\n}"},{"id":"764b4c7c-2949-4ca0-8212-6c908fa35c37","name":"unauthorized","originalRequest":{"method":"DELETE","header":[{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6InRlc3QyMEBnbWFpbC5jb20iLCJleHAiOiIyMDI0LTA4LTEwVDExOjIwOjE2LjMzNDE3NTErMDM6MDAiLCJyb2xlIjoidXNlciIsInVzZXJfaWQiOiI2NmI0YjU5ZmMxNTJmMWQwZTY4ZGNkZmQifQ.BvYPsh885mJtQTwJgy6EutXx5HHPi6yM-E1OnWEfOA0","type":"text","disabled":true}],"url":"http://localhost:8081/tasks/66b450c5e72e34cb6e8acc32"},"status":"Unauthorized","code":401,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Date","value":"Sat, 10 Aug 2024 07:53:49 GMT"},{"key":"Content-Length","value":"24"}],"cookie":[],"responseTime":null,"body":"{\n    \"error\": \"Unauthorized\"\n}"},{"id":"b7bd6656-54c3-4e8d-818b-2f6328a24681","name":"success","originalRequest":{"method":"DELETE","header":[{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6InRlc3RAZ21haWwuY29tIiwiZXhwIjoiMjAyNC0wOC0xMFQxMToxNzoxNS40NDY2NDAwOTcrMDM6MDAiLCJyb2xlIjoiYWRtaW4iLCJ1c2VyX2lkIjoiNjZiNGI0ZDU1NzAxYjdhMTFkZjJmNzczIn0.x7J0f_B5_RrjnZSamvOUqF-3Q34rBTdZkcnATaLcFOc","type":"text"}],"url":"http://localhost:8081/tasks/66b450c5e72e34cb6e8acc32"},"status":"No Content","code":204,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Date","value":"Sat, 10 Aug 2024 07:59:40 GMT"}],"cookie":[],"responseTime":null,"body":null}],"_postman_id":"5325d47b-2290-47c2-ae97-16c948a9157d"}],"id":"ec8ecb4a-0135-4c4a-8d05-13644f71d849","description":"<p>This section is dedicated to handling the task service for the Task Management API. It involves managing tasks through basic CRUD (Create, Read, Update, Delete) operations, with secure access controlled by JSON Web Tokens (JWT).</p>\n<p>The task service includes endpoints to:</p>\n<ul>\n<li>Retrieve all tasks</li>\n<li>View details of a specific task</li>\n<li>Update a task's details</li>\n<li>Delete a task</li>\n<li>Create new tasks</li>\n</ul>\n<p>Currently, only admins have the authorization to create new tasks. This restriction is enforced through JWT-based authentication, which ensures that only users with admin privileges can access the task creation endpoint. Each request to these endpoints must include a valid JWT in the header. The JWT is issued upon successful user login and is configured to expire every 30 minutes, requiring users to re-authenticate to obtain a new token after expiration.</p>\n","_postman_id":"ec8ecb4a-0135-4c4a-8d05-13644f71d849"},{"name":"User","item":[{"name":"promote user","id":"4f472b20-9b82-45f2-b98d-83a692c1a187","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PATCH","header":[{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY2YjlhZDA0NDJkMGQyNGVhZmExZTc2YyIsImVtYWlsIjoidGVzdDE0MGdtYWlsLmNvbSIsInJvbGUiOiJ1c2VyIiwiZXhwIjoxNzIzNDQ2Mjg1fQ.d4vwi7X7js4on3Vrf13wknamoiHT129_Iw5bUq6i8JM","type":"text"}],"url":"http://localhost:8081/promote/66b8ceaa6f5548c43cecbfe6","description":"<p>This endpoint allows you to send an HTTP PATCH request to promote a specific item identified by its ID. The request should include the item ID in the URL. The request body should contain the necessary data to update the item.</p>\n<h3 id=\"request-body\">Request Body</h3>\n<p>The request body should contain the data to be updated for the item.</p>\n<h3 id=\"response\">Response</h3>\n<ul>\n<li><code>message</code>: A string indicating the result of the promotion action.</li>\n</ul>\n<h4 id=\"example\">Example</h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"message\": \"\"\n}\n\n</code></pre>\n","urlObject":{"protocol":"http","port":"8081","path":["promote","66b8ceaa6f5548c43cecbfe6"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"564f7057-42e4-48ed-8b9c-a2a5637241fd","name":"forbidden","originalRequest":{"method":"PATCH","header":[{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY2YjlhZDA0NDJkMGQyNGVhZmExZTc2YyIsImVtYWlsIjoidGVzdDE0MGdtYWlsLmNvbSIsInJvbGUiOiJ1c2VyIiwiZXhwIjoxNzIzNDQ2Mjg1fQ.d4vwi7X7js4on3Vrf13wknamoiHT129_Iw5bUq6i8JM","type":"text"}],"url":"http://localhost:8081/promote/66b8ceaa6f5548c43cecbfe6"},"status":"Forbidden","code":403,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Date","value":"Mon, 12 Aug 2024 06:36:16 GMT"},{"key":"Content-Length","value":"61"}],"cookie":[],"responseTime":null,"body":"{\n    \"error\": \"Forbidden only admin user can perform this action\"\n}"},{"id":"72e4e838-6bd1-4326-8159-1739295b4794","name":"success","originalRequest":{"method":"PATCH","header":[{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY2YjhjZWFhNmY1NTQ4YzQzY2VjYmZlNiIsImVtYWlsIjoidGVzdDIwQGdtYWlsLmNvbSIsInJvbGUiOiJhZG1pbiIsImV4cCI6MTcyMzQ0NjYyNn0.aBeGrKuwTKn4qQhPb6OlH5ofQmOxwa11lp1ozPoed-0","type":"text"}],"url":"http://localhost:8081/promote/66b8cec76f5548c43cecbfe7"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Date","value":"Mon, 12 Aug 2024 06:43:21 GMT"},{"key":"Content-Length","value":"47"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"User promoted successfully\"\n}"}],"_postman_id":"4f472b20-9b82-45f2-b98d-83a692c1a187"}],"id":"4cfafa32-004b-4275-b9e3-de548d70169c","description":"<p>This folder contains routes for user releted routes.</p>\n","_postman_id":"4cfafa32-004b-4275-b9e3-de548d70169c"}]}