{"info":{"_postman_id":"1dd5b097-e3a6-4d6e-b2f3-8391470db2ab","name":"Community Collection","description":"<html><head></head><body><p>This is a example requests for community application. Some fields are unique. If the unique constraints are not matched, the application will throw HTTP 403 error. Since I have not handled exceptions, exceptions does not return any messages.</p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"20862524","collectionId":"1dd5b097-e3a6-4d6e-b2f3-8391470db2ab","publishedId":"2sA3BuXUdF","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"publishDate":"2024-04-29T11:56:34.000Z"},"item":[{"name":"Authentication","item":[{"name":"Register User","id":"a3dfd0f1-5617-48fd-a6e0-9ac531e9682f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n  \"firstName\": \"User 1\",\n  \"lastName\": \"example\",\n  \"username\": \"example_user\",\n  \"email\": \"example_user@gmail.com\",\n  \"password\": \"example_user\"\n}","options":{"raw":{"language":"json"}}},"url":"https://swe-573-hw.onrender.com/api/v1/auth/register","description":"<p>Email &amp; username fields are required and unique.</p>\n","urlObject":{"protocol":"https","path":["api","v1","auth","register"],"host":["swe-573-hw","onrender","com"],"query":[],"variable":[]}},"response":[],"_postman_id":"a3dfd0f1-5617-48fd-a6e0-9ac531e9682f"},{"name":"Login","id":"bf3600a5-11b5-44d9-97b8-aef776f5a803","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n  \"email\": \"example_user@gmail.com\",\n  \"password\": \"example_user\"\n}","options":{"raw":{"language":"json"}}},"url":"https://swe-573-hw.onrender.com/api/v1/auth/login","urlObject":{"protocol":"https","path":["api","v1","auth","login"],"host":["swe-573-hw","onrender","com"],"query":[],"variable":[]}},"response":[],"_postman_id":"bf3600a5-11b5-44d9-97b8-aef776f5a803"}],"id":"794cc0e3-295a-4b57-99cd-23fffbce1d89","_postman_id":"794cc0e3-295a-4b57-99cd-23fffbce1d89","description":""},{"name":"Community-related requests","item":[{"name":"Create Community","id":"6130c327-5d5e-43e0-89a6-27d64c3b21d3","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"token":"<token>"},"isInherited":false},"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n  \"name\": \"string\",\n  \"description\": \"string\",\n    \"isPublic\": true\n}","options":{"raw":{"language":"json"}}},"url":"https://swe-573-hw.onrender.com/api/v1/community","description":"<p>In order to create a community, authentication needed. Select bearer from authorization and paste the JWT token.</p>\n","urlObject":{"protocol":"https","path":["api","v1","community"],"host":["swe-573-hw","onrender","com"],"query":[],"variable":[]}},"response":[],"_postman_id":"6130c327-5d5e-43e0-89a6-27d64c3b21d3"},{"name":"Get All Communities","id":"12d1c3ad-3a01-408f-b1cb-706fbdd5c208","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"token":"<token>"},"isInherited":false},"method":"GET","header":[],"url":"https://swe-573-hw.onrender.com/api/v1/community","description":"<p>Authentication needed. Select bearer from authorization and paste the JWT token.</p>\n","urlObject":{"protocol":"https","path":["api","v1","community"],"host":["swe-573-hw","onrender","com"],"query":[],"variable":[]}},"response":[],"_postman_id":"12d1c3ad-3a01-408f-b1cb-706fbdd5c208"},{"name":"Join a Community","id":"5cb2fd7a-141c-4162-965c-3c373894e6db","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"token":"<token>"},"isInherited":false},"method":"POST","header":[],"url":"https://swe-573-hw.onrender.com/api/v1/community/joinCommunity/1","description":"<p>URL=<a href=\"https://swe-573-hw.onrender.com/api/v1/community/joinCommunity/%7BcommunityId%7D\">https://swe-573-hw.onrender.com/api/v1/community/joinCommunity/{communityId}</a></p>\n<p>The user info is fetched from the JWT token.</p>\n<p>Each community name should be unique.</p>\n","urlObject":{"protocol":"https","path":["api","v1","community","joinCommunity","1"],"host":["swe-573-hw","onrender","com"],"query":[],"variable":[]}},"response":[],"_postman_id":"5cb2fd7a-141c-4162-965c-3c373894e6db"}],"id":"e3e68762-65a9-485b-bb44-c2f94df551f5","_postman_id":"e3e68762-65a9-485b-bb44-c2f94df551f5","description":""},{"name":"Post & Template requests","item":[{"name":"Create a template for a community","id":"9868d656-d132-4eef-b3dc-27fd74cf44c2","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"token":"<token>"},"isInherited":false},"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n  \"templateName\": \"test-template 2\",\n  \"dataFields\": [\n    {\n      \"name\": \"test-field\",\n      \"type\": \"TEXT\",\n      \"isRequired\": true\n    }\n  ]\n}","options":{"raw":{"language":"json"}}},"url":"https://swe-573-hw.onrender.com/api/v1/template?communityId=1","description":"<p>Template name should be unique!</p>\n<p>communityId is fetched from the parameter.</p>\n","urlObject":{"protocol":"https","path":["api","v1","template"],"host":["swe-573-hw","onrender","com"],"query":[{"key":"communityId","value":"1"}],"variable":[]}},"response":[],"_postman_id":"9868d656-d132-4eef-b3dc-27fd74cf44c2"},{"name":"Create a Post for a Community","id":"159bdb5b-00f4-4ddd-8b39-4edd79bf39a8","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"token":"<token>"},"isInherited":false},"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n  \"Title\": \"Test\",\n  \"Description\": \"This is a test for a post creation endpoint\"\n}","options":{"raw":{"language":"json"}}},"url":"https://swe-573-hw.onrender.com/api/v1/post/create/1?templateId=1","description":"<p>URL=<a href=\"https://swe-573-hw.onrender.com/api/v1/post/create/1?templateId=1\">https://swe-573-hw.onrender.com/api/v1/post/create/{communityId}?templateId=1</a></p>\n<p>user info created the post is fetched from JWT token.</p>\n","urlObject":{"protocol":"https","path":["api","v1","post","create","1"],"host":["swe-573-hw","onrender","com"],"query":[{"key":"templateId","value":"1"}],"variable":[]}},"response":[],"_postman_id":"159bdb5b-00f4-4ddd-8b39-4edd79bf39a8"},{"name":"Get posts in a community","id":"23c69974-998d-4c58-b5c4-11d5b9f95b57","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"token":"<token>"},"isInherited":false},"method":"GET","header":[],"url":"https://swe-573-hw.onrender.com/api/v1/community/1/posts","description":"<p>URL = <a href=\"https://swe-573-hw.onrender.com/api/v1/community/1/posts\">https://swe-573-hw.onrender.com/api/v1/community/{communityId}/posts<br /></a></p>\n<p>Authentication needed. Select bearer from authorization and paste the JWT token.</p>\n","urlObject":{"protocol":"https","path":["api","v1","community","1","posts"],"host":["swe-573-hw","onrender","com"],"query":[],"variable":[]}},"response":[],"_postman_id":"23c69974-998d-4c58-b5c4-11d5b9f95b57"},{"name":"Get all Posts","id":"d66fd81e-8aa4-4f86-b26c-e6dc910cac70","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"token":"<token>"},"isInherited":false},"method":"GET","header":[],"url":"https://swe-573-hw.onrender.com/api/v1/post","description":"<p>Authentication needed. Select bearer from authorization and paste the JWT token.</p>\n","urlObject":{"protocol":"https","path":["api","v1","post"],"host":["swe-573-hw","onrender","com"],"query":[],"variable":[]}},"response":[],"_postman_id":"d66fd81e-8aa4-4f86-b26c-e6dc910cac70"},{"name":"Get Post templates","id":"fbf5ce2e-f580-4e35-88ab-a64d4583b57f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"token":"<token>"},"isInherited":false},"method":"GET","header":[],"url":"https://swe-573-hw.onrender.com/api/v1/template","description":"<p>Authentication needed. Select bearer from authorization and paste the JWT token.</p>\n","urlObject":{"protocol":"https","path":["api","v1","template"],"host":["swe-573-hw","onrender","com"],"query":[],"variable":[]}},"response":[],"_postman_id":"fbf5ce2e-f580-4e35-88ab-a64d4583b57f"}],"id":"1d59022d-d2cb-42e2-bfa5-06dc5ad8d8b1","_postman_id":"1d59022d-d2cb-42e2-bfa5-06dc5ad8d8b1","description":""},{"name":"User requests","item":[{"name":"Get all users","id":"a9350ae1-ff4e-4c4f-a720-21f08f1934c1","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"token":"<token>"},"isInherited":false},"method":"GET","header":[],"url":"https://swe-573-hw.onrender.com/api/v1/users","description":"<p>Authentication needed. Select bearer from authorization and paste the JWT token.</p>\n","urlObject":{"protocol":"https","path":["api","v1","users"],"host":["swe-573-hw","onrender","com"],"query":[],"variable":[]}},"response":[],"_postman_id":"a9350ae1-ff4e-4c4f-a720-21f08f1934c1"},{"name":"Get a User by Id","id":"53474e68-76cf-4b1e-8bbc-f35730b4a0e4","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"token":"<token>"},"isInherited":false},"method":"GET","header":[],"url":"https://swe-573-hw.onrender.com/api/v1/users/1","description":"<p>URL = <a href=\"https://swe-573-hw.onrender.com/api/v1/users/%7BuserId%7D\">https://swe-573-hw.onrender.com/api/v1/users/{userId}</a></p>\n<p>Authentication needed. Select bearer from authorization and paste the JWT token.</p>\n","urlObject":{"protocol":"https","path":["api","v1","users","1"],"host":["swe-573-hw","onrender","com"],"query":[],"variable":[]}},"response":[],"_postman_id":"53474e68-76cf-4b1e-8bbc-f35730b4a0e4"},{"name":"Get user and their joined community info - work in progress","id":"993d2c2d-8490-4dff-a49b-5ded681ac251","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"token":"<token>"},"isInherited":false},"method":"GET","header":[],"url":"https://swe-573-hw.onrender.com/api/v1/users/user_communities","description":"<p>Authentication needed. Select bearer from authorization and paste the JWT token.</p>\n","urlObject":{"protocol":"https","path":["api","v1","users","user_communities"],"host":["swe-573-hw","onrender","com"],"query":[],"variable":[]}},"response":[],"_postman_id":"993d2c2d-8490-4dff-a49b-5ded681ac251"}],"id":"bdc4696b-fe29-4561-8229-4e6f0a5a1cbd","_postman_id":"bdc4696b-fe29-4561-8229-4e6f0a5a1cbd","description":""}]}