{"info":{"_postman_id":"9c82b54f-8187-496b-96bb-6fcbad9280b3","name":"Teach LA Go Backend","description":"<html><head></head><body><p>TLA's Backend Documentation!</p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"10224331","collectionId":"9c82b54f-8187-496b-96bb-6fcbad9280b3","publishedId":"TW6xmnn2","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"publishDate":"2021-01-29T02:32:28.000Z"},"item":[{"name":"user","item":[{"name":"Get an user document with optional programs.","id":"c8a871d3-c09d-4d98-a2b7-a7657c2a883b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"GET","header":[],"url":"//user/get?uid=<string>&programs=<boolean>","urlObject":{"path":["user","get"],"host":["/"],"query":[{"description":{"content":"<p>The UID of the user to retrieve info about</p>\n","type":"text/plain"},"key":"uid","value":"<string>"},{"description":{"content":"<p>OPTIONAL: whether or not programs should be included in the response. Defaults to true.</p>\n","type":"text/plain"},"key":"programs","value":"<boolean>"}],"variable":[]}},"response":[{"id":"3c318416-7a59-49dc-9c33-6d1d0aa9bc63","name":"Unexpected server error: program acquisition","originalRequest":{"method":"GET","header":[],"url":{"raw":"//user/get?uid=validUID&programs=true","host":["/"],"path":["user","get"],"query":[{"key":"uid","value":"validUID","description":"The UID of the user to retrieve info about"},{"key":"programs","value":"true","description":"OPTIONAL: whether or not programs should be included in the response. Defaults to true."}]}},"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":"failed to get user's programs: ERRORMSG"},{"id":"786dddeb-fa19-49cf-9d4a-0404cf7db1ce","name":"Missing UID parameter","originalRequest":{"method":"GET","header":[],"url":{"raw":"//user/get?programs=<boolean>","host":["/"],"path":["user","get"],"query":[{"key":"uid","value":"<string>","description":"The UID of the user to retrieve info about","disabled":true},{"key":"programs","value":"<boolean>","description":"OPTIONAL: whether or not programs should be included in the response. Defaults to true."}]}},"status":"Bad Request","code":400,"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":"uid is a required query parameter"},{"id":"b5391faa-bcbe-470e-a965-713675de4b15","name":"User doc does not exist","originalRequest":{"method":"GET","header":[],"url":{"raw":"//user/get?uid=exists&programs=<boolean>","host":["/"],"path":["user","get"],"query":[{"key":"uid","value":"exists","description":"The UID of the user to retrieve info about"},{"key":"programs","value":"<boolean>","description":"OPTIONAL: whether or not programs should be included in the response. Defaults to true."}]}},"status":"Not Found","code":404,"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":"user does not exist"},{"id":"c8c0a79d-d717-4fb4-9023-b94ead23333e","name":"Nominal response (with programs)","originalRequest":{"method":"GET","header":[],"url":{"raw":"//user/get?uid=validUID&programs=true","host":["/"],"path":["user","get"],"query":[{"key":"uid","value":"validUID"},{"key":"programs","value":"true"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n    \"userData\": {\n        \"displayName\": \"Joe Bruin\",\n        \"mostRecentProgram\": \"HASH0\",\n        \"photoName\": \"icecream\",\n        \"programs\": [\n            \"HASH0\",\n            \"HASH1\"\n        ],\n        \"uid\": \"HASH2\"\n    },\n    \"programs\": {\n        \"HASH0\": {\n            \"code\": \"print(my cool code)\\n\",\n            \"dateCreated\": \"2020-02-07T08:41:00Z\",\n            \"language\": \"python\",\n            \"name\": \"Neat Program\",\n            \"thumbnail\": 12,\n            \"uid\": \"HASH0\"\n        },\n        \"HASH1\": {\n            \"code\": \"print(my cool code)\\n\",\n            \"dateCreated\": \"2020-02-07T08:41:00Z\",\n            \"language\": \"python\",\n            \"name\": \"Neat Program\",\n            \"thumbnail\": 12,\n            \"uid\": \"HASH0\"\n        }\n    }\n}"},{"id":"d67606a5-5655-4e29-9df5-3249dba2ada2","name":"Nominal response (without programs)","originalRequest":{"method":"GET","header":[],"url":{"raw":"//user/get?uid=<string>","host":["/"],"path":["user","get"],"query":[{"key":"uid","value":"<string>","description":"The UID of the user to retrieve info about"},{"key":"programs","value":"<boolean>","description":"OPTIONAL: whether or not programs should be included in the response. Defaults to true.","disabled":true}]}},"_postman_previewlanguage":"json","header":null,"cookie":[],"responseTime":null,"body":"{\n    \"userData\": {\n        \"displayName\": \"Joe Bruin\",\n        \"mostRecentProgram\": \"HASH0\",\n        \"photoName\": \"icecream\",\n        \"programs\": [\n            \"HASH0\",\n            \"HASH1\"\n        ],\n        \"uid\": \"HASH2\"\n    }\n}"},{"id":"e2090993-cd73-4d7e-b09f-2ced6c076687","name":"Unexpected server error: user acquisition","originalRequest":{"method":"GET","header":[],"url":{"raw":"//user/get?uid=<string>&programs=<boolean>","host":["/"],"path":["user","get"],"query":[{"key":"uid","value":"<string>","description":"The UID of the user to retrieve info about"},{"key":"programs","value":"<boolean>","description":"OPTIONAL: whether or not programs should be included in the response. Defaults to true."}]}},"status":"Internal Server Error","code":500,"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":"failed to get user data: ERRORMSG"}],"_postman_id":"c8a871d3-c09d-4d98-a2b7-a7657c2a883b"},{"name":"Update user data.","id":"eb60f210-f663-43ec-bcd0-8ad02c1385e9","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n    // all fields are optional **except for uid**.\n    \"uid\": \"<string>\",\n    \"displayName\": \"<string>\",\n    \"mostRecentProgram\": \"<string>\",\n    \"photoName\": \"<string>\"\n    // programs for a user can only be updated through calls to program endpoints.\n}"},"url":"//user/update","urlObject":{"path":["user","update"],"host":["/"],"query":[],"variable":[]}},"response":[{"id":"030cece1-7829-4591-86ce-f86e1ac1507d","name":"Missing UID","originalRequest":{"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\n    \"displayName\": \"Joe Bruin\",\n    \"mostRecentProgram\": \"HASH0\",\n    \"photoName\": \"icecream\",\n    \"programs\": [\n        \"HASH0\",\n        \"HASH1\"\n    ]\n}"},"url":"//user/update"},"status":"Bad Request","code":400,"_postman_previewlanguage":"text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"a uid is required"},{"id":"505ea180-579a-4bfa-90c8-624cc7896937","name":"Nominal response","originalRequest":{"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\n    \"displayName\": \"Joe Bruin\",\n    \"mostRecentProgram\": \"HASH0\",\n    \"photoName\": \"icecream\",\n    \"programs\": [\n        \"HASH0\",\n        \"HASH1\"\n    ],\n    \"uid\": \"HASH2\"\n}"},"url":"//user/update"},"status":"OK","code":200,"_postman_previewlanguage":"text","header":[{"key":"Content-Type","value":"text/plain"}],"cookie":[],"responseTime":null,"body":"user updated successfully"},{"id":"63c4cf29-f16a-496b-b336-e1393b2fe0bb","name":"Unexpected error: failed to update","originalRequest":{"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n    // all fields are optional **except for uid**.\n    \"displayName\": \"<string>\",\n    \"uid\": \"<string>\",\n    \"mostRecentProgram\": \"<string>\",\n    \"photoName\": \"<string>\"\n    // programs for a user can only be updated through calls to program endpoints.\n}"},"url":"//user/update"},"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":"failed to update user data: ERRORMSG"},{"id":"7eaaa767-04fd-44ce-b0df-88504124e57a","name":"User does not exist","originalRequest":{"method":"PUT","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n    // all fields are optional **except for uid**.\n    \"displayName\": \"<string>\",\n    \"uid\": \"doesn't exist\",\n    \"mostRecentProgram\": \"<string>\",\n    \"photoName\": \"<string>\"\n    // programs for a user can only be updated through calls to program endpoints.\n}","options":{"raw":{"language":"json"}}},"url":"//user/update"},"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":"user could not be found"},{"id":"d9942480-cacf-4357-b4ec-be01eb346162","name":"Not allowed: attempt to update user programs","originalRequest":{"method":"PUT","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"uid\": \"UID\",\n    \"programs\": [\n        \"HASH0\",\n        \"HASH1\"\n    ]\n}","options":{"raw":{"language":"json"}}},"url":"//user/update"},"status":"Bad Request","code":400,"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":"program list cannot be updated via /program/update"}],"_postman_id":"eb60f210-f663-43ec-bcd0-8ad02c1385e9"},{"name":"Create a new user with default programs.","id":"557c1216-a3b5-4113-ba05-1b8f7ed89658","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"uid\": <optional>\r\n}","options":{"raw":{"language":"json"}}},"url":"//user/create","urlObject":{"path":["user","create"],"host":["/"],"query":[],"variable":[]}},"response":[{"id":"30bddda2-90d0-43d9-9947-1574ef00651a","name":"Nominal response (with UID)","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"uid\": \"my new user ID\"\r\n}","options":{"raw":{"language":"json"}}},"url":"//user/create"},"status":"Created","code":201,"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":"{\r\n \"displayName\": \"Joe Bruin\",\r\n \"mostRecentProgram\": \"HASH0\",\r\n \"photoName\": \"icecream\",\r\n \"programs\": [\r\n  \"HASH0\",\r\n  \"HASH1\"\r\n ],\r\n \"uid\": \"my new user ID\"\r\n}"},{"id":"35cf23e7-a28d-4c35-95d7-9b05a28e8dd9","name":"User UID is already initialized","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"uid\": \"i already exist\"\r\n}","options":{"raw":{"language":"json"}}},"url":"//user/create"},"status":"Bad Request","code":400,"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":"user document with uid 'i already exist' already initialized"},{"id":"3b3d17d9-ce35-4883-af04-a3e885782e66","name":"Unexpected error","originalRequest":{"method":"POST","header":[],"url":"//user/create"},"status":"Internal Server Error","code":500,"_postman_previewlanguage":"text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"failed to create user: ERRORMSG"},{"id":"c18eb033-f4e6-453d-b248-3aaf9d1cbaf9","name":"Nominal response (no UID supplied)","originalRequest":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"uid\": \"\"\r\n}","options":{"raw":{"language":"json"}}},"url":"//user/create"},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n \"displayName\": \"Joe Bruin\",\n \"mostRecentProgram\": \"HASH0\",\n \"photoName\": \"icecream\",\n \"programs\": [\n  \"HASH0\",\n  \"HASH1\"\n ],\n \"uid\": \"HASH2\"\n}"}],"_postman_id":"557c1216-a3b5-4113-ba05-1b8f7ed89658"},{"name":"Delete an User and their Programs","id":"fdbc7773-17c8-4bae-ad65-74e0bfbd484f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[],"body":{"mode":"raw","raw":"{\r\n    \"uid\": \"STRING\"\r\n}","options":{"raw":{"language":"json"}}},"url":"//user/delete","urlObject":{"path":["user","delete"],"host":["/"],"query":[],"variable":[]}},"response":[{"id":"05be2319-dfb7-4b81-9840-bdaad5a6d42d","name":"Valid response","originalRequest":{"method":"DELETE","header":[],"body":{"mode":"raw","raw":"{\r\n    \"uid\": \"uidExists\"\r\n}","options":{"raw":{"language":"json"}}},"url":"//user/delete"},"status":"OK","code":200,"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":"user deleted successfully"},{"id":"066451b5-bc2e-4d8b-8f08-aea016a1a16d","name":"Empty body","originalRequest":{"method":"DELETE","header":[],"body":{"mode":"raw","raw":"","options":{"raw":{"language":"json"}}},"url":"//user/delete"},"status":"Bad Request","code":400,"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":"uid is required"},{"id":"c65bbba2-2685-4acb-907f-5c57ff8c0efa","name":"Not found","originalRequest":{"method":"DELETE","header":[],"body":{"mode":"raw","raw":"{\r\n    \"uid\": \"Does not exist\"\r\n}","options":{"raw":{"language":"json"}}},"url":"//user/delete"},"status":"Not Found","code":404,"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":"uid is required"},{"id":"e35bed4f-7e50-4063-ac4a-4677cd6a45b5","name":"Unexpected error","originalRequest":{"method":"DELETE","header":[],"body":{"mode":"raw","raw":"","options":{"raw":{"language":"json"}}},"url":"//user/delete"},"status":"Internal Server Error","code":500,"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":"failed to read request body: ERROR MESSAGE"}],"_postman_id":"fdbc7773-17c8-4bae-ad65-74e0bfbd484f"},{"name":"Get user classes","id":"8b72b46e-022d-4549-b07b-a6ef8c42c368","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"//user/classes?uid=<uid>","description":"<p>Gets the classes an user is in, and whether they are an instructor of said class.</p>\n","urlObject":{"path":["user","classes"],"host":["/"],"query":[{"description":{"content":"<p>UID of the user to get classes for.</p>\n","type":"text/plain"},"key":"uid","value":"<uid>"}],"variable":[]}},"response":[{"id":"0f434c85-820f-442b-92dd-024fa2a20bc9","name":"Nominal response","originalRequest":{"method":"GET","header":[],"url":{"raw":"//user/classes?cid=<cid>","host":["/"],"path":["user","classes"],"query":[{"key":"cid","value":"<cid>","description":"UID of the user to get classes for."}]}},"code":200,"_postman_previewlanguage":"json","header":null,"cookie":[],"responseTime":null,"body":"{\r\n    \"cid\": \"<string>\",\r\n    \"programs\": [],\r\n    \"WID\": \"<string>\",\r\n    \"creator\": \"<string>\",\r\n    \"instructors\": [],\r\n    \"members\": [],\r\n    \"name\": \"<string>\",\r\n    \"thumbnail\": 0\r\n}"}],"_postman_id":"8b72b46e-022d-4549-b07b-a6ef8c42c368"}],"id":"17d62a44-e1ea-4fa2-adab-f9fa9a9f0063","_postman_id":"17d62a44-e1ea-4fa2-adab-f9fa9a9f0063","description":""},{"name":"program","item":[{"name":"Get a Program document.","id":"be1d2280-ca52-4531-95ae-a48bb6636a81","request":{"auth":{"type":"noauth","isInherited":false},"method":"GET","header":[],"url":"//program/get?pid=<string>","urlObject":{"path":["program","get"],"host":["/"],"query":[{"description":{"content":"<p>(Required) The UID of the desired program.</p>\n","type":"text/plain"},"key":"pid","value":"<string>"}],"variable":[]}},"response":[{"id":"8275249c-ea1b-4d41-9c6d-f628c0696e8e","name":"Unexpected error","originalRequest":{"method":"GET","header":[],"url":{"raw":"//program/get?pid=<string>","host":["/"],"path":["program","get"],"query":[{"key":"pid","value":"<string>","type":"text"}]}},"status":"Internal Server Error","code":500,"_postman_previewlanguage":"text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"program could not be acquired: ERRORMSG"},{"id":"e1cda84c-0690-4828-849e-3633c2c8a272","name":"Program not found; invalid PID","originalRequest":{"method":"GET","header":[],"url":{"raw":"//program/get?pid=<string>","host":["/"],"path":["program","get"],"query":[{"key":"pid","value":"<string>","description":"(Required) The UID of the desired program."}]}},"status":"Not Found","code":404,"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":"program could not be found"},{"id":"e65400b2-6d1d-49f8-bc91-eac10e16eb10","name":"Missing PID","originalRequest":{"method":"GET","header":[],"url":{"raw":"//program/get","host":["/"],"path":["program","get"],"query":[{"key":"pid","value":"<string>","description":"(Required) The UID of the desired program.","disabled":true}]}},"status":"Bad Request","code":400,"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":"pid is required"},{"id":"eee44c91-9e0c-4b1e-a3cb-1276630ffe5a","name":"Nominal response","originalRequest":{"method":"GET","header":[],"url":{"raw":"//program/get?pid=<string>","host":["/"],"path":["program","get"],"query":[{"key":"pid","value":"<string>"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n    \"code\": \"print(my cool code)\\n\",\n    \"dateCreated\": \"2020-02-07T08:41:00Z\",\n    \"language\": \"python\",\n    \"name\": \"Neat Program\",\n    \"thumbnail\": 12,\n    \"uid\": \"HASH0\"\n}"}],"_postman_id":"be1d2280-ca52-4531-95ae-a48bb6636a81"},{"name":"Update an User's program.","id":"150e7067-8ff0-44b4-b2d4-ebca07197c4b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n    \"uid\": \"<string>\",\n    \"programs\": {\n        0: {\n            \"name\": \"<string>\",\n            \"code\": \"<string>\",\n            \"language\": \"<string>\",\n            \"thumbnail\": \"<long>\"\n        },\n        1: {\n            \"name\": \"<string>\",\n            \"code\": \"<string>\",\n            \"language\": \"<string>\",\n            \"thumbnail\": \"<long>\"\n        }\n    }\n}"},"url":"//program/update","urlObject":{"path":["program","update"],"host":["/"],"query":[],"variable":[]}},"response":[{"id":"3275d460-a610-406a-89b3-7b3725069935","name":"Error","originalRequest":{"method":"PUT","header":[],"body":{"mode":"raw","raw":"[\n    {\n        \"code\": \"print(my cool code)\\n\",\n        \"dateCreated\": \"2020-02-07T08:41:00Z\",\n        \"language\": \"python\",\n        \"name\": \"Neat Program\",\n        \"thumbnail\": 12,\n        \"uid\": \"HASH0\"\n    },\n    {\n        \"code\": \"print(my cool code)\\n\",\n        \"dateCreated\": \"2020-02-07T08:41:00Z\",\n        \"language\": \"python\",\n        \"name\": \"Neat Program\",\n        \"thumbnail\": 12,\n        \"uid\": \"HASH0\"\n    }\n]"},"url":"//program/update"},"status":"Internal Server Error","code":500,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"\"<string>\""},{"id":"48ab14ce-7b36-4777-9476-3f7f744f0f7a","name":"OK","originalRequest":{"method":"PUT","header":[],"body":{"mode":"raw","raw":"[\n    {\n        \"code\": \"print(my cool code)\\n\",\n        \"dateCreated\": \"2020-02-07T08:41:00Z\",\n        \"language\": \"python\",\n        \"name\": \"Neat Program\",\n        \"thumbnail\": 12,\n        \"uid\": \"HASH0\"\n    },\n    {\n        \"code\": \"print(my cool code)\\n\",\n        \"dateCreated\": \"2020-02-07T08:41:00Z\",\n        \"language\": \"python\",\n        \"name\": \"Neat Program\",\n        \"thumbnail\": 12,\n        \"uid\": \"HASH0\"\n    }\n]"},"url":"//program/update"},"status":"OK","code":200,"_postman_previewlanguage":"text","header":[{"key":"Content-Type","value":"text/plain"}],"cookie":[],"responseTime":null,"body":""}],"_postman_id":"150e7067-8ff0-44b4-b2d4-ebca07197c4b"},{"name":"Create a new program for an user.","id":"0ab7a4d6-3ef7-47dd-b768-6149c7e288c4","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n    \"uid\": \"<string>\",          // uid of the user the program belongs to\n    \"wid\": \"<string>\",          // (optional) wid of the class the program should be added to\n    \"program\": {\n        \"thumbnail\": \"<long>\",      // index of desired thumbnail\n        \"language\": \"<string>\",     // language string\n        \"name\": \"<string>\",         // name of the program\n        \"code\": \"<string>\"          // optional code for the program\n    }\n}"},"url":"//program/create","urlObject":{"path":["program","create"],"host":["/"],"query":[],"variable":[]}},"response":[{"id":"167600c5-36c8-412b-8204-a63d39de4a34","name":"Thumbnail out of bounds","originalRequest":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n    \"uid\": \"<string>\",          // uid of the user the program belongs to\n    \"thumbnail\": \"MAX + 1\",      // index of desired thumbnail\n    \"language\": \"<string>\",     // language string\n    \"name\": \"<string>\",         // name of the program\n    \"code\": \"<string>\"          // optional code for the program\n}"},"url":"//program/create"},"status":"Bad Request","code":400,"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":"thumbnail index out of bounds"},{"id":"172b2e31-2dcf-473f-8c76-5f7a4f2d13d0","name":"Language does not exist","originalRequest":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n    \"uid\": \"<string>\",          // uid of the user the program belongs to\n    \"thumbnail\": \"<long>\",      // index of desired thumbnail\n    \"language\": \"fake lang\",    // language string\n    \"name\": \"<string>\",         // name of the program\n    \"code\": \"<string>\"          // optional code for the program\n}"},"url":"//program/create"},"status":"Bad Request","code":400,"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":"language does not exist"},{"id":"7648721a-a450-48b9-80a1-00ea4eb85b44","name":"Unexpected error: fail to read request body","originalRequest":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":""},"url":"//program/create"},"status":"Internal Server Error","code":500,"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":"failed to read request body: ERRORMSG"},{"id":"c290ab5c-7dc0-4923-a0fb-8f2b6baa50cc","name":"Unexpected DB write error","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"uid\": \"HASH0\",\n    \"thumbnail\": 12,\n    \"language\": \"python\",\n    \"name\": \"My cool program.\",\n    \"code\": \"print(\\\"Hello world!\\\")\"\n}"},"url":"//program/create"},"status":"Internal Server Error","code":500,"_postman_previewlanguage":"text","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"failed to create program and associate to user or class"},{"id":"c8fc7399-7d14-430c-ad48-4b248a456d51","name":"Nominal response","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"uid\": \"HASH0\",\n    \"thumbnail\": 12,\n    \"language\": \"python\",\n    \"name\": \"My cool program.\",\n    \"code\": \"print(\\\"Hello world!\\\")\"\n}"},"url":"//program/create"},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n    \"code\": \"print(my cool code)\\n\",\n    \"dateCreated\": \"2020-02-07T08:41:00Z\",\n    \"language\": \"python\",\n    \"name\": \"Neat Program\",\n    \"thumbnail\": 12,\n    \"uid\": \"HASH0\",\n    \"wid\": \"happy,pig\"\n}"}],"_postman_id":"0ab7a4d6-3ef7-47dd-b768-6149c7e288c4"},{"name":"Delete a program from an user.","id":"89cfff13-b60c-4252-aa32-a444e805b8ec","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"DELETE","header":[],"body":{"mode":"raw","raw":"{\n    \"uid\": \"<string>\",\n    \"pid\": \"<string>\"\n}","options":{"raw":{"language":"json"}}},"url":"//program/delete","urlObject":{"path":["program","delete"],"host":["/"],"query":[],"variable":[]}},"response":[{"id":"35c45350-f5ec-41c6-88e5-23e29872cb0b","name":"Unexpected server error: failed to update","originalRequest":{"method":"DELETE","header":[],"body":{"mode":"raw","raw":"{\n    \"uid\": \"<string>\",\n    \"pid\": \"<string>\"\n}","options":{"raw":{"language":"json"}}},"url":"//program/delete"},"status":"Internal Server Error","code":500,"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":"failed to commit transaction to database: ERRORMSG"},{"id":"80034550-527b-413f-9f81-faa4535a95f1","name":"Nominal response","originalRequest":{"method":"DELETE","header":[],"url":{"raw":"//program/delete?uid=<string>&pid=<string>","host":["/"],"path":["program","delete"],"query":[{"key":"uid","value":"<string>"},{"key":"pid","value":"<string>"}]}},"status":"OK","code":200,"_postman_previewlanguage":"text","header":[{"key":"Content-Type","value":"text/plain"}],"cookie":[],"responseTime":null,"body":""},{"id":"9d44706c-1592-41ed-b5dc-d5604042d96d","name":"User or program does not exist","originalRequest":{"method":"DELETE","header":[],"body":{"mode":"raw","raw":"{\n    \"uid\": \"<string>\",\n    \"pid\": \"<string>\"\n}","options":{"raw":{"language":"json"}}},"url":"//program/delete"},"status":"Not Found","code":404,"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":"user or program does not exist"},{"id":"a8c34540-cab3-44cf-b912-4e612e16027e","name":"Missing UID or IDX field","originalRequest":{"method":"DELETE","header":[],"body":{"mode":"raw","raw":"{\n    \"uid\": \"<string>\"\n}","options":{"raw":{"language":"json"}}},"url":"//program/delete"},"status":"Bad Request","code":400,"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":"uid and pid fields are both required"},{"id":"cf01f5f2-4e8b-416c-bb8d-22b52a467e1e","name":"Unexpected server error: body cannot be read","originalRequest":{"method":"DELETE","header":[],"body":{"mode":"raw","raw":"{\n    \"uid\": \"<string>\",\n    \"pid\": \"<string>\"\n}","options":{"raw":{"language":"json"}}},"url":"//program/delete"},"status":"Internal Server Error","code":500,"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":"failed to read request body: ERRORMSG"}],"_postman_id":"89cfff13-b60c-4252-aa32-a444e805b8ec"},{"name":"Fork a program to your own user","id":"25b33b02-8eac-48e0-a434-1485679a72f4","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"url":"//program/fork?uid=<string>&pid=<string>","urlObject":{"path":["program","fork"],"host":["/"],"query":[{"description":{"content":"<p>User ID to fork the program to</p>\n","type":"text/plain"},"key":"uid","value":"<string>"},{"description":{"content":"<p>Program ID to fork</p>\n","type":"text/plain"},"key":"pid","value":"<string>"}],"variable":[]}},"response":[{"id":"19e913ff-6c41-4511-a1fc-78a0313511b9","name":"Unexpected error: could not fork","originalRequest":{"method":"POST","header":[],"url":{"raw":"//program/fork?pid=<string>&uid=<string>","host":["/"],"path":["program","fork"],"query":[{"key":"pid","value":"<string>","description":"Program ID to fork"},{"key":"uid","value":"<string>","description":"User ID to fork the program to"}]}},"status":"Internal Server Error","code":500,"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":"failed to fork program: ERROR MESSAGE"},{"id":"48108491-b388-4bf9-a4fd-95be0ac092bb","name":"User or program not found","originalRequest":{"method":"POST","header":[],"url":{"raw":"//program/fork?pid=<string>&uid=<string>","host":["/"],"path":["program","fork"],"query":[{"key":"pid","value":"<string>","description":"Program ID to fork"},{"key":"uid","value":"<string>","description":"User ID to fork the program to"}]}},"status":"Not Found","code":404,"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":"could not find the program or user"},{"id":"c0d167ae-23c9-4925-baf3-068d11208bc9","name":"Nominal response","originalRequest":{"method":"POST","header":[],"url":{"raw":"//program/fork?pid=exists&uid=existsAsWell","host":["/"],"path":["program","fork"],"query":[{"key":"pid","value":"exists","description":"Program ID to fork"},{"key":"uid","value":"existsAsWell","description":"User ID to fork the program to"}]}},"status":"Created","code":201,"_postman_previewlanguage":"json","header":null,"cookie":[],"responseTime":null,"body":"{\r\n    // copy of the program\r\n    \"code\": \"print(my cool code)\\n\",\r\n    \"dateCreated\": \"2020-02-07T08:41:00Z\",\r\n    \"language\": \"python\",\r\n    \"name\": \"Neat Program\",\r\n    \"thumbnail\": 12,\r\n    \"uid\": \"HASH0\"\r\n}"},{"id":"e45c0da9-2a68-4501-9166-8d6c0570bb19","name":"Missing UID or PID","originalRequest":{"method":"POST","header":[],"url":{"raw":"//program/fork?uid=<string>&pid=<string>","host":["/"],"path":["program","fork"],"query":[{"key":"uid","value":"<string>","description":"User ID to fork the program to"},{"key":"pid","value":"<string>","description":"Program ID to fork"}]}},"status":"Bad Request","code":400,"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":"uid and pid are both required"}],"_postman_id":"25b33b02-8eac-48e0-a434-1485679a72f4"}],"id":"526c40b5-cc46-4593-a4f2-f5dc90693c63","_postman_id":"526c40b5-cc46-4593-a4f2-f5dc90693c63","description":""},{"name":"class","item":[{"name":"Get a class object.","id":"2b39cd3c-1b3f-4a95-a30e-3c54322fd619","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n    \"uid\": \"<string>\",\n    \"cid\": \"<string>\"\n}"},"url":"//class/get?programs=<boolean>","urlObject":{"path":["class","get"],"host":["/"],"query":[{"description":{"content":"<p>Whether to return programs in the response.</p>\n","type":"text/plain"},"key":"programs","value":"<boolean>"}],"variable":[]}},"response":[{"id":"1562d277-4d54-469b-95bd-248be0d8a0b2","name":"Error","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"uid\": \"HASH0\",\n    \"cid\": \"HASH1\"\n}"},"url":"//class/get"},"status":"Internal Server Error","code":500,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"\"<string>\""},{"id":"fa048046-be4f-4543-98c7-aa2823657b62","name":"Class object with programs.","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"uid\": \"HASH0\",\n    \"cid\": \"HASH1\"\n}"},"url":{"raw":"//class/get?programs=true","host":["/"],"path":["class","get"],"query":[{"key":"programs","value":"true"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n \"thumbnail\": 2,\n \"name\": \"TeachLA's New Class Name!\",\n \"creator\": \"HASH0\",\n \"instructors\": [\n  \"HASH1\",\n  \"HASH2\"\n ],\n \"members\": [\n  \"HASH3\",\n  \"HASH4\",\n  \"HASH5\"\n ],\n \"programs\": [\n  \"HASH6\",\n  \"HASH7\"\n ],\n \"cid\": \"CLASS_HASH\",\n \"wid\": \"Metallic Funky Monkey\",\n \"programData\": [\n    {\n        \"code\": \"print(my cool code)\\n\",\n        \"dateCreated\": \"2020-02-07T08:41:00Z\",\n        \"language\": \"python\",\n        \"name\": \"Neat Program\",\n        \"thumbnail\": 12,\n        \"uid\": \"HASH0\"\n    }\n ]\n}"}],"_postman_id":"2b39cd3c-1b3f-4a95-a30e-3c54322fd619"},{"name":"Create a class.","id":"73751806-7735-422f-afdd-f4e5abd46660","request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n    \"uid\": \"<string>\",\n    \"name\": \"<string>\",\n    \"thumbnail\": \"<long>\"\n}"},"url":"//class/create","description":"<p>Create a class named {name} with thumbnail {thumbnail} on behalf of creator {uid}.</p>\n","urlObject":{"path":["class","create"],"host":["/"],"query":[],"variable":[]}},"response":[{"id":"25212dfb-39fa-4d1a-9505-40c4b2a2c562","name":"Class object.","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"uid\": \"HASH0\",\n    \"thumbnail\": 12,\n    \"name\": \"My cool class.\"\n}"},"url":"//class/create"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n \"thumbnail\": 2,\n \"name\": \"TeachLA's New Class Name!\",\n \"creator\": \"HASH0\",\n \"instructors\": [\n  \"HASH1\",\n  \"HASH2\"\n ],\n \"members\": [\n  \"HASH3\",\n  \"HASH4\",\n  \"HASH5\"\n ],\n \"programs\": [\n  \"HASH6\",\n  \"HASH7\"\n ],\n \"cid\": \"CLASS_HASH\",\n \"wid\": \"Metallic Funky Monkey\"\n}"},{"id":"c56ec731-cf4b-4b78-b23e-5ce1c5b90d0b","name":"Error.","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"uid\": \"HASH0\",\n    \"thumbnail\": 12,\n    \"name\": \"My cool class.\"\n}"},"url":"//class/create"},"status":"Internal Server Error","code":500,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"\"<string>\""}],"_postman_id":"73751806-7735-422f-afdd-f4e5abd46660"},{"name":"Join an user to a class.","id":"c2f1da67-11e9-4f6b-8c55-26d5263f6256","request":{"auth":{"type":"noauth","isInherited":false},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n    \"uid\": \"<string>\",\n    \"wid\": \"<string>\"\n}"},"url":"//class/join","description":"<p>Join an user {uid} to a class pointed to be word ID {wid}.</p>\n","urlObject":{"path":["class","join"],"host":["/"],"query":[],"variable":[]}},"response":[{"id":"07607351-d512-455f-8912-d9e05bf68482","name":"Error.","originalRequest":{"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\n    \"uid\": \"HASH0\",\n    \"wid\": \"Blue Monkey Car\"\n}"},"url":"//class/join"},"status":"Internal Server Error","code":500,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"\"<string>\""},{"id":"9be02e73-0827-4293-ae93-be5e0f0cfae6","name":"The updated class object.","originalRequest":{"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\n    \"uid\": \"HASH0\",\n    \"wid\": \"Blue Monkey Car\"\n}"},"url":"//class/join"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n \"thumbnail\": 2,\n \"name\": \"TeachLA's New Class Name!\",\n \"creator\": \"HASH0\",\n \"instructors\": [\n  \"HASH1\",\n  \"HASH2\"\n ],\n \"members\": [\n  \"HASH3\",\n  \"HASH4\",\n  \"HASH5\"\n ],\n \"programs\": [\n  \"HASH6\",\n  \"HASH7\"\n ],\n \"cid\": \"CLASS_HASH\",\n \"wid\": \"Metallic Funky Monkey\"\n}"}],"_postman_id":"c2f1da67-11e9-4f6b-8c55-26d5263f6256"},{"name":"Remove an user from a class.","id":"b0c066b5-d325-415a-a1f5-08b038411eae","request":{"auth":{"type":"noauth","isInherited":false},"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n    \"uid\": \"<string>\",\n    \"cid\": \"<string>\"\n}"},"url":"//class/leave","description":"<p>Remove an user with document ID {uid} from a class with document ID {cid}</p>\n","urlObject":{"path":["class","leave"],"host":["/"],"query":[],"variable":[]}},"response":[{"id":"14f1498b-0d1b-4459-8ef1-0fb26528f477","name":"Error.","originalRequest":{"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\n    \"uid\": \"HASH0\",\n    \"cid\": \"Blue Monkey Car\"\n}"},"url":"//class/leave"},"status":"Internal Server Error","code":500,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"\"<string>\""},{"id":"6e059338-c042-4fd3-87a2-ef536c9c65cd","name":"The updated user object.","originalRequest":{"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\n    \"uid\": \"HASH0\",\n    \"cid\": \"Blue Monkey Car\"\n}"},"url":"//class/leave"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n \"displayName\": \"Joe Bruin\",\n \"mostRecentProgram\": \"HASH0\",\n \"photoName\": \"icecream\",\n \"programs\": [\n  \"HASH0\",\n  \"HASH1\"\n ],\n \"uid\": \"HASH2\"\n}"},{"id":"95dab405-441a-4f25-a14d-3a03d68d9c4c","name":"Class or user not found","originalRequest":{"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n    \"uid\": \"<string>\",\n    \"cid\": \"<string>\"\n}"},"url":"//class/leave"},"status":"Not Found","code":404,"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":"ERROR MESSAGE"}],"_postman_id":"b0c066b5-d325-415a-a1f5-08b038411eae"}],"id":"dce0cf49-9007-4e3e-a332-91f50c2d09ab","_postman_id":"dce0cf49-9007-4e3e-a332-91f50c2d09ab","description":""},{"name":"collab","item":[{"name":"Create collaborative session","id":"91330fb3-5d83-4f75-a247-0531a7a4b3ed","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"uid\": <string> // UID of the owner\r\n}","options":{"raw":{"language":"json"}}},"url":"//collab/create","description":"<p>Starts a collaborative session and returns its ID.</p>\n","urlObject":{"path":["collab","create"],"host":["/"],"query":[],"variable":[]}},"response":[{"id":"6007b00d-934d-4feb-9289-1c9f7afe13aa","name":"Create collaborative session.","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"uid\": \"HASH0\"\r\n}","options":{"raw":{"language":"json"}}},"url":"//collab/create"},"status":"Created","code":201,"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":"UID0"},{"id":"86dccd73-f77d-4c7a-8040-c72b9fcdd26b","name":"Failed to read request body.","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"uid\": <string> // UID of the owner\r\n}","options":{"raw":{"language":"json"}}},"url":"//collab/create"},"status":"Internal Server Error","code":500,"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":"failed to read request body"}],"_postman_id":"91330fb3-5d83-4f75-a247-0531a7a4b3ed"},{"name":"Join collaborative session","id":"8f6265b2-d9c5-4a83-baf6-6a1925e43846","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"//collab/create?id","description":"<p>Join a collaborative session with the param id if it exists</p>\n","urlObject":{"path":["collab","create"],"host":["/"],"query":[{"key":"id","value":null}],"variable":[]}},"response":[],"_postman_id":"8f6265b2-d9c5-4a83-baf6-6a1925e43846"}],"id":"f8b3b9c2-3dc9-4769-a540-97cd0390aeb9","_postman_id":"f8b3b9c2-3dc9-4769-a540-97cd0390aeb9","description":""}],"variable":[{"id":"baseUrl","key":"baseUrl","value":"/","type":"string"}]}