{"info":{"_postman_id":"875461da-8f60-4391-8707-da09741082ec","name":"SCISSORS","description":"<html><head></head><body><h1 id=\"scissor-url-shortening-system-documentation\">Scissor - URL Shortening System Documentation</h1>\n<h2 id=\"overview\">Overview</h2>\n<p>Scissor is a powerful URL shortening system designed to provide users with the ability to generate short and customized URLs for easy sharing and tracking. It aims to disrupt the URL shortening industry by offering a user-friendly interface, advanced features, and reliable performance.</p>\n<h2 id=\"features\">Features</h2>\n<h3 id=\"url-shortening\">URL Shortening</h3>\n<p>Scissor allows users to shorten long URLs by pasting them into the platform. It automatically generates shortened URLs that are as short as possible, making them convenient for sharing on social media and other channels.</p>\n<h3 id=\"custom-urls\">Custom URLs</h3>\n<p>With Scissor, users can customize their shortened URLs. They have the flexibility to choose their own custom name and personalize the URL to align with their brand or content. This feature is particularly beneficial for individuals and small businesses seeking to create branded links.</p>\n<h3 id=\"qr-code-generation\">QR Code Generation</h3>\n<p>Scissor offers QR code generation for shortened URLs. Users can generate QR codes for their shortened URLs and download the corresponding images. These QR codes can be used in promotional materials, websites, or other marketing channels to enhance user engagement and interaction.</p>\n<h3 id=\"analytics\">Analytics</h3>\n<p>The Analytics feature in Scissor provides users with basic tracking and analytics capabilities. Users can monitor the performance of their shortened URLs, track the number of clicks received, and identify the sources from which the clicks originate. This data helps users gain insights into the effectiveness of their shared links and make informed decisions for optimizing their strategies.</p>\n<h3 id=\"link-history\">Link History</h3>\n<p>Scissor maintains a comprehensive link history for each user. This feature allows users to easily access and reuse previously created shortened URLs. Users can search, sort, and filter their link history to efficiently manage their URLs and track their usage over time.</p>\n<h2 id=\"technologies-used\">Technologies Used</h2>\n<ul>\n<li>Node.js: The backend of Scissor is built using Node.js, providing a scalable and efficient server-side framework.</li>\n<li>Express.js: Express.js is used as the web application framework to handle routing and middleware functionalities.</li>\n<li>MongoDB: Scissor utilizes MongoDB as the database for storing user data, shortened URLs, and analytics information.</li>\n<li>React: The frontend of Scissor is built using React, enabling a dynamic and responsive user interface.</li>\n<li>QR Code Generator API: A third-party QR code generator API is integrated to facilitate the generation of QR codes for shortened URLs.</li>\n</ul>\n<h2 id=\"installation-and-setup\">Installation and Setup</h2>\n<p>For detailed installation and setup instructions, please refer to the <a href=\"/docs/installation.md\">Installation Guide</a> provided in the documentation.</p>\n<h2 id=\"usage\">Usage</h2>\n<p>The Scissor documentation provides comprehensive instructions on how to use the platform effectively. It covers topics such as URL shortening, custom URLs, QR code generation, analytics tracking, and managing link history.</p>\n<h2 id=\"contributions-and-support\">Contributions and Support</h2>\n<p>Scissor welcomes contributions from the developer community. If you encounter any issues, have suggestions, or would like to contribute, please reach out.</p>\n<p>For any support or inquiries regarding Scissor, please reach out to me on <a href=\"https://github.com/hi-heavens\">GitHub</a>.</p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[{"content":"Scissor - URL Shortening System Documentation","slug":"scissor-url-shortening-system-documentation"}],"owner":"22961306","collectionId":"875461da-8f60-4391-8707-da09741082ec","publishedId":"2s93z3h6mE","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"publishDate":"2023-06-21T15:33:38.000Z"},"item":[{"name":"New User Sign Up","id":"c675b595-621f-499c-a45d-bef74b442668","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"user_name\": \"kenhigh07\",\r\n    \"email\": \"ken@email.com\",\r\n    \"password\": \"Abc-1234\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{URL}}api/v1/users/signup","description":"<h1 id=\"user-signup\">User Signup</h1>\n<p>This endpoint allows users to register and create an account. A POST request to <code>/api/v1/users/signup</code> with the required user information will create a new user and return a response with the registration status, authentication token, and user data.</p>\n<h3 id=\"request\">Request</h3>\n<ul>\n<li>Method: POST</li>\n<li>Endpoint: <code>/api/v1/users/signup</code></li>\n<li><code>user_name</code> (string): The desired username for the user.</li>\n<li><code>email</code> (string): The email address of the user.</li>\n<li><code>password</code> (string): The password for the user account.</li>\n</ul>\n<h3 id=\"response\">Response</h3>\n<p>Upon successful user registration, the endpoint will respond duly.</p>\n<ul>\n<li><code>status</code> (string): Indicates the status of the user registration (\"successfully registered\").</li>\n<li><code>token</code> (string): The authentication token generated for the user session.</li>\n<li><code>data</code> (object): Contains the user data associated with the newly registered user.<ul>\n<li><code>userId</code> (string): The unique identifier of the user.</li>\n<li><code>userName</code> (string): The username provided during registration.</li>\n<li><code>email</code> (string): The email address associated with the user.</li>\n</ul>\n</li>\n</ul>\n","urlObject":{"path":["v1","users","signup"],"host":["{{URL}}api"],"query":[],"variable":[]}},"response":[{"id":"23553b9a-97ac-4fde-a4bc-770429cc1e0e","name":"Successful User Signup","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"user_name\": \"kenhigh07\",\r\n    \"email\": \"ken@email.com\",\r\n    \"password\": \"Abc-1234\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{URL}}api/v1/users/signup"},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"310"},{"key":"ETag","value":"W/\"136-XqjF6VHaIRM8g7xIjpEaYAlj4iA\""},{"key":"Vary","value":"Accept-Encoding"},{"key":"Date","value":"Wed, 21 Jun 2023 16:00:03 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": \"successfully registered\",\n    \"token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY0OTMxZTgyM2ExZWY2NWI5MmJhOTMwMCIsImlhdCI6MTY4NzM2MzIwMywiZXhwIjoxNjg3MzY2ODAzfQ.9FBXJl0H9qLOOV1MoDljMEZ0oUUfFmAhFm0dVBrREYE\",\n    \"data\": {\n        \"userId\": \"64931e823a1ef65b92ba9300\",\n        \"userName\": \"kenhigh07\",\n        \"email\": \"ken@email.com\"\n    }\n}"},{"id":"43b3406b-aa2f-4acc-a628-b157cc8678d2","name":"When a signup field is missing","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"user_name\": \"kenhigh07\",\r\n    \"email\": \"ken@email.com\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{URL}}api/v1/users/signup"},"status":"Unauthorized","code":401,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"84"},{"key":"ETag","value":"W/\"54-tWaxAi0oEWtj8So8gAGq6Fde4aU\""},{"key":"Vary","value":"Accept-Encoding"},{"key":"Date","value":"Wed, 21 Jun 2023 16:06:24 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": \"failed\",\n    \"message\": \"Kindly reconfirm registration details and try again.\"\n}"},{"id":"80334740-9940-4950-aec6-20c0ba60fe96","name":"If an input is incorrect","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"user_name\": \"kenhigh07\",\r\n    \"email\": \"ken@emailcom\",\r\n    \"password\": \"Abc-1234\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{URL}}api/v1/users/signup"},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"88"},{"key":"ETag","value":"W/\"58-rh/Bbt7kr7WD+ro12FXciqt/ijU\""},{"key":"Vary","value":"Accept-Encoding"},{"key":"Date","value":"Wed, 21 Jun 2023 16:21:06 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": \"failed\",\n    \"message\": \"Invalid input data. Please provide a valid email address\"\n}"}],"_postman_id":"c675b595-621f-499c-a45d-bef74b442668"},{"name":"User Login","event":[{"listen":"test","script":{"id":"f2e10fbf-e764-43ea-a5e0-0bd8261a3878","exec":["pm.environment.set(\"jwt\", pm.response.json().token);"],"type":"text/javascript"}}],"id":"e8eacf40-73e5-4f96-8a6e-30049bf971b8","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"loginInput\": \"ken@email.com\",\r\n    \"password\": \"Abc-1234\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{URL}}api/v1/users/login","description":"<h1 id=\"user-login\">User Login</h1>\n<p>This endpoint allows users to log in to their existing accounts. A POST request to <code>/api/v1/users/login</code> with the required login credentials will authenticate the user and return a response with the login status, authentication token, and user data.</p>\n<h3 id=\"request\">Request</h3>\n<ul>\n<li><p>Method: POST</p>\n</li>\n<li><p>Endpoint: <code>/api/v1/users/login</code></p>\n</li>\n<li><p><code>loginInput</code> (string): The username or registered email of the user.</p>\n</li>\n<li><p><code>password</code> (string): The password for the user account.</p>\n</li>\n</ul>\n<h3 id=\"response\">Response</h3>\n<p>Upon successful user login, the endpoint will respond with the following:</p>\n<ul>\n<li><code>status</code> (string): Indicates the status of the login process (\"login success\").</li>\n<li><code>token</code> (string): The authentication token generated for the user session.</li>\n<li><code>data</code> (object): Contains the user data associated with the logged-in user.<ul>\n<li><code>userId</code> (string): The unique identifier of the user.</li>\n<li><code>userName</code> (string): The username of the user.</li>\n<li><code>email</code> (string): The email address associated with the user.</li>\n</ul>\n</li>\n</ul>\n<h3 id=\"sample-request\">Sample Request</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>httpCopy codePOST /api/v1/users/login HTTP/1.1\nHost: example.com\nContent-Type: application/json\n\n{\n    \"loginInput\": \"ken@email.com\",\n    \"password\": \"Abc-1234\"\n}\n\n</code></pre><h3 id=\"sample-response\">Sample Response</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>cssCopy codeHTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n    \"status\": \"login success\",\n    \"token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY0OTMxZTgyM2ExZWY2NWI5MmJhOTMwMCIsImlhdCI6MTY4NzUyMDc4MywiZXhwIjoxNjg3NTI0MzgzfQ.co88CFK2-HD2ZVPQpq_ptPkB697H_h2BAZ_nzAkfabY\",\n    \"data\": {\n        \"userId\": \"64931e823a1ef65b92ba9300\",\n        \"userName\": \"kenhigh07\",\n        \"email\": \"ken@email.com\"\n    }\n}\n\n</code></pre><p><strong>Note:</strong> Replace <code>example.com</code> with the</p>\n<p>EndFragment</p>\n","urlObject":{"path":["v1","users","login"],"host":["{{URL}}api"],"query":[],"variable":[]}},"response":[{"id":"a41a1757-47cf-4dc4-8a6d-6193e6dcd852","name":"Successful User Login","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"loginInput\": \"kenhigh07\",\r\n    \"password\": \"Abc-1234\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{URL}}api/v1/users/login"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"300"},{"key":"ETag","value":"W/\"12c-OjVxpEkAQlVwlrAHhMvq4ahoX5g\""},{"key":"Vary","value":"Accept-Encoding"},{"key":"Date","value":"Wed, 21 Jun 2023 16:28:08 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": \"login success\",\n    \"token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY0OTMxZTgyM2ExZWY2NWI5MmJhOTMwMCIsImlhdCI6MTY4NzM2NDg4OCwiZXhwIjoxNjg3MzY4NDg4fQ.UBh02wLK0l_ty6pErv9NigOYJ6Vbiik1Hn410Nt40NQ\",\n    \"data\": {\n        \"userId\": \"64931e823a1ef65b92ba9300\",\n        \"userName\": \"kenhigh07\",\n        \"email\": \"ken@email.com\"\n    }\n}"},{"id":"83359d91-6ab6-475f-928c-8fcc37680e3a","name":"Login with email","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"loginInput\": \"ken@email.com\",\r\n    \"password\": \"Abc-1234\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{URL}}api/v1/users/login"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"300"},{"key":"ETag","value":"W/\"12c-xw2x9GRtASdov7OLYGcSiuI/zAM\""},{"key":"Vary","value":"Accept-Encoding"},{"key":"Date","value":"Wed, 21 Jun 2023 16:29:04 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": \"login success\",\n    \"token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY0OTMxZTgyM2ExZWY2NWI5MmJhOTMwMCIsImlhdCI6MTY4NzM2NDk0NCwiZXhwIjoxNjg3MzY4NTQ0fQ.JOLepfGywTv--kjESVqfL2EOQLQIhG_7E2vhWxDz8dU\",\n    \"data\": {\n        \"userId\": \"64931e823a1ef65b92ba9300\",\n        \"userName\": \"kenhigh07\",\n        \"email\": \"ken@email.com\"\n    }\n}"},{"id":"321984df-33d9-4fa7-9ca6-e73379841747","name":"Wrong User Details to Login","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"loginInput\": \"ken@email.com\",\r\n    \"password\": \"Abc-123\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{URL}}api/v1/users/login"},"status":"Unauthorized","code":401,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"72"},{"key":"ETag","value":"W/\"48-vWAaPRguXhETP+GAzGYrmzvxgsk\""},{"key":"Vary","value":"Accept-Encoding"},{"key":"Date","value":"Wed, 21 Jun 2023 16:34:15 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": \"failed\",\n    \"message\": \"Incorrect username/email and/or password\"\n}"}],"_postman_id":"e8eacf40-73e5-4f96-8a6e-30049bf971b8"},{"name":"Generate a QRCode","event":[{"listen":"test","script":{"id":"86e0676f-156d-4414-ac9f-623313661ae4","exec":[""],"type":"text/javascript"}}],"id":"bb96ba8c-77c7-4fb4-bcbe-459f53ba55af","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{jwt}}"}]},"isInherited":false},"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"message\": \"https://www.youtube.com/watch?v=rKyUA_nsCXA\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{URL}}api/v1/qrcode","description":"<h1 id=\"qr-code-generation\">QR Code Generation</h1>\n<p>This endpoint allows only authenticated users to generate a QR code for a given message or URL. A POST request to <code>/api/v1/qrcode</code> with the appropriate authorization token and request body generates the QR code and returns it as a response.</p>\n<h3 id=\"request\">Request</h3>\n<ul>\n<li>Method: POST</li>\n<li>Endpoint: <code>/api/v1/qrcode</code></li>\n<li>Authentication: User authentication is required.</li>\n</ul>\n<h3 id=\"response\">Response</h3>\n<p>Upon successful generation of the QR code, the endpoint will respond with the generated QR code image. The response will include the appropriate content type for the image.</p>\n<h3 id=\"authentication\">Authentication</h3>\n<p>User authentication is required to access this endpoint. Ensure that the request includes the necessary authentication token in the request headers.</p>\n<h3 id=\"sample-response\">Sample Response</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>HTTP/1.1 200 OK\nContent-Type: image/png\nContent-Disposition: attachment; filename=\"qrcode.png\"\n\n</code></pre>","urlObject":{"path":["v1","qrcode"],"host":["{{URL}}api"],"query":[],"variable":[]}},"response":[{"id":"c17135d9-da62-4792-821c-6e68ddc4b037","name":"Invalid QRCode Request","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"message\": \"\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{URL}}api/v1/qrcode"},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"69"},{"key":"ETag","value":"W/\"45-rgpLTTXejU5bOs61MXiWrtJXA0s\""},{"key":"Vary","value":"Accept-Encoding"},{"key":"Date","value":"Wed, 21 Jun 2023 17:02:18 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": \"failed\",\n    \"message\": \"Please provide a message/link to code\"\n}"}],"_postman_id":"bb96ba8c-77c7-4fb4-bcbe-459f53ba55af"},{"name":"Create Short Link","id":"3452b1ae-ac4f-4cc1-8fe6-4523546712c2","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{jwt}}"}]},"isInherited":false},"method":"POST","header":[{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY0OTMxZTgyM2ExZWY2NWI5MmJhOTMwMCIsImlhdCI6MTY4NzUwNjg0NSwiZXhwIjoxNjg3NTEwNDQ1fQ.BcqvC4IjT1Afos0lVMw-lz5u4Bi8Dt6gYsDKqsZq8dM","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"url\": \"https://www.udemy.com/course/understanding-typescript/\",\r\n    \"custom\": \"Udemy TS\",\r\n    \"name\": \"TS\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{URL}}api/v1/shortener","description":"<h1 id=\"shortener\">Shortener</h1>\n<p>This endpoint allows users to shorten a given URL by making a POST request to <code>api/v1/shortener</code>. The <code>url</code> parameter is required and should contain the original URL that needs to be shortened. The server will generate a unique shortened URL for the provided long URL.</p>\n<p>Optionally, users can include the <code>custom</code> parameter to specify a custom alias or keyword for the shortened URL. If the custom alias is available and not already taken by another user, it will be assigned to the shortened URL.</p>\n<p>Note that the <code>newLink</code> will be a combination of the Scissor domain and the custom alias (if provided), resulting in a unique and easy-to-share URL.</p>\n<p>If the request is successful, a <code>200 OK</code> response will be returned along with the new URL information in the response body.</p>\n<p>If there is an error or validation issue, an appropriate error response will be returned with details about the encountered issue.</p>\n<h2 id=\"parameters\">Parameters</h2>\n<ul>\n<li><code>url</code> (required): The original URL that needs to be shortened.</li>\n<li><code>custom</code> (optional): An optional custom alias or keyword to personalize the shortened URL.</li>\n<li><code>name</code> (optional): An optional name for the shortened URL.</li>\n</ul>\n<h2 id=\"rate-limiting\">Rate Limiting</h2>\n<p>This endpoint is subject to rate limiting to prevent abuse and ensure fair usage. The specific rate limit values and behavior are defined by the server configuration.</p>\n<h2 id=\"authentication\">Authentication</h2>\n<p>Authentication is required for this endpoint. Only egistered users can access the URL shortening functionality.</p>\n","urlObject":{"path":["v1","shortener"],"host":["{{URL}}api"],"query":[],"variable":[]}},"response":[{"id":"098cc8c2-ba5f-4e19-9bbc-ebd30d3407c1","name":"Create Short Link","originalRequest":{"method":"POST","header":[{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY0OTMxZTgyM2ExZWY2NWI5MmJhOTMwMCIsImlhdCI6MTY4NzUwNjg0NSwiZXhwIjoxNjg3NTEwNDQ1fQ.BcqvC4IjT1Afos0lVMw-lz5u4Bi8Dt6gYsDKqsZq8dM","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"url\": \"https://math.hws.edu/javanotes/c4/s6.html\",\r\n    \"custom\": \"Javadoc\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{URL}}api/v1/shortener"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"62"},{"key":"ETag","value":"W/\"3e-v9p7EoJaNaCAUPnngdKR/sdBypA\""},{"key":"Vary","value":"Accept-Encoding"},{"key":"Date","value":"Fri, 23 Jun 2023 07:55:57 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": \"success\",\n    \"newLink\": \"http://127.0.0.1:3000/Javadoc\"\n}"}],"_postman_id":"3452b1ae-ac4f-4cc1-8fe6-4523546712c2"},{"name":"Get Original Link","id":"ac4465cd-73e0-4f9e-99df-b5a50933175f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"{{URL}}Javadoc/","description":"<h1 id=\"redirection-endpoint\">Redirection Endpoint</h1>\n<h3 id=\"description\">Description:</h3>\n<p>This endpoint is designed to handle redirection requests for the shortened URL with the custom alias, for instance, \"Javadoc\". When a user accesses the URL <code>{{URL}}/Javadoc</code>, the server will redirect them to the original long URL associated with the custom alias.</p>\n<h3 id=\"behavior\">Behavior:</h3>\n<ol>\n<li>When a GET request is made to <code>{{{URL}}}/Javadoc</code>, the server will look up the custom alias \"Javadoc\" in the database to retrieve the corresponding original URL.</li>\n<li>If a match is found, the server will respond with a redirect status code (typically 302) and set the <code>Location</code> header to the original long URL.</li>\n<li>The user's browser will automatically follow the redirection and make a subsequent request to the original URL, ultimately loading the content associated with the shortened URL.</li>\n</ol>\n<h3 id=\"use-case\">Use Case:</h3>\n<p>This redirection endpoint is useful for seamlessly directing users from the shortened URL (e.g., <code>{{URL}}/Javadoc</code>) back to the original long URL (e.g., <code>https://math.hws.edu/javanotes/c4/s6.html</code>). It allows users to access the desired content without manually typing the long URL.</p>\n","urlObject":{"path":[""],"host":["{{URL}}Javadoc"],"query":[],"variable":[]}},"response":[],"_postman_id":"ac4465cd-73e0-4f9e-99df-b5a50933175f"},{"name":"Get User Dashboard Details","id":"df20a3cf-4e50-48a9-805d-1d4812b0177d","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{jwt}}"}]},"isInherited":false},"method":"GET","header":[],"url":"{{URL}}api/v1/dashboard","description":"<h1 id=\"user-dashboard\">User Dashboard</h1>\n<p><strong>Description:</strong><br />This endpoint allows users to retrieve the dashboard information, which includes a list of shortened URLs with their associated details. A GET request to <code>/api/v1/dashboard</code> returns the dashboard data as a response.</p>\n<h3 id=\"request\">Request:</h3>\n<ul>\n<li>Method: GET</li>\n<li>Endpoint: <code>/api/v1/dashboard</code></li>\n</ul>\n<h3 id=\"response-attributes\">Response Attributes:</h3>\n<ul>\n<li><code>status</code> (string): Indicates the status of the response (\"success\" or \"error\").</li>\n<li><code>message</code> (array): Contains an array of objects representing each shortened URL entry in the dashboard.<ul>\n<li><code>clicks</code> (number): Represents the number of clicks the shortened URL has received.</li>\n<li><code>url</code> (string): The original URL that was shortened.</li>\n<li><code>name</code> (string): The custom name or domain associated with the shortened URL.</li>\n<li><code>newLink</code> (string): The shortened URL that redirects to the original URL.</li>\n<li><code>userId</code> (string): The unique identifier of the user who created the shortened URL.</li>\n</ul>\n</li>\n</ul>\n<h2 id=\"authentication\">Authentication</h2>\n<p>Authentication is required for this endpoint. Only egistered users can access the URL shortening functionality.</p>\n","urlObject":{"path":["v1","dashboard"],"host":["{{URL}}api"],"query":[],"variable":[]}},"response":[{"id":"41d78e0f-31c4-44a4-8824-892c79f47eb0","name":"User dashboard details","originalRequest":{"method":"GET","header":[],"url":"{{URL}}api/v1/dashboard"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"494"},{"key":"ETag","value":"W/\"1ee-1jyskqxYwJ8JCAwwzlxY5fZlPpk\""},{"key":"Vary","value":"Accept-Encoding"},{"key":"Date","value":"Fri, 23 Jun 2023 11:15:59 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": \"success\",\n    \"message\": [\n        {\n            \"clicks\": 0,\n            \"url\": \"https://math.hws.edu/javanotes/c4/s6.html\",\n            \"name\": \"math.hws.edu\",\n            \"newLink\": \"http://127.0.0.1:3000/Javadoc\",\n            \"userId\": \"64931e823a1ef65b92ba9300\"\n        },\n        {\n            \"clicks\": 0,\n            \"url\": \"https://math.hws.edu/javanotes/c4/s6.html\",\n            \"name\": \"JJ\",\n            \"newLink\": \"http://127.0.0.1:3000/Javadocument\",\n            \"userId\": \"64931e823a1ef65b92ba9300\"\n        },\n        {\n            \"url\": \"https://devcareer.io/\",\n            \"name\": \"devcareer.io\",\n            \"newLink\": \"http://127.0.0.1:3000/devvy\",\n            \"userId\": \"64931e823a1ef65b92ba9300\",\n            \"clicks\": 1\n        }\n    ]\n}"}],"_postman_id":"df20a3cf-4e50-48a9-805d-1d4812b0177d"}]}