{"info":{"_postman_id":"635b95bd-8d7c-4e4d-9616-e6f1a955e22d","name":"cSharre API","description":"<html><head></head><body><p>The <strong>cShare REST API</strong> provides endpoints for</p>\n<ul>\n<li>Authentication into the cShare ecosystem.</li>\n<li>Retrieving data from the database.</li>\n<li>Adding data from the database.</li>\n<li>Deleting data from the database.</li>\n</ul>\n<p>The CRUD operations on the database, are secured by a JWT, which is uniquely generated for every user.</p>\n<hr>\n<h1 id=\"getting-started\">Getting Started</h1>\n<ul>\n<li>The routes are designed to work cShare-server. Clone the <a href=\"https://github.com/jammutkarsh/cshare-server\">cShare-server</a> repository and follow the instructions to start the server.</li>\n<li>You would need to set the variables for Postman Collection:<ul>\n<li><code>host</code>: the IP address or domain where the cShare-server will be running. If running locally, it will be <code>localhost.</code></li>\n<li><code>JWT_Token</code>: This token will be returned by <code>User/Login</code> request after a successful login.</li>\n</ul>\n</li>\n</ul>\n<hr>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[{"content":"Getting Started","slug":"getting-started"}],"owner":"19332599","collectionId":"635b95bd-8d7c-4e4d-9616-e6f1a955e22d","publishedId":"2s8YszQqbU","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"publishDate":"2023-09-12T10:06:19.000Z"},"item":[{"name":"User","item":[{"name":"SignUp","id":"05d86fde-f44c-4fac-ae8e-31400220ea8b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"username\": \"jammutkarsh\",\n    \"password\": \"passalulaword\",\n    \"pCount\": 8,\n    \"spCount\": 13\n}","options":{"raw":{"language":"json"}}},"url":"localhost:5675/v1/users/signup","description":"<p>Endpoint for registration of <strong>new</strong> users.</p>\n<blockquote>\n<p>NOTE: It doesn't return any JWT</p>\n</blockquote>\n","auth":{"type":"noauth","isInherited":true,"source":{"_postman_id":"b9ef348e-b0cf-4574-af44-a308f873561d","id":"b9ef348e-b0cf-4574-af44-a308f873561d","name":"User","type":"folder"}},"urlObject":{"path":["v1","users","signup"],"host":["localhost:5675"],"query":[],"variable":[]}},"response":[],"_postman_id":"05d86fde-f44c-4fac-ae8e-31400220ea8b"},{"name":"Login","id":"8fef35de-348c-4250-ba2b-01a403dc9127","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"username\": \"jammutkarsh\",\n    \"password\": \"passalulaword\",\n    \"pCount\": 8,\n    \"spCount\": 13\n}","options":{"raw":{"language":"json"}}},"url":"localhost:5675/v1/users/login","description":"<p>The endpoint generates JSON Web Token (JWT)</p>\n<ul>\n<li>For registered users.</li>\n<li>For users who's token are expired.</li>\n</ul>\n","urlObject":{"path":["v1","users","login"],"host":["localhost:5675"],"query":[],"variable":[]}},"response":[],"_postman_id":"8fef35de-348c-4250-ba2b-01a403dc9127"}],"id":"b9ef348e-b0cf-4574-af44-a308f873561d","description":"<p>These endpoints are for authentication and authorization purposes. The endpoints are:</p>\n<ul>\n<li><code>SignUp</code>: For new users. It returns the status of user creation.</li>\n<li><code>Login</code>: For registered users with valid credentials. It returns a JWT as a response.</li>\n</ul>\n<p>These endpoints follow a non-traditional approach to user access control. <strong>Salt(a random string)</strong> is added to the password with some additional information like <code>pCount</code> (Password Count) and <code>spCount</code> (Salted Password Count) to avoid malicious activity. These are uniquely generated by the client system.</p>\n<p>For the testing of the API, this can be generated by running the <a href=\"https://github.com/JammUtkarsh/cypherDecipher/blob/main/examples/example.go\">example</a> code to get values to be filled in JSON.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-bash\">$ go run examples/example.go\nEnter username: username1234\nEnter password: password5678\nusername1234\npassworisorialrd5678\n12\n20\n\n</code></pre>\n<p>The JSON equivalent of above output is</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"username\": \"username1234\",\n  \"password\": \"passworisorialrd5678\",\n  \"pCount\": 12,\n  \"spCount\": 20\n}\n\n</code></pre>\n<hr />\n","auth":{"type":"noauth","isInherited":false},"event":[{"listen":"prerequest","script":{"id":"488c2cab-c106-48ae-9c02-20a246fd7702","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"b5c7fbda-cb5e-4578-b108-b4da24e67326","type":"text/javascript","exec":[""]}}],"_postman_id":"b9ef348e-b0cf-4574-af44-a308f873561d"},{"name":"Clips","item":[{"name":"PostClip","id":"cf8c79dd-8727-497a-b5b9-c647da887fba","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"message\": \"Iusto enim doloribus numquam placeat excepturi consequatur odio voluptatem aut.\",\n    \"secret\": false\n}","options":{"raw":{"language":"json"}}},"url":"localhost:5675/v1/clip/secured/:username","description":"<p>Endpoint to post clip data on the server</p>\n<p><strong>NOTE:</strong> The key pair value of <code>\"secret\": false</code> is for a upcoming feature. It's value should always be false.</p>\n","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":true,"source":{"_postman_id":"6297f437-9b85-473d-9e92-1862023266b5","id":"6297f437-9b85-473d-9e92-1862023266b5","name":"Clips","type":"folder"}},"urlObject":{"path":["v1","clip","secured",":username"],"host":["localhost:5675"],"query":[],"variable":[{"id":"f53b81b6-4201-4807-90ca-3f2bebde6b0b","type":"any","value":"jammutkarsh","key":"username"}]}},"response":[],"_postman_id":"cf8c79dd-8727-497a-b5b9-c647da887fba"},{"name":"GetSingleClip","id":"afa84a4b-c08f-428d-acaa-d70e0f3e4263","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"localhost:5675/v1/clip/secured/:username/:clip_id","description":"<p>Endpoint to get a single clip for a user.</p>\n","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":true,"source":{"_postman_id":"6297f437-9b85-473d-9e92-1862023266b5","id":"6297f437-9b85-473d-9e92-1862023266b5","name":"Clips","type":"folder"}},"urlObject":{"path":["v1","clip","secured",":username",":clip_id"],"host":["localhost:5675"],"query":[],"variable":[{"type":"any","value":"jammutkarsh","key":"username"},{"type":"any","value":"1","key":"clip_id"}]}},"response":[],"_postman_id":"afa84a4b-c08f-428d-acaa-d70e0f3e4263"},{"name":"GetAllClip","id":"f2f859a7-42f4-46db-b80d-1b2a1e498ac9","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"localhost:5675/v1/clip/secured/:username","description":"<p>Endpoint to get a all the clip for a user.</p>\n","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":true,"source":{"_postman_id":"6297f437-9b85-473d-9e92-1862023266b5","id":"6297f437-9b85-473d-9e92-1862023266b5","name":"Clips","type":"folder"}},"urlObject":{"path":["v1","clip","secured",":username"],"host":["localhost:5675"],"query":[],"variable":[{"id":"1bd0d7eb-1a99-46b9-8b01-1fdb15fdc991","type":"any","value":"jammutkarsh","key":"username"}]}},"response":[],"_postman_id":"f2f859a7-42f4-46db-b80d-1b2a1e498ac9"},{"name":"DeleteAll","id":"981ff878-5ea2-498a-ab06-65309e28ce74","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[],"url":"localhost:5675/v1/clip/secured/:username","description":"<p>Endpoint to delete a all the clip of a user.</p>\n","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":true,"source":{"_postman_id":"6297f437-9b85-473d-9e92-1862023266b5","id":"6297f437-9b85-473d-9e92-1862023266b5","name":"Clips","type":"folder"}},"urlObject":{"path":["v1","clip","secured",":username"],"host":["localhost:5675"],"query":[],"variable":[{"id":"fa0bfdb0-fb3d-4b8e-9212-be99027d3ae5","type":"any","value":"jammutkarsh","key":"username"}]}},"response":[],"_postman_id":"981ff878-5ea2-498a-ab06-65309e28ce74"}],"id":"6297f437-9b85-473d-9e92-1862023266b5","description":"<p>The endpoints under clips are secured by a JSON Web Token, or JWT. For anyone to access these resource endpoints, they need a valid JWT.</p>\n<p>Every JWT is unique. It depends on two factors.</p>\n<ol>\n<li>Server's <strong>secret</strong>.</li>\n<li>Username</li>\n</ol>\n<p>You can generate a JWT from <code>User/Login</code> endpoint. Save this token in this collection's variable section to ease the testing of APIs.</p>\n<p>The following endpoints for clip operations are:</p>\n<ul>\n<li><code>PostClip</code>: Adds clip data to the database.</li>\n<li><code>GetSingleClip</code>: Fetches a single clip from the database. (default: last clip)</li>\n<li><code>GetAllClip</code>: Fetches all the clips from the database.</li>\n<li><code>DeleteAll</code>: Clears all the data from the database.</li>\n</ul>\n<hr />\n","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"event":[{"listen":"prerequest","script":{"id":"7fcdb6ca-9703-487c-abdf-d9178a4771a8","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"6671bd6e-c1dc-43e1-adf9-cb12732ce237","type":"text/javascript","exec":[""]}}],"_postman_id":"6297f437-9b85-473d-9e92-1862023266b5"}],"event":[{"listen":"prerequest","script":{"id":"4b124f7f-38f2-4da7-946e-df90d5be5edf","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"f22a75ba-00f6-4783-b17b-46f1007530af","type":"text/javascript","exec":[""]}}],"variable":[{"key":"host","value":"localhost:5675"},{"key":"JWT_Token","value":"","type":"string"}]}