{"info":{"_postman_id":"39e4624b-5309-47c5-9aa8-4eafc642914f","name":"Task API","description":"<html><head></head><body><p>A basic Node.js RESTful API for managing tasks and getting metrics</p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"3899486","collectionId":"39e4624b-5309-47c5-9aa8-4eafc642914f","publishedId":"2s9YR6ZDZv","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"publishDate":"2023-10-15T08:17:56.000Z"},"item":[{"name":"Creating a Task","id":"850095ea-c7d9-46f9-b5ef-8890b5ba8b7f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"description\": \"Buy groceries\",\n    \"status\": \"OPEN\"\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/api/v1/tasks","description":"<p>This endpoint creates a new <code>Task</code> object in the database. A request body is required as shown below.</p>\n<p>Note: <code>status</code> is optional and can only have <code>OPEN</code> as the value, when not explicitly mentioned, a default value of <code>OPEN</code> is automatically used.</p>\n","urlObject":{"protocol":"http","port":"3000","path":["api","v1","tasks"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"d4474adc-5f3c-43a2-8ac2-4a73e19ca9f0","name":"Creating a Task","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"description\": \"Buy groceries\",\n    \"status\": \"OPEN\"\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/api/v1/tasks"},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"Content-Security-Policy","value":"default-src 'self';base-uri 'self';font-src 'self' https: data:;form-action 'self';frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Cross-Origin-Resource-Policy","value":"same-origin"},{"key":"Origin-Agent-Cluster","value":"?1"},{"key":"Referrer-Policy","value":"no-referrer"},{"key":"Strict-Transport-Security","value":"max-age=15552000; includeSubDomains"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"X-DNS-Prefetch-Control","value":"off"},{"key":"X-Download-Options","value":"noopen"},{"key":"X-Frame-Options","value":"SAMEORIGIN"},{"key":"X-Permitted-Cross-Domain-Policies","value":"none"},{"key":"X-XSS-Protection","value":"0"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"160"},{"key":"ETag","value":"W/\"a0-w5Qjmo5EcWQ7IcfxfLcI4UcV39c\""},{"key":"Vary","value":"Accept-Encoding"},{"key":"Date","value":"Sat, 14 Oct 2023 19:07:30 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"id\": \"clnqethd90003qc10k671yk1j\",\n    \"description\": \"Buy groceries\",\n    \"status\": \"OPEN\",\n    \"created_at\": \"2023-10-14T19:07:30.431Z\",\n    \"updated_at\": \"2023-10-14T19:07:30.431Z\"\n}"}],"_postman_id":"850095ea-c7d9-46f9-b5ef-8890b5ba8b7f"},{"name":"Updating a Task","id":"5da8eaa4-1b10-4304-ba59-9b1c03764183","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\n    \"status\": \"IN_PROGRESS\"\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/api/v1/tasks/clnqethd90003qc10k671yk1j","description":"<p>This endpoint updates a <code>Task</code> object in the database. <code>Task ID</code> should be provided as a URL parameter and a request body is required as shown below.</p>\n<p>Note: Either <code>status</code> or <code>description</code> should be provided in the request body. <code>status</code> can only have values - <code>OPEN</code>, <code>IN_PROGRESS</code>, or <code>COMPLETED</code></p>\n","urlObject":{"protocol":"http","port":"3000","path":["api","v1","tasks","clnqethd90003qc10k671yk1j"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"94dcea12-8992-4e48-9642-6ae31b2b0f88","name":"Updating a Task","originalRequest":{"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\n    \"status\": \"IN_PROGRESS\"\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/api/v1/tasks/clnqethd90003qc10k671yk1j"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Security-Policy","value":"default-src 'self';base-uri 'self';font-src 'self' https: data:;form-action 'self';frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Cross-Origin-Resource-Policy","value":"same-origin"},{"key":"Origin-Agent-Cluster","value":"?1"},{"key":"Referrer-Policy","value":"no-referrer"},{"key":"Strict-Transport-Security","value":"max-age=15552000; includeSubDomains"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"X-DNS-Prefetch-Control","value":"off"},{"key":"X-Download-Options","value":"noopen"},{"key":"X-Frame-Options","value":"SAMEORIGIN"},{"key":"X-Permitted-Cross-Domain-Policies","value":"none"},{"key":"X-XSS-Protection","value":"0"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"167"},{"key":"ETag","value":"W/\"a7-PfH+LqNeWrUVfc6rFNPpPLmHb/g\""},{"key":"Vary","value":"Accept-Encoding"},{"key":"Date","value":"Sat, 14 Oct 2023 19:19:40 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"id\": \"clnqethd90003qc10k671yk1j\",\n    \"description\": \"Buy groceries\",\n    \"status\": \"IN_PROGRESS\",\n    \"created_at\": \"2023-10-14T19:07:30.431Z\",\n    \"updated_at\": \"2023-10-14T19:19:40.179Z\"\n}"}],"_postman_id":"5da8eaa4-1b10-4304-ba59-9b1c03764183"},{"name":"Getting All Tasks","id":"da41a7c8-0ab3-4e2a-bca6-aef563f9d529","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:3000/api/v1/tasks","description":"<p>This endpoint fetches all <code>Task</code> objects in the database. <code>page</code> and <code>limit</code> should be provided as query parameters.</p>\n<p>Note: <code>page</code> and <code>limit</code> are optional and default values of <code>1</code> and <code>10</code> are used respectively when omitted. Also, <code>page</code> can't be negative or zero.</p>\n","urlObject":{"protocol":"http","port":"3000","path":["api","v1","tasks"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"dcdd20fe-cf9e-4f4c-9e90-faf5e9376c9f","name":"Getting All Tasks","originalRequest":{"method":"GET","header":[],"url":{"raw":"http://localhost:3000/api/v1/tasks?page=1&limit=2","protocol":"http","host":["localhost"],"port":"3000","path":["api","v1","tasks"],"query":[{"key":"page","value":"1"},{"key":"limit","value":"2"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Security-Policy","value":"default-src 'self';base-uri 'self';font-src 'self' https: data:;form-action 'self';frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Cross-Origin-Resource-Policy","value":"same-origin"},{"key":"Origin-Agent-Cluster","value":"?1"},{"key":"Referrer-Policy","value":"no-referrer"},{"key":"Strict-Transport-Security","value":"max-age=15552000; includeSubDomains"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"X-DNS-Prefetch-Control","value":"off"},{"key":"X-Download-Options","value":"noopen"},{"key":"X-Frame-Options","value":"SAMEORIGIN"},{"key":"X-Permitted-Cross-Domain-Policies","value":"none"},{"key":"X-XSS-Protection","value":"0"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"352"},{"key":"ETag","value":"W/\"160-P1lK6ujEbTT3+0r224QxPqDt5So\""},{"key":"Vary","value":"Accept-Encoding"},{"key":"Date","value":"Sun, 15 Oct 2023 04:25:22 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"tasks\": [\n        {\n            \"id\": \"clnq9cnk70000qc10dcgq6few\",\n            \"description\": \"Go to the gym\",\n            \"status\": \"OPEN\",\n            \"created_at\": \"2023-10-14T16:34:27.271Z\",\n            \"updated_at\": \"2023-10-14T16:34:27.271Z\"\n        },\n        {\n            \"id\": \"clnqejy2n0001qc1025mfl1kj\",\n            \"description\": \"Buy groceries\",\n            \"status\": \"OPEN\",\n            \"created_at\": \"2023-10-14T19:00:05.523Z\",\n            \"updated_at\": \"2023-10-14T19:00:05.523Z\"\n        }\n    ],\n    \"page\": 1,\n    \"count\": 2\n}"}],"_postman_id":"da41a7c8-0ab3-4e2a-bca6-aef563f9d529"},{"name":"Getting Task Metrics","id":"b3486166-bcb0-447a-93fd-0d5711aae809","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:3000/api/v1/tasks/metrics","description":"<p>This endpoint fetches <code>Task</code> count metrics on the basis of <code>status</code> or <code>timeline</code>. <code>type</code> should be provided as a query parameter.</p>\n<p>Note: <code>type</code> is optional and a default value of <code>count-by-status</code> is used when omitted. <code>type</code> can have values - <code>count-by-status</code>, or <code>count-by-timeline</code></p>\n","urlObject":{"protocol":"http","port":"3000","path":["api","v1","tasks","metrics"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"49061863-8a07-4522-9e15-cddfe38509ab","name":"Count By Status","originalRequest":{"method":"GET","header":[],"url":{"raw":"http://localhost:3000/api/v1/tasks/metrics?type=count-by-status","protocol":"http","host":["localhost"],"port":"3000","path":["api","v1","tasks","metrics"],"query":[{"key":"type","value":"count-by-status"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Security-Policy","value":"default-src 'self';base-uri 'self';font-src 'self' https: data:;form-action 'self';frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Cross-Origin-Resource-Policy","value":"same-origin"},{"key":"Origin-Agent-Cluster","value":"?1"},{"key":"Referrer-Policy","value":"no-referrer"},{"key":"Strict-Transport-Security","value":"max-age=15552000; includeSubDomains"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"X-DNS-Prefetch-Control","value":"off"},{"key":"X-Download-Options","value":"noopen"},{"key":"X-Frame-Options","value":"SAMEORIGIN"},{"key":"X-Permitted-Cross-Domain-Policies","value":"none"},{"key":"X-XSS-Protection","value":"0"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"58"},{"key":"ETag","value":"W/\"3a-Cwc2tr+4NbE9pJu75hn/rjxxZ/Y\""},{"key":"Vary","value":"Accept-Encoding"},{"key":"Date","value":"Sun, 15 Oct 2023 08:08:48 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"in_progress_tasks\": 1,\n    \"open_tasks\": 3,\n    \"completed_tasks\": 0\n}"},{"id":"89e0db8c-ac08-41ea-8e05-766544a7cc13","name":"Count By Timeline","originalRequest":{"method":"GET","header":[],"url":{"raw":"http://localhost:3000/api/v1/tasks/metrics?type=count-by-timeline","protocol":"http","host":["localhost"],"port":"3000","path":["api","v1","tasks","metrics"],"query":[{"key":"type","value":"count-by-timeline"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Security-Policy","value":"default-src 'self';base-uri 'self';font-src 'self' https: data:;form-action 'self';frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests"},{"key":"Cross-Origin-Opener-Policy","value":"same-origin"},{"key":"Cross-Origin-Resource-Policy","value":"same-origin"},{"key":"Origin-Agent-Cluster","value":"?1"},{"key":"Referrer-Policy","value":"no-referrer"},{"key":"Strict-Transport-Security","value":"max-age=15552000; includeSubDomains"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"X-DNS-Prefetch-Control","value":"off"},{"key":"X-Download-Options","value":"noopen"},{"key":"X-Frame-Options","value":"SAMEORIGIN"},{"key":"X-Permitted-Cross-Domain-Policies","value":"none"},{"key":"X-XSS-Protection","value":"0"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"191"},{"key":"ETag","value":"W/\"bf-3l4c2tIgxUtZPJf9GgKV3vy5nyg\""},{"key":"Vary","value":"Accept-Encoding"},{"key":"Date","value":"Sun, 15 Oct 2023 07:09:34 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"[\n    {\n        \"date\": \"September 2023\",\n        \"metrics\": {\n            \"open_tasks\": 0,\n            \"in_progress_tasks\": 0,\n            \"completed_tasks\": 1\n        }\n    },\n    {\n        \"date\": \"October   2023\",\n        \"metrics\": {\n            \"open_tasks\": 3,\n            \"in_progress_tasks\": 1,\n            \"completed_tasks\": 0\n        }\n    }\n]"}],"_postman_id":"b3486166-bcb0-447a-93fd-0d5711aae809"}]}