{"info":{"_postman_id":"bbd92878-17ca-ccfd-944c-8599e65cb5f0","name":"Notes API","description":"<html><head></head><body><p>Install the app by running </p>\n<p>`git clone https://github.com/colinshum/notes-api-auth` \nand \n\n</p><p><code>cd notes-api-auth; npm install; node app.js</code></p><p></p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"2907078","collectionId":"bbd92878-17ca-ccfd-944c-8599e65cb5f0","publishedId":"7185tx7","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"2b2b2b","highlight":"EF5B25"},"publishDate":"2017-10-10T15:07:25.000Z"},"item":[{"name":"User","item":[{"name":"/register","id":"1f221c6b-8045-efc1-4b35-288f3d585235","request":{"method":"POST","header":[{"key":"Content-Type","value":"application/x-www-form-urlencoded"}],"body":{"mode":"urlencoded","urlencoded":[{"key":"username","value":"","description":"<p>type: string, required: true, unique: true</p>\n","type":"text"},{"key":"password","value":"","description":"<p>type: string, required: true, min_length: 6</p>\n","type":"text"},{"key":"user_class","value":"","description":"<p>type: enum(['general', 'admin']), default: 'general'</p>\n","type":"text"},{"key":"email","value":"","description":"<p>type: string, required: true, unique: true</p>\n","type":"text"}]},"url":"localhost:3000/register","description":"<p>Allows for users to register for API access.</p>\n","urlObject":{"port":"3000","path":["register"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"1215dc68-4cee-6b65-e851-f0a2ffaf76be","name":"/register","originalRequest":{"method":"POST","header":[{"key":"Content-Type","value":"application/x-www-form-urlencoded","disabled":false}],"body":{"mode":"urlencoded","urlencoded":[{"key":"username","value":"testing","description":"type: string, required: true, unique: true","type":"text"},{"key":"password","value":"password","description":"type: string, required: true, min_length: 6","type":"text"},{"key":"user_class","value":"general","description":"type: enum(['general', 'admin']), default: 'general'","type":"text"},{"key":"email","value":"testing@example.com","description":"type: string, required: true, unique: true","type":"text"}]},"url":"New user"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Connection","value":"keep-alive","name":"Connection","description":""},{"key":"Content-Length","value":"203","name":"Content-Length","description":""},{"key":"Content-Type","value":"application/json; charset=utf-8","name":"Content-Type","description":""},{"key":"Date","value":"Tue, 10 Oct 2017 15:02:39 GMT","name":"Date","description":""},{"key":"ETag","value":"W/\"cb-WO4ukVt0ALl+jug66q2P6b2gwGQ\"","name":"ETag","description":""},{"key":"X-Powered-By","value":"Express","name":"X-Powered-By","description":""}],"cookie":[],"responseTime":"491","body":"{\n    \"__v\": 0,\n    \"username\": \"testing\",\n    \"password\": \"$2a$10$pITmmJaE0QUolhvyawbPae.t/1hWt.mR37ms7sDfJbJRYWVjp5d9S\",\n    \"email\": \"testing@example.com\",\n    \"_id\": \"59dce10ebca6d4046aac8557\",\n    \"classes\": [],\n    \"user_class\": \"general\"\n}"},{"id":"49aad4af-929f-fb6b-aa8e-807169c3ef01","name":"/register","originalRequest":{"method":"POST","header":[{"key":"Content-Type","value":"application/x-www-form-urlencoded"}],"body":{"mode":"urlencoded","urlencoded":[{"key":"username","value":"admin","description":"type: string, required: true, unique: true","type":"text"},{"key":"password","value":"password","description":"type: string, required: true, min_length: 6","type":"text"},{"key":"user_class","value":"admin","description":"type: enum(['general', 'admin']), default: 'general'","type":"text"},{"key":"email","value":"asdf@something.com","description":"type: string, required: true, unique: true","type":"text"}]},"url":"Duplicate user"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Connection","value":"keep-alive","name":"Connection","description":""},{"key":"Content-Length","value":"327","name":"Content-Length","description":""},{"key":"Content-Type","value":"application/json; charset=utf-8","name":"Content-Type","description":""},{"key":"Date","value":"Tue, 10 Oct 2017 15:02:02 GMT","name":"Date","description":""},{"key":"ETag","value":"W/\"147-BVdwGEQvc8McH3ovqv4zAoNeVTA\"","name":"ETag","description":""},{"key":"X-Powered-By","value":"Express","name":"X-Powered-By","description":""}],"cookie":[],"responseTime":"196","body":"{\"code\":11000,\"index\":0,\"errmsg\":\"E11000 duplicate key error index: crud-notes.users.$username_1 dup key: { : \\\"admin\\\" }\",\"op\":{\"username\":\"admin\",\"password\":\"$2a$10$F5p2MVywSdLvLkoqyGA85eeNm0xCwjF3KLn.mim9XPxOoOCok9cWO\",\"email\":\"asdf@something.com\",\"_id\":\"59dce0eabca6d4046aac8556\",\"classes\":[],\"user_class\":\"admin\",\"__v\":0}}"},{"id":"6775d693-0bc4-8ef4-5211-c41dc8d4c41f","name":"New User","originalRequest":{"method":"POST","header":[{"key":"Content-Type","value":"application/x-www-form-urlencoded"}],"body":{"mode":"urlencoded","urlencoded":[{"key":"username","value":"username","description":"type: string, required: true, unique: true","type":"text"},{"key":"password","value":"password","description":"type: string, required: true, min_length: 6","type":"text"},{"key":"user_class","value":"general","description":"type: enum(['general', 'admin']), default: 'general'","type":"text"},{"key":"email","value":"username@testing.com","description":"type: string, required: true, unique: true","type":"text"}]},"url":"localhost:3000/register"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Connection","value":"keep-alive","name":"Connection","description":""},{"key":"Content-Length","value":"140","name":"Content-Length","description":""},{"key":"Content-Type","value":"application/json; charset=utf-8","name":"Content-Type","description":""},{"key":"Date","value":"Mon, 09 Oct 2017 20:16:55 GMT","name":"Date","description":""},{"key":"ETag","value":"W/\"8c-GyzD+/ehZmtfqmw715z4Yg4QqhQ\"","name":"ETag","description":""},{"key":"X-Powered-By","value":"Express","name":"X-Powered-By","description":""}],"cookie":[],"responseTime":"83","body":"{\"__v\":0,\"username\":\"username\",\"password\":\"password\",\"email\":\"username@testing.com\",\"_id\":\"59dbd9372f11d602f4722ddc\",\"user_class\":\"general\"}"}],"_postman_id":"1f221c6b-8045-efc1-4b35-288f3d585235"},{"name":"/login","id":"1f86ad26-6d96-0e64-a06b-3ff2871de331","request":{"method":"POST","header":[{"key":"Content-Type","value":"application/x-www-form-urlencoded"}],"body":{"mode":"urlencoded","urlencoded":[{"key":"username","value":"","description":"<p>required: true</p>\n","type":"text"},{"key":"password","value":"","description":"<p>required: true, case sensitive</p>\n","type":"text"}]},"url":"localhost:3000/login","description":"<p>Authenticates an existing user and returns a JSON web token upon successful login.</p>\n","urlObject":{"port":"3000","path":["login"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"dfeca264-2734-f6bb-9523-e8c1964d3f9e","name":"Login Example","originalRequest":{"method":"POST","header":[{"key":"Content-Type","value":"application/x-www-form-urlencoded"}],"body":{"mode":"urlencoded","urlencoded":[{"key":"username","value":"username","description":"required: true","type":"text"},{"key":"password","value":"password","description":"required: true, case sensitive","type":"text"}]},"url":"localhost:3000/login"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Connection","value":"keep-alive","name":"Connection","description":""},{"key":"Content-Length","value":"282","name":"Content-Length","description":""},{"key":"Content-Type","value":"application/json; charset=utf-8","name":"Content-Type","description":""},{"key":"Date","value":"Mon, 09 Oct 2017 20:17:41 GMT","name":"Date","description":""},{"key":"ETag","value":"W/\"11a-QFSNzwDRnXKpxgPl7X+Hq748TkM\"","name":"ETag","description":""},{"key":"X-Powered-By","value":"Express","name":"X-Powered-By","description":""}],"cookie":[],"responseTime":"68","body":"{\"success\":true,\"message\":\"Authenticated\",\"token\":\"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6InVzZXJuYW1lIiwiZW1haWwiOiJ1c2VybmFtZUB0ZXN0aW5nLmNvbSIsInVzZXJfY2xhc3MiOiJnZW5lcmFsIiwiaWF0IjoxNTA3NTgwMjYxLCJleHAiOjE1MDc2NjY2NjF9.EcYcGjpiZkmG6APIPSmX2iBz-FHNOGM4-gAWsvWTM4s\"}"}],"_postman_id":"1f86ad26-6d96-0e64-a06b-3ff2871de331"},{"name":"/me","id":"bea3eec3-3040-6e05-3b8a-7e50fd421a41","request":{"method":"GET","header":[{"key":"x-access-token","value":"","description":"<p>required: true</p>\n"}],"body":{"mode":"formdata","formdata":[]},"url":"localhost:3000/me","description":"<p>Returns a JSON object of the current user. Authorization required.</p>\n","urlObject":{"port":"3000","path":["me"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"f2d3f4d0-42dd-2da5-781e-e76f3e0c375a","name":"admin","originalRequest":{"method":"GET","header":[{"key":"x-access-token","value":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImFkbWluIiwiZW1haWwiOiJhZG1pbkB0ZXN0aW5nLmNvbSIsInVzZXJfY2xhc3MiOiJhZG1pbiIsImlhdCI6MTUwNzY0NzMwNSwiZXhwIjoxNTA3NzMzNzA1fQ.BPmWddd3ybJcBb8nIzv8Dj2zWxdYy8gHWhAhdgPArqg","description":"required: true","disabled":false}],"body":{"mode":"formdata","formdata":[]},"url":"localhost:3000/me"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Connection","value":"keep-alive","name":"Connection","description":""},{"key":"Content-Length","value":"199","name":"Content-Length","description":""},{"key":"Content-Type","value":"application/json; charset=utf-8","name":"Content-Type","description":""},{"key":"Date","value":"Tue, 10 Oct 2017 14:58:33 GMT","name":"Date","description":""},{"key":"ETag","value":"W/\"c7-KTLD44M93t2knnKii/jB+giODlA\"","name":"ETag","description":""},{"key":"X-Powered-By","value":"Express","name":"X-Powered-By","description":""}],"cookie":[],"responseTime":"57","body":"[{\"_id\":\"59dc5a5489e6f9110ffeb49d\",\"username\":\"admin\",\"password\":\"$2a$10$zYpXE.c4lJK2GSwRPGHlzuR806ZE.XovzP4lcaIkL3APUcI7P28hu\",\"email\":\"admin@testing.com\",\"__v\":0,\"classes\":[],\"user_class\":\"admin\"}]"}],"_postman_id":"bea3eec3-3040-6e05-3b8a-7e50fd421a41"},{"name":"/admin/users","id":"c8d2d5fe-1445-5fbd-9937-a9939b87f02a","request":{"method":"GET","header":[{"key":"x-access-token","value":""}],"body":{"mode":"formdata","formdata":[]},"url":"localhost:3000/admin/users","description":"<p>Lists all registered users. Requires 'admin' user_class. </p>\n","urlObject":{"port":"3000","path":["admin","users"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"c8d2d5fe-1445-5fbd-9937-a9939b87f02a"}],"id":"9577b586-651d-79d9-68ac-b2ee57b09f54","_postman_id":"9577b586-651d-79d9-68ac-b2ee57b09f54","description":""},{"name":"Notes","item":[{"name":"/notes","id":"ad4e0b95-61a1-6248-82b0-32144cae20e0","request":{"method":"GET","header":[{"key":"x-access-token","value":"","description":"<p>required: true</p>\n"}],"body":{"mode":"urlencoded","urlencoded":[]},"url":"localhost:3000/notes","description":"<p>Retrieves all notes and returns them as a JSON object. Requires 'x-access-token' retrieved from /login</p>\n","urlObject":{"port":"3000","path":["notes"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"ad4e0b95-61a1-6248-82b0-32144cae20e0"},{"name":"/notes","id":"7b41a2bd-0245-5ca9-2d19-ae7aa28fb44f","request":{"method":"POST","header":[{"key":"x-access-token","value":"","description":"<p>required</p>\n"},{"key":"Content-Type","value":"application/x-www-form-urlencoded"}],"body":{"mode":"urlencoded","urlencoded":[{"key":"name","value":"","description":"<p>type: string, required: true</p>\n","type":"text"},{"key":"class","value":"","description":"<p>type: string, required: true</p>\n","type":"text"},{"key":"content","value":"","description":"<p>type: string, required: true</p>\n","type":"text"},{"key":"pinned","value":"","description":"<p>type: boolean, required: false</p>\n","type":"text"}]},"url":"localhost:3000/notes/","description":"<p>Allows for authenticated users to create a new note in the database. </p>\n","urlObject":{"port":"3000","path":["notes",""],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"7b41a2bd-0245-5ca9-2d19-ae7aa28fb44f"},{"name":"/notes/id/:noteId","id":"9d13bafd-3d87-482d-e3e2-41b34b454c5f","request":{"method":"GET","header":[{"key":"x-access-token","value":"","description":"<p>required: true</p>\n"}],"body":{"mode":"formdata","formdata":[]},"url":"localhost:3000/notes/id/:noteId","description":"<p>Retrieves a specific note from the database by '_id'. Requires user authentication. </p>\n","urlObject":{"port":"3000","path":["notes","id",":noteId"],"host":["localhost"],"query":[],"variable":[{"type":"any","value":"","key":"noteId"}]}},"response":[],"_postman_id":"9d13bafd-3d87-482d-e3e2-41b34b454c5f"},{"name":"/notes/id/:noteId","id":"d59f5461-ac9f-20e3-69e2-42b494316bd3","request":{"method":"PUT","header":[{"key":"x-access-token","value":"","description":"<p>required: true</p>\n"},{"key":"Content-Type","value":"application/x-www-form-urlencoded"}],"body":{"mode":"urlencoded","urlencoded":[{"key":"name","value":"","description":"<p>type: string</p>\n","type":"text"},{"key":"class","value":"","description":"<p>type: string</p>\n","type":"text"},{"key":"content","value":"","description":"<p>type: string</p>\n","type":"text"},{"key":"pinned","value":"","description":"<p>type: boolean</p>\n","type":"text"}]},"url":"localhost:3000/notes/id/:noteId","description":"<p>Edits a specific note from the database by '_id'. Requires user authentication. </p>\n","urlObject":{"port":"3000","path":["notes","id",":noteId"],"host":["localhost"],"query":[],"variable":[{"type":"any","value":"","key":"noteId"}]}},"response":[],"_postman_id":"d59f5461-ac9f-20e3-69e2-42b494316bd3"},{"name":"/notes/id/:noteId","id":"ddc31b88-25fa-e861-77b4-b0f86b4fadba","request":{"method":"DELETE","header":[{"key":"Content-Type","value":"application/x-www-form-urlencoded"}],"body":{"mode":"urlencoded","urlencoded":[]},"url":"localhost:3000/notes/id/:noteId","description":"<p>Deletes a specific note from the database by '_id'. Requires user authentication. </p>\n","urlObject":{"port":"3000","path":["notes","id",":noteId"],"host":["localhost"],"query":[],"variable":[{"type":"any","value":"","key":"noteId"}]}},"response":[],"_postman_id":"ddc31b88-25fa-e861-77b4-b0f86b4fadba"},{"name":"/notes/class/:className","id":"384a0438-ef0e-d1d0-dc00-9221fcf08edc","request":{"method":"GET","header":[{"key":"x-access-token","value":"","description":"<p>required: true</p>\n"}],"body":{"mode":"formdata","formdata":[]},"url":"localhost:3000/notes/class/:classId","description":"<p>Returns all notes for the provided class id. Requires user authentication.</p>\n","urlObject":{"port":"3000","path":["notes","class",":classId"],"host":["localhost"],"query":[],"variable":[{"type":"any","value":"","key":"classId"}]}},"response":[{"id":"b57a49e1-dff5-7401-30c2-3334ab422a03","name":"CS101","originalRequest":{"method":"GET","header":[{"key":"x-access-token","value":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImdlbmVyYWwiLCJlbWFpbCI6ImdlbmVyYWxAdGVzdGluZy5jb20iLCJ1c2VyX2NsYXNzIjoiZ2VuZXJhbCIsImlhdCI6MTUwNzY0NjgyMCwiZXhwIjoxNTA3NzMzMjIwfQ.WtXMTMhAe9A-bw_saQU_93Z07sLgUauHftlVQMUCJks","description":"required: true","disabled":false}],"body":{"mode":"formdata","formdata":[]},"url":"localhost:3000/notes/class/CS101"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Connection","value":"keep-alive","name":"Connection","description":""},{"key":"Content-Length","value":"511","name":"Content-Length","description":""},{"key":"Content-Type","value":"application/json; charset=utf-8","name":"Content-Type","description":""},{"key":"Date","value":"Tue, 10 Oct 2017 14:50:40 GMT","name":"Date","description":""},{"key":"ETag","value":"W/\"1ff-HUJlGUyboMpSk5dCYp9HgtzBO+M\"","name":"ETag","description":""},{"key":"X-Powered-By","value":"Express","name":"X-Powered-By","description":""}],"cookie":[],"responseTime":"41","body":"[{\"_id\":\"59dc5f1e17984c121209add9\",\"name\":\"Remember to study for midterms!\",\"class\":\"CS101\",\"content\":\"HERE ARE SOME QUICK TIPS.\",\"__v\":0,\"created\":\"2017-10-10T05:48:14.870Z\",\"pinned\":true},{\"_id\":\"59dc69514ef139140b9c65fd\",\"name\":\"pin!\",\"class\":\"CS101\",\"content\":\"HELLO! i'm pinned too!\",\"__v\":0,\"created\":\"2017-10-10T06:31:45.257Z\",\"pinned\":true},{\"_id\":\"59dc69264ef139140b9c65fc\",\"name\":\"testing\",\"class\":\"CS101\",\"content\":\"HELLO! i'm not pinned\",\"__v\":0,\"created\":\"2017-10-10T06:31:02.803Z\",\"pinned\":false}]"}],"_postman_id":"384a0438-ef0e-d1d0-dc00-9221fcf08edc"},{"name":"/notes/pinned","id":"474ded18-1e35-a3cb-6903-c53ff64e08fb","request":{"method":"GET","header":[{"key":"x-access-token","value":"","description":"<p>required: true</p>\n"}],"body":{"mode":"urlencoded","urlencoded":[]},"url":"localhost:3000/notes/pinned","description":"<p>Retrieves all pinned notes from the database. Requires user authentication.</p>\n","urlObject":{"port":"3000","path":["notes","pinned"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"bfeb388c-a27e-8647-e92b-af6f004cdf5a","name":"Pinned Example","originalRequest":{"method":"GET","header":[{"key":"x-access-token","value":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6InRlc3RpbmciLCJlbWFpbCI6InRlc3RpbmdAZXhhbXBsZS5jb20iLCJ1c2VyX2NsYXNzIjoiYWRtaW4iLCJpYXQiOjE1MDc1OTYzMzIsImV4cCI6MTUwNzY4MjczMn0.CWkFuQIfWjYsB4Br-p3QS5_Nohl6cyy-ALrX9maLnfI","description":"required: true"}],"body":{"mode":"urlencoded","urlencoded":[]},"url":"localhost:3000/notes/pinned"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Connection","value":"keep-alive","name":"Connection","description":""},{"key":"Content-Length","value":"349","name":"Content-Length","description":""},{"key":"Content-Type","value":"application/json; charset=utf-8","name":"Content-Type","description":""},{"key":"Date","value":"Tue, 10 Oct 2017 14:50:15 GMT","name":"Date","description":""},{"key":"ETag","value":"W/\"15d-6moksWr9QKhhIBBSVheLthODEwY\"","name":"ETag","description":""},{"key":"X-Powered-By","value":"Express","name":"X-Powered-By","description":""}],"cookie":[],"responseTime":"52","body":"[{\"_id\":\"59dc5f1e17984c121209add9\",\"name\":\"Remember to study for midterms!\",\"class\":\"CS101\",\"content\":\"HERE ARE SOME QUICK TIPS.\",\"__v\":0,\"created\":\"2017-10-10T05:48:14.870Z\",\"pinned\":true},{\"_id\":\"59dc69514ef139140b9c65fd\",\"name\":\"pin!\",\"class\":\"CS101\",\"content\":\"HELLO! i'm pinned too!\",\"__v\":0,\"created\":\"2017-10-10T06:31:45.257Z\",\"pinned\":true}]"}],"_postman_id":"474ded18-1e35-a3cb-6903-c53ff64e08fb"},{"name":"/notes/all","id":"8acc3486-06f5-36fa-c25c-975f507ff4a8","request":{"method":"GET","header":[{"key":"x-access-token","value":"","description":"<p>required:true, user_class: admin</p>\n"}],"body":{"mode":"formdata","formdata":[]},"url":"localhost:3000/notes/all","description":"<p>Shows all notes regardless of class. Requires user to have 'admin' user class</p>\n","urlObject":{"port":"3000","path":["notes","all"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"3a48c49d-a0e8-2880-d88d-093b9ece1125","name":"Multiple classes with pinned posts","originalRequest":{"method":"GET","header":[{"key":"x-access-token","value":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImFkbWluIiwiZW1haWwiOiJhZG1pbkB0ZXN0aW5nLmNvbSIsInVzZXJfY2xhc3MiOiJhZG1pbiIsImlhdCI6MTUwNzY0NzMwNSwiZXhwIjoxNTA3NzMzNzA1fQ.BPmWddd3ybJcBb8nIzv8Dj2zWxdYy8gHWhAhdgPArqg","description":"required:true, user_class: admin","disabled":false}],"body":{"mode":"formdata","formdata":[]},"url":"localhost:3000/notes/all"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Connection","value":"keep-alive","name":"Connection","description":""},{"key":"Content-Length","value":"697","name":"Content-Length","description":""},{"key":"Content-Type","value":"application/json; charset=utf-8","name":"Content-Type","description":""},{"key":"Date","value":"Tue, 10 Oct 2017 14:57:54 GMT","name":"Date","description":""},{"key":"ETag","value":"W/\"2b9-KQpkP+ThwAfEws7lzXsmn3SKj4c\"","name":"ETag","description":""},{"key":"X-Powered-By","value":"Express","name":"X-Powered-By","description":""}],"cookie":[],"responseTime":"96","body":"[{\"_id\":\"59dc5f1e17984c121209add9\",\"name\":\"Remember to study for midterms!\",\"class\":\"CS101\",\"content\":\"HERE ARE SOME QUICK TIPS.\",\"__v\":0,\"created\":\"2017-10-10T05:48:14.870Z\",\"pinned\":true},{\"_id\":\"59dc69514ef139140b9c65fd\",\"name\":\"pin!\",\"class\":\"CS101\",\"content\":\"HELLO! i'm pinned too!\",\"__v\":0,\"created\":\"2017-10-10T06:31:45.257Z\",\"pinned\":true},{\"_id\":\"59dcdfc124d8570429fa20ed\",\"name\":\"CS100 Final Exam\",\"class\":\"CS100\",\"content\":\"Important topics: writing loops, etc.\",\"__v\":0,\"created\":\"2017-10-10T14:57:05.636Z\",\"pinned\":true},{\"_id\":\"59dc69264ef139140b9c65fc\",\"name\":\"testing\",\"class\":\"CS101\",\"content\":\"HELLO! i'm not pinned\",\"__v\":0,\"created\":\"2017-10-10T06:31:02.803Z\",\"pinned\":false}]"}],"_postman_id":"8acc3486-06f5-36fa-c25c-975f507ff4a8"}],"id":"bb86f003-7e7b-f1ff-8abb-5383ed798580","_postman_id":"bb86f003-7e7b-f1ff-8abb-5383ed798580","description":""},{"name":"Classes","item":[{"name":"/class","id":"4f2a448a-3a51-3ebe-752d-710cb131571b","request":{"method":"GET","header":[{"key":"x-access-token","value":"","description":"<p>required:true</p>\n"},{"key":"Content-Type","value":"application/x-www-form-urlencoded"}],"body":{"mode":"urlencoded","urlencoded":[{"key":"name","value":"","type":"text"},{"key":"maxStudents","value":"","type":"text"},{"key":"instructor","value":"","type":"text"}]},"url":"localhost:3000/class","description":"<p>Lists all classes available. Requires user authentication.</p>\n","urlObject":{"port":"3000","path":["class"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"4f2a448a-3a51-3ebe-752d-710cb131571b"},{"name":"/class","id":"95d9c8f9-8d8d-a5df-3f10-d2cf65a78c6d","request":{"method":"POST","header":[{"key":"x-access-token","value":"","description":"<p>required:true</p>\n"},{"key":"Content-Type","value":"application/x-www-form-urlencoded"}],"body":{"mode":"urlencoded","urlencoded":[{"key":"name","value":"","type":"text"},{"key":"maxStudents","value":"","type":"text"},{"key":"instructor","value":"","type":"text"}]},"url":"localhost:3000/class","description":"<p>Creates a class. Requires user authentication.</p>\n","urlObject":{"port":"3000","path":["class"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"f00ad3b7-47bc-d094-9f13-196bc97fe90b","name":"General Userclass","originalRequest":{"method":"POST","header":[{"key":"x-access-token","value":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImdlbmVyYWwiLCJlbWFpbCI6ImdlbmVyYWxAdGVzdGluZy5jb20iLCJ1c2VyX2NsYXNzIjoiZ2VuZXJhbCIsImlhdCI6MTUwNzYxNDU4MiwiZXhwIjoxNTA3NzAwOTgyfQ.YB218CSWiqIl3TXnZfIuPE67xJ3G6_svioZ_fNvv5Kc","description":"required:true","disabled":false},{"key":"Content-Type","value":"application/x-www-form-urlencoded","disabled":false}],"body":{"mode":"urlencoded","urlencoded":[{"key":"name","value":"CS100","type":"text"},{"key":"maxStudents","value":"1","type":"text"},{"key":"instructor","value":"general","type":"text"}]},"url":"localhost:3000/class"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Connection","value":"keep-alive","name":"Connection","description":""},{"key":"Content-Length","value":"68","name":"Content-Length","description":""},{"key":"Content-Type","value":"application/json; charset=utf-8","name":"Content-Type","description":""},{"key":"Date","value":"Tue, 10 Oct 2017 05:55:06 GMT","name":"Date","description":""},{"key":"ETag","value":"W/\"44-BicLVLXndHSRnb2XXPdnY3StlO0\"","name":"ETag","description":""},{"key":"X-Powered-By","value":"Express","name":"X-Powered-By","description":""}],"cookie":[],"responseTime":"33","body":"{\"success\":false,\"message\":\"You are not authorized to add a class.\"}"}],"_postman_id":"95d9c8f9-8d8d-a5df-3f10-d2cf65a78c6d"},{"name":"/class/:classId","id":"6a897750-432f-d768-1c11-bbc700762c09","request":{"method":"DELETE","header":[{"key":"x-access-token","value":"","description":"<p>required:true</p>\n"},{"key":"Content-Type","value":"application/x-www-form-urlencoded"}],"body":{"mode":"urlencoded","urlencoded":[]},"url":"localhost:3000/class/:classId","description":"<p>Deletes class by ID. Requires user authentication.</p>\n","urlObject":{"port":"3000","path":["class",":classId"],"host":["localhost"],"query":[],"variable":[{"type":"any","value":"","key":"classId"}]}},"response":[],"_postman_id":"6a897750-432f-d768-1c11-bbc700762c09"},{"name":"/class/:classId/students","id":"9ed70085-76e9-c651-88ed-8c1f7d59ba0a","request":{"method":"GET","header":[{"key":"x-access-token","value":"","description":"<p>required:true</p>\n"},{"key":"Content-Type","value":"application/x-www-form-urlencoded"}],"body":{"mode":"urlencoded","urlencoded":[]},"url":"localhost:3000/class/:classId/students","description":"<p>Retrieves list of students in a class. Requires user authentication.</p>\n","urlObject":{"port":"3000","path":["class",":classId","students"],"host":["localhost"],"query":[],"variable":[{"type":"any","value":"","key":"classId"}]}},"response":[],"_postman_id":"9ed70085-76e9-c651-88ed-8c1f7d59ba0a"},{"name":"/class/:classId/students/add","id":"8201533a-6c32-4640-05d5-cf0239ca85b0","request":{"method":"POST","header":[{"key":"x-access-token","value":""},{"key":"Content-Type","value":"application/x-www-form-urlencoded"}],"body":{"mode":"urlencoded","urlencoded":[{"key":"username","value":"","type":"text"}]},"url":"localhost:3000/class/:classId/students/add","description":"<p>Add student to class. Requires read/write access, such as 'instructor' or 'admin' user class. </p>\n","urlObject":{"port":"3000","path":["class",":classId","students","add"],"host":["localhost"],"query":[],"variable":[{"type":"any","value":"","key":"classId"}]}},"response":[],"_postman_id":"8201533a-6c32-4640-05d5-cf0239ca85b0"},{"name":"/class/:classId/students/delete","id":"228b1f25-8d41-7faf-d01b-85d41c38ef35","request":{"method":"POST","header":[{"key":"x-access-token","value":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImFkbWluIiwiZW1haWwiOiJhZG1pbkB0ZXN0aW5nLmNvbSIsInVzZXJfY2xhc3MiOiJhZG1pbiIsImlhdCI6MTUwNzYxNTE1NywiZXhwIjoxNTA3NzAxNTU3fQ.Qr4Qz4gE1vRdhBLwbMfQMqHziTlW2aae8F2I9w_37cE"},{"key":"Content-Type","value":"application/x-www-form-urlencoded"}],"body":{"mode":"urlencoded","urlencoded":[{"key":"username","value":"general","type":"text"}]},"url":"localhost:3000/class/:classId/students/delete","description":"<p>Remove student from class. Requires read/write access, such as 'instructor' or 'admin' user class. </p>\n","urlObject":{"port":"3000","path":["class",":classId","students","delete"],"host":["localhost"],"query":[],"variable":[{"type":"any","value":"","key":"classId"}]}},"response":[{"id":"2b22cfc2-f9f7-ca95-731e-cb5ee6098ad5","name":"Successful user delete","originalRequest":{"method":"POST","header":[{"key":"x-access-token","value":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImFkbWluIiwiZW1haWwiOiJhZG1pbkB0ZXN0aW5nLmNvbSIsInVzZXJfY2xhc3MiOiJhZG1pbiIsImlhdCI6MTUwNzYxNTE1NywiZXhwIjoxNTA3NzAxNTU3fQ.Qr4Qz4gE1vRdhBLwbMfQMqHziTlW2aae8F2I9w_37cE","description":"admin token","disabled":false},{"key":"x-access-token","value":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImdlbmVyYWwiLCJlbWFpbCI6ImdlbmVyYWxAdGVzdGluZy5jb20iLCJ1c2VyX2NsYXNzIjoiZ2VuZXJhbCIsImlhdCI6MTUwNzY0NjgyMCwiZXhwIjoxNTA3NzMzMjIwfQ.WtXMTMhAe9A-bw_saQU_93Z07sLgUauHftlVQMUCJks","description":"general token","disabled":true},{"key":"Content-Type","value":"application/x-www-form-urlencoded","disabled":false}],"body":{"mode":"urlencoded","urlencoded":[{"key":"username","value":"general","type":"text"}]},"url":"localhost:3000/class/59dc5e0817984c121209add8/students/delete"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Connection","value":"keep-alive","name":"Connection","description":""},{"key":"Content-Length","value":"56","name":"Content-Length","description":""},{"key":"Content-Type","value":"application/json; charset=utf-8","name":"Content-Type","description":""},{"key":"Date","value":"Tue, 10 Oct 2017 14:49:56 GMT","name":"Date","description":""},{"key":"ETag","value":"W/\"38-eYLsaepCxWnuWd+V6it3olkyH44\"","name":"ETag","description":""},{"key":"X-Powered-By","value":"Express","name":"X-Powered-By","description":""}],"cookie":[],"responseTime":"1361","body":"{\"success\":true,\"message\":\"removed general from class.\"}"},{"id":"c45114bc-5586-3d30-b993-14ff90209b6d","name":"Unauthorized user delete","originalRequest":{"method":"POST","header":[{"key":"x-access-token","value":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImFkbWluIiwiZW1haWwiOiJhZG1pbkB0ZXN0aW5nLmNvbSIsInVzZXJfY2xhc3MiOiJhZG1pbiIsImlhdCI6MTUwNzYxNTE1NywiZXhwIjoxNTA3NzAxNTU3fQ.Qr4Qz4gE1vRdhBLwbMfQMqHziTlW2aae8F2I9w_37cE","description":"admin token","disabled":true},{"key":"x-access-token","value":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImdlbmVyYWwiLCJlbWFpbCI6ImdlbmVyYWxAdGVzdGluZy5jb20iLCJ1c2VyX2NsYXNzIjoiZ2VuZXJhbCIsImlhdCI6MTUwNzY0NjgyMCwiZXhwIjoxNTA3NzMzMjIwfQ.WtXMTMhAe9A-bw_saQU_93Z07sLgUauHftlVQMUCJks","description":"general token","disabled":false},{"key":"Content-Type","value":"application/x-www-form-urlencoded","disabled":false}],"body":{"mode":"urlencoded","urlencoded":[{"key":"username","value":"general","type":"text"}]},"url":"localhost:3000/class/59dc5e0817984c121209add8/students/delete"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Connection","value":"keep-alive","name":"Connection","description":""},{"key":"Content-Length","value":"76","name":"Content-Length","description":""},{"key":"Content-Type","value":"application/json; charset=utf-8","name":"Content-Type","description":""},{"key":"Date","value":"Tue, 10 Oct 2017 14:49:32 GMT","name":"Date","description":""},{"key":"ETag","value":"W/\"4c-dJxRUnPZDUSGkwO0zHYJaYuCVwE\"","name":"ETag","description":""},{"key":"X-Powered-By","value":"Express","name":"X-Powered-By","description":""}],"cookie":[],"responseTime":"33","body":"{\"success\":false,\"message\":\"You are not authorized to delete from a class.\"}"}],"_postman_id":"228b1f25-8d41-7faf-d01b-85d41c38ef35"}],"id":"549c53f9-1016-4bef-c02f-3a0cecb2823d","description":"<p>API endpoint for class related actions. Requires authentication.</p>\n","_postman_id":"549c53f9-1016-4bef-c02f-3a0cecb2823d"}]}