{"info":{"_postman_id":"176aab82-f92b-4200-bbf5-511b8e0c7a3b","name":"Litmus Task","description":"<html><head></head><body><h1 id=\"go-oauth-server\">Go OAuth Server</h1>\n<p>This is an simple server written in GoLang making use of MongoDB and GoFiber.</p>\n<p>You need to generate a JWT Token from the main server that is hosted on <a href=\"https://goauth.benro.tech\">https://goauth.benro.tech</a> or you can host it yourself by referring to the <a href=\"https://github.com/DarthBenro008/go-oauth\">source code</a></p>\n<p>Once you generate the token, add it in headers and you can make use of this API.</p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[{"content":"Go OAuth Server","slug":"go-oauth-server"}],"owner":"12292853","collectionId":"176aab82-f92b-4200-bbf5-511b8e0c7a3b","publishedId":"TzRUAmao","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"publishDate":"2021-05-12T05:09:33.000Z"},"item":[{"name":"Todo","item":[{"name":"Add a Todo","id":"dc7bccb8-7c44-4143-9fd4-71936390ffcf","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2MjA4MTMyMzQsImlkIjoiNjA5YWNhYjZiZmY2MzE1NDQ5MGJhNTI4In0.3v6q6LmM_uHmqTsE34N4S7nliI0hciImT89eVPlalII","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"title\": \"Sample Task 1\",\r\n    \"description\": \"To make an Oauth server in golang\",\r\n    \"done\": false\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/api/todos","urlObject":{"protocol":"http","port":"3000","path":["api","todos"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"ff81a7f8-1138-4ba8-bdd2-56ff9ba78b88","name":"Success Response","originalRequest":{"method":"POST","header":[{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2MjA4MTMyMzQsImlkIjoiNjA5YWNhYjZiZmY2MzE1NDQ5MGJhNTI4In0.3v6q6LmM_uHmqTsE34N4S7nliI0hciImT89eVPlalII","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"title\": \"Sample Task 1\",\r\n    \"description\": \"To make an Oauth server in golang\",\r\n    \"done\": false\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/api/todos"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Wed, 12 May 2021 04:56:49 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"264"},{"key":"Vary","value":"Origin"},{"key":"Access-Control-Allow-Origin","value":"*"}],"cookie":[],"responseTime":null,"body":"{\n    \"data\": {\n        \"_id\": \"609b60117fcce6a03b152d04\",\n        \"title\": \"Sample Task 1\",\n        \"description\": \"To make an Oauth server in golang\",\n        \"done\": false,\n        \"createdAt\": 1620795409,\n        \"updatedAt\": 1620795409,\n        \"user\": \"609acab6bff63154490ba528\"\n    },\n    \"description\": \"Successfully added Todo\",\n    \"status\": true\n}"},{"id":"83bf453a-e2d1-4112-8f43-4ba1d0fe10d2","name":"No JWT","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"title\": \"Sample Task 1\",\r\n    \"descrirption\": \"To make an Oauth server in golang\",\r\n    \"done\": false\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/api/todos"},"status":"Bad Request","code":400,"_postman_previewlanguage":"plain","header":[{"key":"Date","value":"Wed, 12 May 2021 04:53:09 GMT"},{"key":"Content-Type","value":"text/plain; charset=utf-8"},{"key":"Content-Length","value":"24"},{"key":"Vary","value":"Origin"},{"key":"Access-Control-Allow-Origin","value":"*"}],"cookie":[],"responseTime":null,"body":"Missing or malformed JWT"}],"_postman_id":"dc7bccb8-7c44-4143-9fd4-71936390ffcf"},{"name":"Get All Todos","id":"48875b96-5331-47d2-9426-0f71a5ae8f62","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2MjA4MTMyMzQsImlkIjoiNjA5YWNhYjZiZmY2MzE1NDQ5MGJhNTI4In0.3v6q6LmM_uHmqTsE34N4S7nliI0hciImT89eVPlalII","type":"text"}],"url":"http://localhost:3000/api/todos","urlObject":{"protocol":"http","port":"3000","path":["api","todos"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"be995ff2-4260-4b5b-a50a-b7911a8f74f8","name":"Get All Todos","originalRequest":{"method":"GET","header":[{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2MjA4MTMyMzQsImlkIjoiNjA5YWNhYjZiZmY2MzE1NDQ5MGJhNTI4In0.3v6q6LmM_uHmqTsE34N4S7nliI0hciImT89eVPlalII","type":"text"}],"url":"http://localhost:3000/api/todos"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Wed, 12 May 2021 05:02:14 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"445"},{"key":"Vary","value":"Origin"},{"key":"Access-Control-Allow-Origin","value":"*"}],"cookie":[],"responseTime":null,"body":"{\n    \"data\": [\n        {\n            \"_id\": \"609b61487fcce6a03b152d06\",\n            \"title\": \"Sample Task 1\",\n            \"description\": \"To make a golang server\",\n            \"done\": false,\n            \"createdAt\": 1620795720,\n            \"updatedAt\": 1620795720,\n            \"user\": \"609acab6bff63154490ba528\"\n        },\n        {\n            \"_id\": \"609b61537fcce6a03b152d07\",\n            \"title\": \"Sample Task 2\",\n            \"description\": \"To add a database\",\n            \"done\": false,\n            \"createdAt\": 1620795731,\n            \"updatedAt\": 1620795731,\n            \"user\": \"609acab6bff63154490ba528\"\n        }\n    ],\n    \"description\": \"Fetched todos successfully\",\n    \"status\": true\n}"}],"_postman_id":"48875b96-5331-47d2-9426-0f71a5ae8f62"},{"name":"Update a Todo","id":"68189890-18e5-41ed-af7e-73e9ff5d714e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2MjA4MTMyMzQsImlkIjoiNjA5YWNhYjZiZmY2MzE1NDQ5MGJhNTI4In0.3v6q6LmM_uHmqTsE34N4S7nliI0hciImT89eVPlalII","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"_id\": \"609b60117fcce6a03b152d04\",\r\n    \"title\": \"Sample Task 2\",\r\n    \"description\": \"To add a database\",\r\n    \"done\": true\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/api/todos","urlObject":{"protocol":"http","port":"3000","path":["api","todos"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"1737ceb0-e804-48d7-937a-854e1ba463a5","name":"Update a Todo","originalRequest":{"method":"PUT","header":[{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2MjA4MTMyMzQsImlkIjoiNjA5YWNhYjZiZmY2MzE1NDQ5MGJhNTI4In0.3v6q6LmM_uHmqTsE34N4S7nliI0hciImT89eVPlalII","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"_id\": \"609b60117fcce6a03b152d04\",\r\n    \"title\": \"Sample Task 2\",\r\n    \"description\": \"To add a database\",\r\n    \"done\": true\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/api/todos"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Wed, 12 May 2021 05:03:12 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"240"},{"key":"Vary","value":"Origin"},{"key":"Access-Control-Allow-Origin","value":"*"}],"cookie":[],"responseTime":null,"body":"{\n    \"data\": {\n        \"_id\": \"609b60117fcce6a03b152d04\",\n        \"title\": \"Sample Task 2\",\n        \"description\": \"To add a database\",\n        \"done\": true,\n        \"createdAt\": 0,\n        \"updatedAt\": 1620795793,\n        \"user\": \"609acab6bff63154490ba528\"\n    },\n    \"description\": \"Successfully fetched data\",\n    \"status\": true\n}"}],"_postman_id":"68189890-18e5-41ed-af7e-73e9ff5d714e"},{"name":"Delete a Todo","id":"26d6452e-11ec-41cc-aa15-9aea5ef38ac7","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2MjA4MTMyMzQsImlkIjoiNjA5YWNhYjZiZmY2MzE1NDQ5MGJhNTI4In0.3v6q6LmM_uHmqTsE34N4S7nliI0hciImT89eVPlalII","type":"text"}],"url":"http://localhost:3000/api/todos?_id=609b61487fcce6a03b152d06","urlObject":{"protocol":"http","port":"3000","path":["api","todos"],"host":["localhost"],"query":[{"key":"_id","value":"609b61487fcce6a03b152d06"}],"variable":[]}},"response":[{"id":"7bb03183-ed27-4a0f-a597-b1e4a7a37c83","name":"Delete a Todo","originalRequest":{"method":"DELETE","header":[{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2MjA4MTMyMzQsImlkIjoiNjA5YWNhYjZiZmY2MzE1NDQ5MGJhNTI4In0.3v6q6LmM_uHmqTsE34N4S7nliI0hciImT89eVPlalII","type":"text"}],"url":{"raw":"http://localhost:3000/api/todos?_id=609b61487fcce6a03b152d06","protocol":"http","host":["localhost"],"port":"3000","path":["api","todos"],"query":[{"key":"_id","value":"609b61487fcce6a03b152d06"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Wed, 12 May 2021 05:06:03 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"87"},{"key":"Vary","value":"Origin"},{"key":"Access-Control-Allow-Origin","value":"*"}],"cookie":[],"responseTime":null,"body":"{\n    \"data\": \"Removed Successfully\",\n    \"description\": \"Successfully fetched data\",\n    \"status\": true\n}"}],"_postman_id":"26d6452e-11ec-41cc-aa15-9aea5ef38ac7"}],"id":"ddc5fd31-7d48-45e1-9341-69a6be211488","_postman_id":"ddc5fd31-7d48-45e1-9341-69a6be211488","description":""},{"name":"Get User","id":"16347505-ac6f-4342-9dcc-ba6d3dea6633","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2MjA4Mjg2NzcsImlkIjoiNjA5YWNhYjZiZmY2MzE1NDQ5MGJhNTI4In0.PI58G8bJF-eULIfgSZJE8XQSiJhzbRtxIkCAMNV_usA","type":"text"}],"url":"http://localhost:3000/api/user","urlObject":{"protocol":"http","port":"3000","path":["api","user"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"25c92f64-52ec-4bce-95de-6e359b16bb3a","name":"Get User","originalRequest":{"method":"GET","header":[{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2MjA4Mjg2NzcsImlkIjoiNjA5YWNhYjZiZmY2MzE1NDQ5MGJhNTI4In0.PI58G8bJF-eULIfgSZJE8XQSiJhzbRtxIkCAMNV_usA","type":"text"}],"url":"http://localhost:3000/api/user"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Wed, 12 May 2021 09:16:23 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"281"},{"key":"Vary","value":"Origin"},{"key":"Access-Control-Allow-Origin","value":"*"}],"cookie":[],"responseTime":null,"body":"{\n    \"data\": {\n        \"_id\": \"609acab6bff63154490ba528\",\n        \"name\": \"Hemanth Krishna\",\n        \"email\": \"hkpdev008@gmail.com\",\n        \"accessToken\": \"\",\n        \"social\": \"google\",\n        \"picture\": \"https://lh3.googleusercontent.com/a-/AOh14GhVI_6NjaFevxwkSliIbfyyZ_vYP4V8FWTFw71PCQ=s96-c\"\n    },\n    \"description\": \"User data found\",\n    \"status\": true\n}"}],"_postman_id":"16347505-ac6f-4342-9dcc-ba6d3dea6633"}]}