{"info":{"_postman_id":"f90fe473-bbec-466a-adaa-8e8c88ec04a6","name":"ChatSphere","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"description":"<html><head></head><body></body></html>","owner":"32763635","collectionId":"f90fe473-bbec-466a-adaa-8e8c88ec04a6","publishedId":"2sA35MzzRV","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"publishDate":"2024-04-08T23:50:46.000Z"},"item":[{"name":"Friend Management","item":[{"name":"Send Friend Request","id":"044c61ba-da15-4338-a491-dd8a7f83190c","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"POST","header":[],"body":{"mode":"raw","raw":"","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/api/v1/users/muhammad@gmail.com/send/mazen@gmail.com","description":"<p><strong>This request sends a friend request to the user with the specified ID provided in the URL request.</strong></p>\n<p>Parameters:</p>\n<ul>\n<li>sender_email: The email of the friend who will send the request</li>\n<li>receiver_email: The email of the friend who will receive the request</li>\n</ul>\n<p>Method: POST</p>\n<p>Headers:</p>\n<ul>\n<li>Content-Type: application/json</li>\n</ul>\n<p>Response:</p>\n<ul>\n<li>200 OK: Friend request sent successfully.</li>\n<li>400 Bad Request: Invalid input or missing required fields.</li>\n<li>404 Not Found: User with the specified ID not found.</li>\n<li>500 Internal Server Error: Server encountered an unexpected condition.</li>\n</ul>\n<p>Response Example for 200 OK:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"body\": null,\n    \"message\": \"Friend request sent successfully.\",\n    \"status\": 200\n}\n\n</code></pre>\n<p>Response Example for 404 Not Found:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"body\": null,\n    \"message\": \"User with email 'example@mail.com' not found.\",\n    \"status\": 404\n}\n\n</code></pre>\n<p>Response Example for 500 Internal Server Error:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"body\": null,\n    \"message\": \"Internal Server Error. Please try again later.\",\n    \"status\": 500\n}\n\n</code></pre>\n<p>These examples illustrate the possible responses when sending a friend request to a user with a specified ID.</p>\n","urlObject":{"protocol":"http","port":"3000","path":["api","v1","users","muhammad@gmail.com","send","mazen@gmail.com"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"044c61ba-da15-4338-a491-dd8a7f83190c"},{"name":"Respond to friend request","id":"e48a33f9-b1ed-4b32-8e2e-304ab8320391","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"status\": \"ACCEPTED\"\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/api/v1/users/mo'men@mail.com/response/mohanad@mail.com","description":"<p><strong>This request allows the user to respond to a friend request with either acceptance or rejection.</strong></p>\n<p>Parameters:</p>\n<ul>\n<li><p>sender_email: The email of the friend who will respond to the request</p>\n</li>\n<li><p>receiver_email: The email of the friend request being responded to.</p>\n</li>\n<li><p>status: The response to the friend request, either \"accept\" or \"reject\". [ REQUEST BODY ]</p>\n</li>\n</ul>\n<p>Method: POST</p>\n<p>Headers:</p>\n<ul>\n<li>Content-Type: application/json</li>\n</ul>\n<p>Body (JSON):</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"status\": \"ACCEPTED\"\n}\n\n</code></pre>\n<p>Response:</p>\n<ul>\n<li>200 OK: Friend request response recorded successfully.</li>\n<li>400 Bad Request: Invalid input or missing required fields.</li>\n<li>404 Not Found: Friend request with the specified ID not found.</li>\n<li>500 Internal Server Error: Server encountered an unexpected condition.</li>\n</ul>\n<p>Example:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>POST /respond-to-friend-request/789\n{\n    \"status\": \"ACCEPTED/REJECTED\"\n}\n\n</code></pre><p>Response Example for 200 OK:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"body\": null,\n    \"message\": \"Friend request accepted!/Friend request rejected!\",\n    \"status\": 200\n}\n\n</code></pre>\n<p>Response Example for 404 Not Found:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"body\": null,\n    \"message\": \"Friend request with email 'example@mail.com' not found.\",\n    \"status\": 404\n}\n\n</code></pre>\n<p>Response Example for 500 Internal Server Error:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"body\": null,\n    \"message\": \"Internal Server Error. Please try again later.\",\n    \"status\": 500\n}\n\n</code></pre>\n<p>These examples demonstrate the possible responses when responding to a friend request with acceptance or rejection.</p>\n","urlObject":{"protocol":"http","port":"3000","path":["api","v1","users","mo'men@mail.com","response","mohanad@mail.com"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"e48a33f9-b1ed-4b32-8e2e-304ab8320391"},{"name":"Get all friends","id":"a339b0b4-d336-4b39-89b6-5d53fd8c0c2a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"GET","header":[],"url":"http://localhost:3000/api/v1/users/nour@gmail.com/friends","description":"<p>Description:<br /><strong>This request retrieves all the friends of a user.</strong></p>\n<p>Parameters:</p>\n<ul>\n<li>email: The email of the user whose friends are being retrieved.</li>\n</ul>\n<p>Method: GET</p>\n<p>Response:</p>\n<ul>\n<li>200 OK: Successfully retrieved user's friends.</li>\n<li>400 Bad Request: Invalid input or missing required fields.</li>\n<li>404 Not Found: User with the specified ID not found or user has no friends.</li>\n<li>500 Internal Server Error: Server encountered an unexpected condition.</li>\n</ul>\n<p>Example:</p>\n<p>Response Example for 200 OK:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"body\": [\n        {\n            \"id\": 456,\n            \"username\": \"Jane\",\n            \"email\": \"jane@example.com\"\n        },\n        {\n            \"id\": 789,\n            \"username\": \"Tom\",\n            \"email\": \"tom@example.com\"\n        }\n    ],\n    \"message\": \"User's friends retrieved successfully.\",\n    \"status\": 200\n}\n\n</code></pre>\n<p>Response Example for 404 Not Found:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"body\": null,\n    \"message\": \"User with email 'sender@example.com' not found.\",\n    \"status\": 404\n}\n\n</code></pre>\n<p>Response Example for 500 Internal Server Error:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"body\": null,\n    \"message\": \"Internal Server Error. Please try again later.\",\n    \"status\": 500\n}\n\n</code></pre>\n<p>These examples illustrate the possible responses when retrieving all the friends of a user.</p>\n","urlObject":{"protocol":"http","port":"3000","path":["api","v1","users","nour@gmail.com","friends"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"a339b0b4-d336-4b39-89b6-5d53fd8c0c2a"},{"name":"Unfriend User","id":"721ab55a-2b22-4006-93c6-14c7725e9be3","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"PATCH","header":[],"url":"http://localhost:3000/api/v1/users/mohanad@mail.com/unfriend/mo'men@mail.com","description":"<p><strong>This request unfriends a friend associated with the user's email.</strong></p>\n<p>Parameters:</p>\n<ul>\n<li><strong>email</strong>: The email address of the user who wants to unfriend someone.</li>\n<li><strong>friendEmail</strong>: The email address of the friend to be unfriended.</li>\n</ul>\n<p>Method: DELETE</p>\n<p>Response:</p>\n<ul>\n<li><p>200 OK: Successfully unfriended the friend.</p>\n</li>\n<li><p>400 Bad Request: Invalid input or missing required fields.</p>\n</li>\n<li><p>404 Not Found: User or friend not found, or they are not friends.</p>\n</li>\n<li><p>500 Internal Server Error: Server encountered an unexpected condition.</p>\n</li>\n</ul>\n<p>Response Example for 200 OK:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"body\": null,\n    \"message\": \"Successfully unfriended.\",\n    \"status\": 200\n}\n\n</code></pre>\n<p>Response Example for 404 Not Found:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"body\": null,\n    \"message\": \"User 'bishoy@mail.com' or friend 'maz@mail.com' not found, or they are not friends.\",\n    \"status\": 404\n}\n\n</code></pre>\n<p>Response Example for 500 Internal Server Error:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"body\": null,\n    \"message\": \"Internal Server Error. Please try again later.\",\n    \"status\": 500\n}\n\n</code></pre>\n","urlObject":{"protocol":"http","port":"3000","path":["api","v1","users","mohanad@mail.com","unfriend","mo'men@mail.com"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"721ab55a-2b22-4006-93c6-14c7725e9be3"},{"name":"Cancel friend request","id":"06a634ed-c348-4a9e-a50c-fd84d03f0eec","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"PATCH","header":[],"url":"http://localhost:3000/api/v1/users/mazen@mail.com/cancel-friend-request/mohanad@mail.com","description":"<h4 id=\"this-api-cancels-a-friend-request-if-it-has-not-been-approved-or-rejected-yet\">This API cancels a friend request if it has not been approved or rejected yet.</h4>\n<p>API Description:</p>\n<p>This API cancels a friend request if it has not been approved or rejected yet.</p>\n<p>Endpoint:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>bashCopy codeDELETE http://localhost:3000/api/v1/users/{userEmail}/cancel-friend-request/{friendEmail}\n\n</code></pre><p>Parameters:</p>\n<ul>\n<li>userEmail (path parameter): The email address of the user who initiated the friend request.</li>\n<li>friendEmail (path parameter): The email address of the friend for whom the request is to be canceled.</li>\n</ul>\n<p>Method: DELETE</p>\n<p>Response:</p>\n<ul>\n<li>200 OK: Successfully canceled the friend request.</li>\n<li>400 Bad Request: Invalid input or missing required fields.</li>\n<li>404 Not Found: User or friend not found, or there is no pending friend request.</li>\n<li>500 Internal Server Error: Server encountered an unexpected condition.</li>\n</ul>\n<p>Response Example for 200 OK:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"body\": null,\n    \"message\": \"Friend request canceled successfully.\",\n    \"status\": 200\n}\n\n</code></pre>\n<p>Response Example for 404 Not Found:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"body\": null,\n    \"message\": \"User 'mazen@mail.com' or friend 'bishoy@mail.com' not found, or there is no pending friend request.\",\n    \"status\": 404\n}\n\n</code></pre>\n<p>Response Example for 500 Internal Server Error:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"body\": null,\n    \"message\": \"Internal Server Error. Please try again later.\",\n    \"status\": 500\n}\n\n</code></pre>\n","urlObject":{"protocol":"http","port":"3000","path":["api","v1","users","mazen@mail.com","cancel-friend-request","mohanad@mail.com"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"06a634ed-c348-4a9e-a50c-fd84d03f0eec"},{"name":"Get all friend requests","id":"67c0d46b-269f-4336-83f4-12c06ace457a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"GET","header":[],"url":"http://localhost:3000/api/v1/users/mazen@gmail.com/friend-requests","description":"<h3 id=\"get-all-friend-requests\">Get All Friend Requests</h3>\n<p><a href=\"http://localhost:3000/api/v1/users/%7Bemail%7D/friend-requests\">http://localhost:3000/api/v1/users/{email}/friend-requests</a></p>\n<h4 id=\"description\">Description</h4>\n<p>Retrieves all friend requests associated with the user's email.</p>\n<p>Parameters</p>\n<ul>\n<li><strong>email</strong>: The email address of the user for whom friend requests are being retrieved.</li>\n</ul>\n<h4 id=\"responses\">Responses</h4>\n<ul>\n<li><strong>200 OK</strong>: Successfully retrieved friend requests.</li>\n<li><strong>400 Bad Request</strong>: Invalid input or missing required fields.</li>\n<li><strong>404 Not Found</strong>: User not found.</li>\n<li><strong>500 Internal Server Error</strong>: Server encountered an unexpected condition.</li>\n</ul>\n<h4 id=\"response-examples\">Response Examples</h4>\n<h5 id=\"200-ok\">200 OK</h5>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"message\": \"Friend requests retreived succesfully!\",\n    \"status\": 200,\n    \"body\": [\n        {\n            \"email\": \"mohanad@mail.com\",\n            \"username\": \"test\"\n        }\n    ]\n}\n\n</code></pre>\n<h5 id=\"404-not-found\">404 Not Found</h5>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"body\": null,\n    \"message\": \"User 'mohanad@mail.com' not found.\",\n    \"status\": 404\n}\n\n</code></pre>\n<h5 id=\"500-internal-server-error\">500 Internal Server Error</h5>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"body\": null,\n    \"message\": \"Internal Server Error. Please try again later.\",\n    \"status\": 500\n}\n\n</code></pre>\n","urlObject":{"protocol":"http","port":"3000","path":["api","v1","users","mazen@gmail.com","friend-requests"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"67c0d46b-269f-4336-83f4-12c06ace457a"}],"id":"2859f440-d069-4cbc-a444-d52c1117b6ba","_postman_id":"2859f440-d069-4cbc-a444-d52c1117b6ba","description":""},{"name":"Authentication","item":[{"name":"Register new user","id":"94a020a5-1634-4c4d-8cfc-e0621b84d383","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"formdata","formdata":[{"key":"username","value":"Bishoy","type":"text","uuid":"ff9f7c18-23b0-4657-9298-bb8f5b6dab15"},{"key":"email","value":"bishosedra0@gmail.com","type":"text","uuid":"05121295-6e12-4269-88a3-049a49bad0c8"},{"key":"password","value":"Password@123","type":"text","uuid":"f5ea1f68-8dcc-46b1-92c4-2193a4fc27d4"}]},"url":"http://localhost:3000/api/v1/auth/register","description":"<p><strong>This request allows users to create new accounts by providing essential information, including a username, email address, and password.</strong></p>\n<p>Parameters:</p>\n<ul>\n<li><strong>username</strong>: The desired username for the new account.</li>\n<li><strong>email</strong>: The email address associated with the new account.</li>\n<li><strong>password</strong>: The chosen password for the new account.</li>\n</ul>\n<p>Method: POST</p>\n<p>Headers:</p>\n<ul>\n<li>Content-Type: application/json</li>\n</ul>\n<p>Response:</p>\n<ul>\n<li>201 OK: Account successfully created.</li>\n<li>400 Bad Request: Invalid input or missing required fields.</li>\n<li>409 Conflict: Account with the provided email or username already exists.</li>\n<li>500 Internal Server Error: Server encountered an unexpected condition.</li>\n</ul>\n","urlObject":{"protocol":"http","port":"3000","path":["api","v1","auth","register"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"94a020a5-1634-4c4d-8cfc-e0621b84d383"},{"name":"Login","event":[{"listen":"test","script":{"id":"370c6657-9c3a-4c99-9819-76355f811aaa","exec":["// Parse the token from the response\r","let token = pm.response.json().body;\r","\r","\r","// Save it to an environment variable\r","if(token){\r","    pm.environment.set(\"auth_token\", token);\r","}\r",""],"type":"text/javascript","packages":{}}}],"id":"1cf2f8db-f930-494c-905b-d7ee5a3033b0","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"email\": \"bishosedra0@gmail.com\",\r\n    \"password\": \"Bishoy@123\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{base}}/auth/login","description":"<p><strong>This request enables users to log in to their accounts by providing essential information, including their email address and password.</strong></p>\n<p>Parameters:</p>\n<ul>\n<li><strong>email</strong>: The email address associated with the user's account.</li>\n<li><strong>password</strong>: The password for the user's account.</li>\n</ul>\n<p>Method: POST</p>\n<p>Headers:</p>\n<ul>\n<li>Content-Type: application/json</li>\n</ul>\n<p>Response:</p>\n<ul>\n<li><p>200 OK: Successful login. Returns authentication token.</p>\n</li>\n<li><p>400 Bad Request: Invalid input or missing required fields.</p>\n</li>\n<li><p>401 Unauthorized: Incorrect email or password or unverified email</p>\n</li>\n<li><p>500 Internal Server Error: Server encountered an unexpected condition.</p>\n</li>\n</ul>\n","urlObject":{"path":["auth","login"],"host":["{{base}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"1cf2f8db-f930-494c-905b-d7ee5a3033b0"},{"name":"Verify User Account","id":"a7d05904-28b6-4b6d-ab0a-7a6d9d8004c5","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:3000/api/v1/auth/verify/bishosedra0@gmail.com","description":"<p><strong>This request verifies a user's account after registration by confirming their email address.</strong></p>\n<p>Parameters:</p>\n<ul>\n<li><strong>email</strong>: The email address of the user whose account is being verified.</li>\n</ul>\n<p>Method: GET</p>\n<p>Response:</p>\n<ul>\n<li>200 OK: User account successfully verified.</li>\n<li>400 Bad Request: Invalid input or missing required fields.</li>\n<li>404 Not Found: User with the specified email not found or account already verified.</li>\n<li>500 Internal Server Error: Server encountered an unexpected condition.</li>\n</ul>\n<p>Example:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>GET /api/v1/auth/verify/bishosedra0@gmail.com\n\n</code></pre><p>Response Example for 200 OK:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-css\">&lt;h1 class=&amp;#x27;preserveHtml&amp;#x27; class=&amp;#x27;preserveHtml&amp;#x27; class=&amp;#x27;preserveHtml&amp;#x27; class=&amp;#x27;preserveHtml&amp;#x27;&gt;Email verified successfully!&lt;/h1&gt;\n\n</code></pre>\n<p>Response Example for 404 Not Found:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"body\": null,\n    \"message\": \"User with email 'bishosedra0@gmail.com' not found or account already verified.\",\n    \"status\": 404\n}\n\n</code></pre>\n<p>Response Example for 500 Internal Server Error:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"body\": null,\n    \"message\": \"Internal Server Error. Please try again later.\",\n    \"status\": 500\n}\n\n</code></pre>\n","urlObject":{"protocol":"http","port":"3000","path":["api","v1","auth","verify","bishosedra0@gmail.com"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"a7d05904-28b6-4b6d-ab0a-7a6d9d8004c5"}],"id":"f6140f5a-efe6-47ed-ac7e-c0669ba3df1d","_postman_id":"f6140f5a-efe6-47ed-ac7e-c0669ba3df1d","description":""},{"name":"User","item":[{"name":"Get user by email","id":"7707c224-2c63-44d5-bd7b-3f49f309bd31","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"GET","header":[],"url":"http://localhost:3000/api/v1/profile/bishosedra0@gmail.com","description":"<p><a href=\"http://localhost:3000/api/v1/profile/%7Bemail%7D\">http://localhost:3000/api/v1/profile/{email}</a></p>\n<p><strong>Description:</strong><br />This API endpoint allows users to retrieve account information by providing the email address associated with the account.</p>\n<p><strong>Parameters:</strong></p>\n<ul>\n<li><code>email</code>: The email address associated with the user account. [request parameter not body]</li>\n</ul>\n<p><strong>Method:</strong><code>GET</code></p>\n<p><strong>Headers:</strong></p>\n<ul>\n<li><code>Content-Type: application/json</code></li>\n</ul>\n<p><strong>Response:</strong></p>\n<ul>\n<li><code>200 OK</code>: Successful retrieval of the user profile.</li>\n<li><code>400 Bad Request</code>: Invalid input.</li>\n<li><code>404 Not Found</code>: User with the provided email address not found.</li>\n<li><code>500 Internal Server Error</code>: Server encountered an unexpected condition.</li>\n</ul>\n<p><strong>200 OK example:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"body\": {\n        \"_id\": \"6620690c01d131ca012efba3\",\n        \"username\": \"test changed username\",\n        \"email\": \"mohanad@mail.com\",\n        \"friends\": [],\n        \"__v\": 6\n    },\n    \"status\": 200,\n    \"message\": \"User fetched successfully\"\n}\n\n</code></pre>\n","urlObject":{"protocol":"http","port":"3000","path":["api","v1","profile","bishosedra0@gmail.com"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"7707c224-2c63-44d5-bd7b-3f49f309bd31"},{"name":"Change username by email","id":"43cd7ebe-4c66-49e5-8abe-3788ce9bcb07","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"PATCH","header":[],"body":{"mode":"raw","raw":"{\n    \"username\": \"test changed username\"\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/api/v1/profile/change-username/mohanad@mail.com","description":"<p><a href=\"http://localhost:3000/api/v1/profile/%7Bemail%7D\">http://localhost:3000/api/v1/profile/{email}</a></p>\n<p><strong>Description:</strong></p>\n<p>This API endpoint allows users to change their username by providing the email address associated with their account.</p>\n<p><strong>Parameters:</strong></p>\n<ul>\n<li><code>email</code>: The email address associated with the user account. [request parameter not body]</li>\n</ul>\n<p><strong>Method: PATCH</strong></p>\n<p><strong>Headers:</strong></p>\n<ul>\n<li><code>Content-Type: application/json</code></li>\n</ul>\n<p><strong>Response:</strong></p>\n<ul>\n<li><p><code>200 OK</code>: Successful retrieval of the user profile.</p>\n</li>\n<li><p><code>400 Bad Request</code>: Invalid input.</p>\n</li>\n<li><p><code>404 Not Found</code>: User with the provided email address not found.</p>\n</li>\n<li><p><code>500 Internal Server Error</code>: Server encountered an unexpected condition.</p>\n</li>\n</ul>\n<p><strong>200 OK example:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"body\": {\n        \"_id\": \"6620690c01d131ca012efba3\",\n        \"username\": \"test changed username\",\n        \"email\": \"mohanad@mail.com\",\n        \"friends\": [],\n        \"__v\": 6\n    },\n    \"status\": 200,\n    \"message\": \"User fetched successfully\"\n}\n\n</code></pre>\n","urlObject":{"protocol":"http","port":"3000","path":["api","v1","profile","change-username","mohanad@mail.com"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"43cd7ebe-4c66-49e5-8abe-3788ce9bcb07"},{"name":"Public get username by email","id":"86580170-c123-44f9-86f4-d3c0f0359198","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:3000/api/v1/profile/username/mo'men@mail.com","urlObject":{"protocol":"http","port":"3000","path":["api","v1","profile","username","mo'men@mail.com"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"86580170-c123-44f9-86f4-d3c0f0359198"}],"id":"ad6823ba-8d2a-4da8-bc40-0100e4c58581","_postman_id":"ad6823ba-8d2a-4da8-bc40-0100e4c58581","description":""},{"name":"Chat","item":[{"name":"GroupChat","item":[{"name":"Create New Group","id":"2cf1d287-ef13-4828-abcc-aedcb7c861ab","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"adminEmail\": \"mazen@gmail.com\",\n    \"groupName\": \"cat sphere\",\n    \"groupDescription\": \"test groupDescription\"\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/api/v1/chats/groups/create","description":"<h4 id=\"description\">Description</h4>\n<p>Creates a new group chat with the provided details.</p>\n<h4 id=\"request-body\">Request Body</h4>\n<p>The request body should be a JSON object with the following properties:</p>\n<ul>\n<li><strong>adminEmail</strong> (string, required): The email address of the user who will be the admin of the group.</li>\n<li><strong>groupName</strong> (string, required): The name of the group chat to be created.</li>\n<li><strong>groupDescription</strong> (string, optional): A description of the group chat (optional).</li>\n</ul>\n<h4 id=\"method\">Method</h4>\n<p>POST</p>\n<h4 id=\"responses\">Responses</h4>\n<ul>\n<li><strong>200 OK</strong>: Group chat created successfully.</li>\n<li><strong>400 Bad Request</strong>: Invalid input or missing required fields.</li>\n<li><strong>500 Internal Server Error</strong>: Server encountered an unexpected condition.</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"body\": \"663bb53d719582c3eef93687\",\n    \"message\": \"Group chat created succesfully!\",\n    \"status\": 200\n}\n\n</code></pre>\n","urlObject":{"protocol":"http","port":"3000","path":["api","v1","chats","groups","create"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"2cf1d287-ef13-4828-abcc-aedcb7c861ab"},{"name":"Add friend to group","id":"abfe0944-2925-4a72-88f9-7d3ab2dc3081","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"adminEmail\": \"mohanad@mail.com\", \n    \"userEmail\": \"mo'men@mail.com\",\n    \"chatID\": \"663bb53d719582c3eef93687\"\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/api/v1/chats/groups/add-friend","description":"<h4 id=\"description\">Description</h4>\n<p>Adds a user to an existing group chat as a member.</p>\n<h4 id=\"endpoint\">Endpoint</h4>\n<p><code>POST /api/v1/chats/groups/add-friend</code></p>\n<h4 id=\"request-body\">Request Body</h4>\n<p>The request body should be a JSON object with the following properties:</p>\n<ul>\n<li><strong>adminEmail</strong> (string, required): The email address of the user who is the admin of the group chat.</li>\n<li><strong>userEmail</strong> (string, required): The email address of the user to be added to the group chat.</li>\n<li><strong>chatID</strong> (string, required): The unique identifier of the group chat to which the user will be added.</li>\n</ul>\n<h4 id=\"method\">Method</h4>\n<p>POST</p>\n<h4 id=\"responses\">Responses</h4>\n<ul>\n<li><strong>200 OK</strong>: User successfully added to the group chat.</li>\n<li><strong>400 Bad Request</strong>: Invalid input or missing required fields or user already in group.</li>\n<li><strong>404 Not Found</strong>: Group chat or user not found.</li>\n<li><strong>500 Internal Server Error</strong>: Server encountered an unexpected condition.</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-javascript\">{\n    \"body\": null,\n    \"message\": \"User added to group chat succesfully!\",\n    \"status\": 200\n}\n\n</code></pre>\n","urlObject":{"protocol":"http","port":"3000","path":["api","v1","chats","groups","add-friend"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"abfe0944-2925-4a72-88f9-7d3ab2dc3081"},{"name":"Get group details","id":"49943274-e749-4acd-9dfd-89a8fb4cf79c","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"GET","header":[],"url":"http://localhost:3000/api/v1/chats/groups/details/66357acd8f7fe6945e491bc6","description":"<p><a href=\"http://localhost:3000/api/v1/chats/groups/details/%7BgroupID%7D\">http://localhost:3000/api/v1/chats/groups/details/{groupID}</a></p>\n<h3 id=\"get-group-chat-details\">Get Group Chat Details</h3>\n<h4 id=\"description\">Description</h4>\n<p>Retrieves detailed information about a group chat based on the provided <code>groupID</code>.</p>\n<h4 id=\"parameters\">Parameters</h4>\n<ul>\n<li><strong>groupID</strong>: The unique identifier of the group chat for which details are being requested.</li>\n</ul>\n<h4 id=\"method\">Method</h4>\n<p>GET</p>\n<h4 id=\"responses\">Responses</h4>\n<ul>\n<li><strong>200 OK</strong>: Successfully retrieved group chat details.</li>\n<li><strong>400 Bad Request</strong>: Invalid input or missing required fields.</li>\n<li><strong>404 Not Found</strong>: Group chat not found.</li>\n<li><strong>500 Internal Server Error</strong>: Server encountered an unexpected condition.</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"message\": \"Group chat details retreived succesfully!\",\n    \"status\": 200,\n    \"body\": {\n        \"_id\": \"66357acd8f7fe6945e491bc8\",\n        \"chat_id\": \"66357acd8f7fe6945e491bc6\",\n        \"group_name\": \"Group1\",\n        \"group_description\": \"\",\n        \"admin_email\": \"mohanad@mail.com\",\n        \"createdAt\": \"2024-05-04T00:01:17.332Z\",\n        \"updatedAt\": \"2024-05-04T00:01:17.332Z\",\n        \"__v\": 0\n    }\n}\n\n</code></pre>\n","urlObject":{"protocol":"http","port":"3000","path":["api","v1","chats","groups","details","66357acd8f7fe6945e491bc6"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"49943274-e749-4acd-9dfd-89a8fb4cf79c"},{"name":"Delete group","id":"db2af48d-9c6c-40ce-9199-f1cabe254fed","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"DELETE","header":[],"body":{"mode":"raw","raw":"{\n    \"email\": \"mohanad@mail.com\"\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/api/v1/chats/groups/66357acd8f7fe6945e491bc6","description":"<h4 id=\"description\">Description</h4>\n<p>Retrieves details about a specific group chat identified by its unique ID.</p>\n<h4 id=\"endpoint\">Endpoint</h4>\n<p><code>DELETE /api/v1/chats/groups/66357acd8f7fe6945e491bc6</code></p>\n<h4 id=\"parameters\">Parameters</h4>\n<ul>\n<li><strong>GroupID</strong>: The unique identifier of the group chat to be deleted.</li>\n<li><strong>email</strong>: The email address of the user who is attempting to delete the group chat.</li>\n</ul>\n<h4 id=\"responses\">Responses</h4>\n<ul>\n<li><strong>200 OK</strong>: Group chat deleted successfully.</li>\n<li><strong>400 Bad Request</strong>: Invalid input or missing required fields.</li>\n<li><strong>404 Not Found</strong>: Group chat not found.</li>\n<li><strong>500 Internal Server Error</strong>: Server encountered an unexpected condition.</li>\n</ul>\n","urlObject":{"protocol":"http","port":"3000","path":["api","v1","chats","groups","66357acd8f7fe6945e491bc6"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"db2af48d-9c6c-40ce-9199-f1cabe254fed"}],"id":"f540e9e2-a9de-4389-bf72-043fa7daac2b","_postman_id":"f540e9e2-a9de-4389-bf72-043fa7daac2b","description":""},{"name":"Get private chats by mail","id":"227971ed-c257-4b3d-9e6e-f3e4faa24438","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{auth_token}}"}]},"isInherited":false},"method":"GET","header":[],"body":{"mode":"raw","raw":"","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/api/v1/chats/private/bishosedra0@gmail.com","description":"<p><code>http://localhost:3000/api/v1/chats/private/test@mail</code></p>\n<p><strong>Description:</strong></p>\n<p>This endpoint allows you to get chat messages by providing email address associated with account.</p>\n<p><strong>Parameters:</strong></p>\n<ul>\n<li><code>email</code> - email address associated with account</li>\n</ul>\n<p><strong>Method:</strong> <code>GET</code></p>\n<p><strong>Headers:</strong></p>\n<ul>\n<li><code>Content-Type: application/json</code></li>\n</ul>\n<p><strong>Response:</strong></p>\n<ul>\n<li><p><code>200 OK</code> Succefssful response</p>\n</li>\n<li><p><code>400 Bad Request</code> Invalid request</p>\n</li>\n<li><p><code>500 Internal server error</code> Server encountered an error</p>\n</li>\n</ul>\n<p>200 response example</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"message\": \"Private chats of user retreived succesfully!\",\n    \"status\": 200,\n    \"body\": [\n        {\n            \"_id\": \"66356204908b4bb1bdd6aa7e\",\n            \"users\": [\n                \"mo'men@mail.com\",\n                \"bishoy@mail.com\"\n            ],\n            \"chat_type\": \"PRIVATE\",\n            \"messages\": [\n                {\n                    \"text\": \"frfr\",\n                    \"sender_email\": \"bishoy@mail.com\",\n                    \"_id\": \"66356291bb3234a2d0284184\",\n                    \"createdAt\": \"2024-05-03T22:17:53.231Z\",\n                    \"updatedAt\": \"2024-05-03T22:17:53.231Z\"\n                },\n                {\n                    \"text\": \"not frfr\",\n                    \"sender_email\": \"mo'men@mail.com\",\n                    \"_id\": \"663562a5bb3234a2d0284196\",\n                    \"createdAt\": \"2024-05-03T22:18:13.419Z\",\n                    \"updatedAt\": \"2024-05-03T22:18:13.419Z\"\n                }\n            ],\n            \"createdAt\": \"2024-05-03T22:15:32.288Z\",\n            \"updatedAt\": \"2024-05-03T22:19:09.409Z\",\n            \"__v\": 6\n        }\n    ]\n}\n\n</code></pre>\n<p>Message that contains imageUrl example:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n                    \"text\": \"test\",\n                    \"imageUrl\": \"https://res.cloudinary.com/dvi7vuujv/image/upload/v1715269261/d9yfp4mqihkmgfsfr3ce.jpg\",\n                    \"sender_email\": \"mohanad@mail.com\",\n                    \"_id\": \"663cee726dc96d7c6894433d\",\n                    \"createdAt\": \"2024-05-09T15:40:36.619Z\",\n                    \"updatedAt\": \"2024-05-09T15:40:36.619Z\"\n                },\n\n</code></pre>\n<h2 id=\"code-snippet\">Code Snippet</h2>\n<p><code>curl --location --request GET 'http://localhost:3000/api/v1/chats/private/test@mail</code></p>\n","urlObject":{"protocol":"http","port":"3000","path":["api","v1","chats","private","bishosedra0@gmail.com"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"227971ed-c257-4b3d-9e6e-f3e4faa24438"},{"name":"Get group chats by mail","id":"d6a74d20-d3d0-41a3-8443-673d41443eb8","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"GET","header":[],"url":"http://localhost:3000/api/v1/chats/groups/mazen@gmail.com","description":"<p><code>http://localhost:3000/api/v1/chats/groups/test@mail</code></p>\n<p><strong>Description:</strong></p>\n<p>This endpoint allows you to get group chat messages by providing email address associated with account.</p>\n<p><strong>Parameters:</strong></p>\n<ul>\n<li><code>email</code> - email address associated with account</li>\n</ul>\n<p><strong>Method</strong> <code>GET</code></p>\n<p><strong>Headers:</strong></p>\n<ul>\n<li><code>Content-Type: application/json</code></li>\n</ul>\n<p><strong>Response:</strong></p>\n<ul>\n<li><code>200 OK</code> Succefssful response</li>\n<li><code>400 Bad Request</code> Invalid request</li>\n<li><code>401 Invalid Access</code></li>\n<li><code>404 Not found</code> User with provided mail address not found</li>\n<li><code>500 Internal server error</code> Server encountered an error</li>\n</ul>\n<p>200 OK example:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"message\": \"Group chats of user retreived succesfully!\",\n    \"status\": 200,\n    \"body\": [\n        {\n            \"_id\": \"66357acd8f7fe6945e491bc6\",\n            \"users\": [\n                \"mohanad@mail.com\",\n                \"mo'men@mail.com\"\n            ],\n            \"chat_type\": \"GROUP\",\n            \"messages\": [\n                {\n                    \"text\": \"not frfffffffffffr\",\n                    \"sender_email\": \"mo'men@mail.com\",\n                    \"_id\": \"663582b0c4448a411876a04a\",\n                    \"createdAt\": \"2024-05-04T00:34:56.794Z\",\n                    \"updatedAt\": \"2024-05-04T00:34:56.794Z\"\n                }\n            ],\n            \"createdAt\": \"2024-05-04T00:01:17.189Z\",\n            \"updatedAt\": \"2024-05-04T00:34:56.795Z\",\n            \"__v\": 2\n        }\n    ]\n}\n\n</code></pre>\n<p>Message that contains imageUrl example:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n                    \"text\": \"test\",\n                    \"imageUrl\": \"https://res.cloudinary.com/dvi7vuujv/image/upload/v1715269261/d9yfp4mqihkmgfsfr3ce.jpg\",\n                    \"sender_email\": \"mohanad@mail.com\",\n                    \"_id\": \"663cee726dc96d7c6894433d\",\n                    \"createdAt\": \"2024-05-09T15:40:36.619Z\",\n                    \"updatedAt\": \"2024-05-09T15:40:36.619Z\"\n                },\n\n</code></pre>\n<h2 id=\"code-snippet\">Code snippet</h2>\n<p><code>curl --location --request GET http://localhost:3000/api/v1/chats/groups/test@mail</code></p>\n","urlObject":{"protocol":"http","port":"3000","path":["api","v1","chats","groups","mazen@gmail.com"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"d6a74d20-d3d0-41a3-8443-673d41443eb8"}],"id":"815ca4fb-adf1-462c-9d2d-3051cd87c133","_postman_id":"815ca4fb-adf1-462c-9d2d-3051cd87c133","description":""},{"name":"Message","item":[{"name":"Send message","id":"59c18b07-fccd-4b31-8da3-9ed8f8c8b45b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{auth_token}}"}]},"isInherited":false},"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"message\": \"This is a test message!\",\r\n    \"is_reply\": true,\r\n    \"reply_to\": \"6883ea3d66a39d379a0049a8\"\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/api/v1/messages/bishosedra0@gmail.com/send/6883b44e8987ba9a50f91303","description":"<p><code>http://localhost:3000/api/v1/messages/{senderEmail}/send/{chatID}</code></p>\n<p><strong>Description:</strong></p>\n<p>Send message from user with {senderID} to chat with {chatID}</p>\n<p><strong>Parameters:</strong></p>\n<ul>\n<li><code>senderID</code> - ID of the sender</li>\n<li><code>chatID</code> - ID of the chat</li>\n</ul>\n<p><strong>Method</strong> <code>POST</code></p>\n<p><strong>Headers:</strong></p>\n<ul>\n<li><code>Content-Type: application/json</code></li>\n</ul>\n<p><strong>Response:</strong></p>\n<ul>\n<li><code>200 OK</code> Succefssful response</li>\n<li><code>400 Bad Request</code> Invalid request</li>\n<li><code>401 Invalid Access</code></li>\n<li><code>404 Not found</code> User with provided mail address not found</li>\n<li><code>500 Internal server error</code> Server encountered an error</li>\n</ul>\n<h2 id=\"code-snippet\">Code snippet</h2>\n<p><code>curl --location --request POST http://localhost:3000/api/v1/messages/{senderID}/send/{chatID}</code></p>\n","urlObject":{"protocol":"http","port":"3000","path":["api","v1","messages","bishosedra0@gmail.com","send","6883b44e8987ba9a50f91303"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"59c18b07-fccd-4b31-8da3-9ed8f8c8b45b"},{"name":"Delete message","id":"e468ec74-b628-4b84-8f0e-da58823fb65b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"DELETE","header":[],"body":{"mode":"raw","raw":"","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/api/v1/messages/mazen@gmail.com/delete/6637e78cf88910d2316a71ef/663a6b178c5ea7f1774acffe","description":"<p><code>http://localhost:3000/api/v1/messages/{senderMail}/delete/{chatID}/{messageID}</code></p>\n<p><strong>Description:</strong></p>\n<p>Delete message from user with {senderID} to chat with {chatID}</p>\n<p><strong>Parameters:</strong></p>\n<ul>\n<li><code>senderID</code> - ID of the sender</li>\n<li><code>chatID</code> - ID of the chat</li>\n</ul>\n<p><strong>Method</strong> <code>POST</code></p>\n<p><strong>Headers:</strong></p>\n<ul>\n<li><code>Content-Type: application/json</code></li>\n</ul>\n<p><strong>Response:</strong></p>\n<ul>\n<li><code>200 OK</code> Succefssful response</li>\n<li><code>400 Bad Request</code> Invalid request</li>\n<li><code>401 Invalid Access</code></li>\n<li><code>404 Not found</code> User with provided mail address not found</li>\n<li><code>500 Internal server error</code> Server encountered an error</li>\n</ul>\n<h2 id=\"code-snippet\">Code snippet</h2>\n<p><code>curl --location --request POST http://localhost:3000/api/v1/messages/{senderID}/delete/{chatID}</code></p>\n","urlObject":{"protocol":"http","port":"3000","path":["api","v1","messages","mazen@gmail.com","delete","6637e78cf88910d2316a71ef","663a6b178c5ea7f1774acffe"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"e468ec74-b628-4b84-8f0e-da58823fb65b"}],"id":"a3b74a69-c248-4e96-9fba-0b046846a26b","_postman_id":"a3b74a69-c248-4e96-9fba-0b046846a26b","description":""}]}