{"info":{"_postman_id":"feff882e-5641-4483-b273-85fdd7db3e87","name":"Backend 2.1","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"description":"<html><head></head><body></body></html>","owner":"13049545","collectionId":"feff882e-5641-4483-b273-85fdd7db3e87","publishedId":"TzeTKq3t","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"publishDate":"2021-06-14T01:51:14.000Z"},"item":[{"name":"1. Registro de usuarios","id":"b86234dd-92a6-4c81-9b2a-201a6d04266d","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"username\": \"newuser\",\r\n    \"first_name\": \"javier\", \r\n    \"last_name\": \"perez\",\r\n    \"email\": \"jperez@uc.cl\", \r\n    \"password\": \"password1.\",\r\n    \"profile_picture\": \"https://www.pavilionweb.com/wp-content/uploads/2017/03/man-300x300.png\",\r\n    \"description\": \"soy una persona\"\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/users","description":"<p>Ruta para registrar a un usuario.</p>\n<p>Parámetros necesarios en body: username, first_name, last_name, email, password.</p>\n<p>Parámetros opcionales: profile_picture, description.</p>\n","urlObject":{"protocol":"http","port":"3000","path":["users"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"0c1cf122-63ca-471d-b4cb-45da0c68032c","name":"Successful request","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"username\": \"newuser\",\r\n    \"first_name\": \"javier\", \r\n    \"last_name\": \"perez\",\r\n    \"email\": \"jperez@uc.cl\", \r\n    \"password\": \"password1.\",\r\n    \"profile_picture\": \"https://www.pavilionweb.com/wp-content/uploads/2017/03/man-300x300.png\",\r\n    \"description\": \"soy una persona\"\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/users"},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"280"},{"key":"Date","value":"Tue, 15 Jun 2021 18:31:59 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"code\": 201,\n    \"msg\": \"User created successfully\",\n    \"data\": {\n        \"username\": \"newuser\",\n        \"first_name\": \"javier\",\n        \"last_name\": \"perez\",\n        \"email\": \"jperez@uc.cl\",\n        \"is_admin\": null,\n        \"profile_picture\": \"https://www.pavilionweb.com/wp-content/uploads/2017/03/man-300x300.png\",\n        \"description\": \"soy una persona\"\n    }\n}"},{"id":"f1f7d081-fe7b-4698-9708-2016475a8cc5","name":"Username already in use","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"username\": \"javi\",\r\n    \"first_name\": \"javiera\",\r\n    \"last_name\": \"rojas\",\r\n    \"email\": \"javi@uc.cl\",\r\n    \"password\": \"password1.\",\r\n    \"profile_picture\": \"https://www.pavilionweb.com/wp-content/uploads/2017/03/man-300x300.png\",\r\n    \"description\": \"soy una persona\"\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/users"},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"44"},{"key":"Date","value":"Mon, 14 Jun 2021 00:18:25 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"code\": 400,\n    \"msg\": \"username must be unique\"\n}"},{"id":"1472cde5-f310-4145-98f0-01f628bff313","name":"Email not in body","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"username\": \"newuser2\",\r\n    \"first_name\": \"javier\", \r\n    \"last_name\": \"perez\",\r\n    \"password\": \"password1.\",\r\n    \"profile_picture\": \"https://www.pavilionweb.com/wp-content/uploads/2017/03/man-300x300.png\",\r\n    \"description\": \"soy una persona\"\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/users"},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"46"},{"key":"Date","value":"Mon, 14 Jun 2021 00:38:32 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"code\": 400,\n    \"msg\": \"User.email cannot be null\"\n}"},{"id":"5554fa1f-b4c3-4130-abbd-0e274663d9b8","name":"Incorrect email format","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"username\": \"newuser4\",\r\n    \"first_name\": \"javier\", \r\n    \"last_name\": \"perez\",\r\n    \"email\": \"newuser4@uc.c\",\r\n    \"password\": \"password1.\",\r\n    \"profile_picture\": \"https://www.pavilionweb.com/wp-content/uploads/2017/03/man-300x300.png\",\r\n    \"description\": \"soy una persona\"\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/users"},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"75"},{"key":"Date","value":"Mon, 14 Jun 2021 02:14:10 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"code\": 400,\n    \"msg\": \"El email debe seguir el siguiente formato: xxxx@xxx.xx\"\n}"},{"id":"65e9a0dd-6c84-4ca9-aa9b-a9ca838cbb83","name":"Password too short","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"username\": \"newuser4\",\r\n    \"first_name\": \"javier\", \r\n    \"last_name\": \"perez\",\r\n    \"email\": \"newuser4@uc.cl\",\r\n    \"password\": \"pass\",\r\n    \"profile_picture\": \"https://www.pavilionweb.com/wp-content/uploads/2017/03/man-300x300.png\",\r\n    \"description\": \"soy una persona\"\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/users"},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"75"},{"key":"Date","value":"Mon, 14 Jun 2021 02:15:09 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"code\": 400,\n    \"msg\": \"El largo del password debe ser entre 6 y 30 caracteres\"\n}"}],"_postman_id":"b86234dd-92a6-4c81-9b2a-201a6d04266d"},{"name":"2. Inicio de sesión de usuario","id":"1aa9bac1-e7c8-403d-b9e2-047f5facf32c","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[]},"isInherited":false},"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"email\": \"jirojas5@uc.cl\",\r\n    \"password\": \"javi123\"\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/auth","description":"<p>Ruta para inicio de sesión de usuario.</p>\n<p>Parámetros necesarios en body: email, password.</p>\n","urlObject":{"protocol":"http","port":"3000","path":["auth"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"e01eaeea-4362-4654-b77d-3614fcee1032","name":"Successful request","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"email\": \"jirojas5@uc.cl\",\r\n    \"password\": \"javi123\"\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/auth"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"210"},{"key":"Date","value":"Mon, 14 Jun 2021 00:40:37 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"code\": 200,\n    \"msg\": \"User logged successfully\",\n    \"data\": {\n        \"access_token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOjMsImlhdCI6MTYyMzYzMTIzN30.wN9b77s6Zz6M1LtvXcm3uA4ilmiRb3jGN1UWHnsL6z0\",\n        \"token_type\": \"Bearer\"\n    }\n}"},{"id":"e861437a-e028-4ad9-a298-5b46ed83db15","name":"Wrong password","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"email\": \"jirojas5@uc.cl\",\r\n    \"password\": \"javi12\"\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/auth"},"status":"Unauthorized","code":401,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"37"},{"key":"Date","value":"Mon, 14 Jun 2021 00:41:50 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"code\": 401,\n    \"msg\": \"Invalid password\"\n}"},{"id":"99e63850-079b-4358-8940-09c3a06537f3","name":"Email not in body","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"password\": \"javi12\"\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/auth"},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"38"},{"key":"Date","value":"Mon, 14 Jun 2021 00:42:19 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"code\": 400,\n    \"msg\": \"No email provided\"\n}"},{"id":"85dc2aad-89fa-4f63-81af-3d8e7c31e3eb","name":"Email not registered","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"email\": \"jirojas@uc.cl\",\r\n    \"password\": \"javi123\"\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/auth"},"status":"Not Found","code":404,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"53"},{"key":"Date","value":"Mon, 14 Jun 2021 02:17:55 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"code\": 404,\n    \"msg\": \"No user found with jirojas@uc.cl\"\n}"},{"id":"43769e13-e433-49fd-b411-738d39d34961","name":"Admin log in successful","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"email\": \"admin@uc.cl\",\r\n    \"password\": \"admin123\"\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/auth"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"210"},{"key":"Date","value":"Tue, 15 Jun 2021 00:55:04 GMT"},{"key":"Connection","value":"keep-alive"}],"cookie":[],"responseTime":null,"body":"{\n    \"code\": 200,\n    \"msg\": \"User logged successfully\",\n    \"data\": {\n        \"access_token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOjQsImlhdCI6MTYyMzcxODUwNH0.UAE6R-h4RUIh7K4KWg-Wm4WHxikHuNWsZb6ToDBYZAE\",\n        \"token_type\": \"Bearer\"\n    }\n}"}],"_postman_id":"1aa9bac1-e7c8-403d-b9e2-047f5facf32c"},{"name":"3. Info logged user","id":"cbb33254-8cba-4a95-9017-4f66ad13739c","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"GET","header":[],"url":"http://localhost:3000/users/me","description":"<p>Ruta para obtener información de usuario logueado.</p>\n<p>Es necesario un Bearer Token válido para autenticación.</p>\n","urlObject":{"protocol":"http","port":"3000","path":["users","me"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"9ac2822b-4d81-4421-a700-01f405d53e3c","name":"Successful request","originalRequest":{"method":"GET","header":[],"url":"http://localhost:3000/users/me"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"292"},{"key":"Date","value":"Wed, 16 Jun 2021 01:27:09 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"code\": 200,\n    \"msg\": \"User found successfully\",\n    \"data\": {\n        \"id\": 3,\n        \"username\": \"javi\",\n        \"first_name\": \"Javiera\",\n        \"last_name\": \"Rojas\",\n        \"email\": \"jirojas5@uc.cl\",\n        \"is_admin\": false,\n        \"profile_picture\": \"https://www.pavilionweb.com/wp-content/uploads/2017/03/man-300x300.png\",\n        \"description\": \"soy una persona buena\"\n    }\n}"}],"_postman_id":"cbb33254-8cba-4a95-9017-4f66ad13739c"},{"name":"4. Info de un user","id":"6a88be93-3f94-42f2-a9a4-867bed728d86","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"GET","header":[],"url":"http://localhost:3000/users/:user_id","description":"<p>Ruta para obtener la información de cualquier usuario.</p>\n<p>Es necesario un Bearer Token válido para autenticación.</p>\n","urlObject":{"protocol":"http","port":"3000","path":["users",":user_id"],"host":["localhost"],"query":[],"variable":[{"type":"any","value":"1","key":"user_id"}]}},"response":[{"id":"feea27f2-ec80-4dbd-b25e-38fee9585058","name":"Successful request","originalRequest":{"method":"GET","header":[],"url":{"raw":"http://localhost:3000/users/:user_id","protocol":"http","host":["localhost"],"port":"3000","path":["users",":user_id"],"variable":[{"key":"user_id","value":"1"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"286"},{"key":"Date","value":"Wed, 16 Jun 2021 01:27:54 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"code\": 200,\n    \"msg\": \"User found successfully\",\n    \"data\": {\n        \"id\": 1,\n        \"username\": \"benja\",\n        \"first_name\": \"Benjamín\",\n        \"last_name\": \"Lepe\",\n        \"email\": \"balepe@uc.cl\",\n        \"is_admin\": false,\n        \"profile_picture\": \"https://www.pavilionweb.com/wp-content/uploads/2017/03/man-300x300.png\",\n        \"description\": \"soy una persona\"\n    }\n}"},{"id":"0de7f1de-2445-4da5-9cd6-e4f680f1fc00","name":"Invalid token","originalRequest":{"method":"GET","header":[],"url":{"raw":"http://localhost:3000/users/:user_id","protocol":"http","host":["localhost"],"port":"3000","path":["users",":user_id"],"variable":[{"key":"user_id","value":"1"}]}},"status":"Unauthorized","code":401,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"34"},{"key":"Date","value":"Mon, 14 Jun 2021 01:20:16 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"code\": 401,\n    \"msg\": \"invalid token\"\n}"},{"id":"04701f35-00d0-4c2f-97a8-428d9bc24a2e","name":"No token","originalRequest":{"method":"GET","header":[],"url":{"raw":"http://localhost:3000/users/:user_id","protocol":"http","host":["localhost"],"port":"3000","path":["users",":user_id"],"variable":[{"key":"user_id","value":"1"}]}},"status":"Unauthorized","code":401,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"41"},{"key":"Date","value":"Mon, 14 Jun 2021 01:21:56 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"code\": 401,\n    \"msg\": \"Authentication Error\"\n}"},{"id":"798fa596-7255-42c4-85fe-8c998e165d67","name":"User not found","originalRequest":{"method":"GET","header":[],"url":{"raw":"http://localhost:3000/users/:user_id","protocol":"http","host":["localhost"],"port":"3000","path":["users",":user_id"],"variable":[{"key":"user_id","value":"10"}]}},"status":"Not Found","code":404,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"35"},{"key":"Date","value":"Mon, 14 Jun 2021 01:30:24 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"code\": 404,\n    \"msg\": \"User not found\"\n}"},{"id":"36404d4a-5ca9-4438-adcd-abe5da11758e","name":"No token provided","originalRequest":{"method":"GET","header":[],"url":{"raw":"http://localhost:3000/users/:user_id","protocol":"http","host":["localhost"],"port":"3000","path":["users",":user_id"],"variable":[{"key":"user_id","value":"1"}]}},"status":"Unauthorized","code":401,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"41"},{"key":"Date","value":"Mon, 14 Jun 2021 01:49:36 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"code\": 401,\n    \"msg\": \"Authentication Error\"\n}"}],"_postman_id":"6a88be93-3f94-42f2-a9a4-867bed728d86"},{"name":"5. Modify logged user","id":"c33ef094-bc72-4f3b-87e9-3f92eef68a0a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"PATCH","header":[],"body":{"mode":"raw","raw":"{    \r\n    \"username\": \"javi\",\r\n    \"profile_picture\": \"https://www.pavilionweb.com/wp-content/uploads/2017/03/man-300x300.png\",\r\n    \"first_name\": \"Javiera\",\r\n    \"last_name\": \"Rojas\",\r\n    \"description\": \"soy una persona buena\",\r\n    \"email\": \"jirojas5@uc.cl\",\r\n    \"password\": \"javi123\",\r\n    \"confirm_password\": \"javi123\"\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/users/:user_id","description":"<p>Ruta para modificar un usuario.</p>\n<p>Es necesario un Bearer Token válido para autenticación.</p>\n<p>Por el momento un usuario no puede editar a un usuario distinto.</p>\n<p>Parámetros opcionales: username, first_name, last_name, profile_picture, description, email, password, confirm_password.</p>\n<p>Si se desea cambiar la contraseña, los campos password y confirm_password deben ser iguales.</p>\n","urlObject":{"protocol":"http","port":"3000","path":["users",":user_id"],"host":["localhost"],"query":[],"variable":[{"type":"any","value":"3","key":"user_id"}]}},"response":[{"id":"f750318c-7066-4b24-8861-92c5666ad3d5","name":"Successful request, modified description","originalRequest":{"method":"PATCH","header":[],"body":{"mode":"raw","raw":"{    \r\n    \"username\": \"javi\",\r\n    \"profile_picture\": \"https://www.pavilionweb.com/wp-content/uploads/2017/03/man-300x300.png\",\r\n    \"first_name\": \"Javiera\",\r\n    \"last_name\": \"Rojas\",\r\n    \"description\": \"soy una persona buena\",\r\n    \"email\": \"jirojas5@uc.cl\",\r\n    \"password\": \"javi123\",\r\n    \"confirm_password\": \"javi123\"\r\n}","options":{"raw":{"language":"json"}}},"url":{"raw":"http://localhost:3000/users/:user_id","protocol":"http","host":["localhost"],"port":"3000","path":["users",":user_id"],"variable":[{"key":"user_id","value":"3"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"295"},{"key":"Date","value":"Wed, 16 Jun 2021 01:28:52 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"code\": 200,\n    \"msg\": \"User modified successfully\",\n    \"data\": {\n        \"id\": 3,\n        \"username\": \"javi\",\n        \"first_name\": \"Javiera\",\n        \"last_name\": \"Rojas\",\n        \"email\": \"jirojas5@uc.cl\",\n        \"is_admin\": false,\n        \"profile_picture\": \"https://www.pavilionweb.com/wp-content/uploads/2017/03/man-300x300.png\",\n        \"description\": \"soy una persona buena\"\n    }\n}"},{"id":"64087420-9237-4c07-b23c-039da3a17a1b","name":"Can't modify other users","originalRequest":{"method":"PATCH","header":[],"body":{"mode":"raw","raw":"{\r\n    \"username\": \"user10\",\r\n    \"profile_picture\": \"https://www.pavilionweb.com/wp-content/uploads/2017/03/man-300x300.png\",\r\n    \"first_name\": \"Javiera\",\r\n    \"last_name\": \"Rojas\",\r\n    \"description\": \"soy una persona buena\",\r\n    \"email\": \"user2@uc.cl\",\r\n    \"password\": \"jarro96.\",\r\n    \"confirm_password\": \"jarro96.\"\r\n}","options":{"raw":{"language":"json"}}},"url":{"raw":"http://localhost:3000/users/:user_id","protocol":"http","host":["localhost"],"port":"3000","path":["users",":user_id"],"variable":[{"key":"user_id","value":"1"}]}},"status":"Forbidden","code":403,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"62"},{"key":"Date","value":"Mon, 14 Jun 2021 01:33:57 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"code\": 403,\n    \"msg\": \"You are not allowed to modify other users\"\n}"},{"id":"f68e1e41-5923-4d15-a3ff-a29265e8fba0","name":"New password and confirmation don't match","originalRequest":{"method":"PATCH","header":[],"body":{"mode":"raw","raw":"{\r\n    \"username\": \"user10\",\r\n    \"profile_picture\": \"https://www.pavilionweb.com/wp-content/uploads/2017/03/man-300x300.png\",\r\n    \"first_name\": \"Javiera\",\r\n    \"last_name\": \"Rojas\",\r\n    \"description\": \"soy una persona buena\",\r\n    \"email\": \"user2@uc.cl\",\r\n    \"password\": \"jarro96.\",\r\n    \"confirm_password\": \"jarro96\"\r\n}","options":{"raw":{"language":"json"}}},"url":{"raw":"http://localhost:3000/users/:user_id","protocol":"http","host":["localhost"],"port":"3000","path":["users",":user_id"],"variable":[{"key":"user_id","value":"1"}]}},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"67"},{"key":"Date","value":"Mon, 14 Jun 2021 01:34:42 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"code\": 400,\n    \"msg\": \"New password and confirmation are not the same\"\n}"},{"id":"9daa2be3-8bd0-4eef-a691-51a013260267","name":"Tried to modify username but it is already taken","originalRequest":{"method":"PATCH","header":[],"body":{"mode":"raw","raw":"{\r\n    \"username\": \"benja\",\r\n    \"profile_picture\": \"https://www.pavilionweb.com/wp-content/uploads/2017/03/man-300x300.png\",\r\n    \"first_name\": \"Javiera\",\r\n    \"last_name\": \"Rojas\",\r\n    \"description\": \"soy una persona buena\",\r\n    \"email\": \"user2@uc.cl\",\r\n    \"password\": \"jarro96.\",\r\n    \"confirm_password\": \"jarro96.\"\r\n}","options":{"raw":{"language":"json"}}},"url":{"raw":"http://localhost:3000/users/:user_id","protocol":"http","host":["localhost"],"port":"3000","path":["users",":user_id"],"variable":[{"key":"user_id","value":"3"}]}},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"44"},{"key":"Date","value":"Mon, 14 Jun 2021 01:38:42 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"code\": 400,\n    \"msg\": \"username must be unique\"\n}"},{"id":"713d5d79-2eac-4dcd-8a61-45b90fae785a","name":"Tried to modify email but it is already taken","originalRequest":{"method":"PATCH","header":[],"body":{"mode":"raw","raw":"{\r\n    \"username\": \"javi\",\r\n    \"profile_picture\": \"https://www.pavilionweb.com/wp-content/uploads/2017/03/man-300x300.png\",\r\n    \"first_name\": \"Javiera\",\r\n    \"last_name\": \"Rojas\",\r\n    \"description\": \"soy una persona buena\",\r\n    \"email\": \"jtcaraball@uc.cl\",\r\n    \"password\": \"jarro96.\",\r\n    \"confirm_password\": \"jarro96.\"\r\n}","options":{"raw":{"language":"json"}}},"url":{"raw":"http://localhost:3000/users/:user_id","protocol":"http","host":["localhost"],"port":"3000","path":["users",":user_id"],"variable":[{"key":"user_id","value":"3"}]}},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"41"},{"key":"Date","value":"Mon, 14 Jun 2021 01:40:14 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"code\": 400,\n    \"msg\": \"email must be unique\"\n}"}],"_postman_id":"c33ef094-bc72-4f3b-87e9-3f92eef68a0a"},{"name":"6. Obtener colección libros","id":"e8f13ba4-f0dc-4dd7-a6f8-3f6115f264b1","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:3000/books","description":"<p>Ruta para obtener todos los libros en la colección.</p>\n<p>No se necesitan parámetros en body.</p>\n","urlObject":{"protocol":"http","port":"3000","path":["books"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"6b7b91a9-6d77-4578-8812-754e90aaceee","name":"Successful request","originalRequest":{"method":"GET","header":[],"url":"http://localhost:3000/books"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"495"},{"key":"Date","value":"Tue, 15 Jun 2021 18:39:52 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"code\": 200,\n    \"msg\": \"Request successful\",\n    \"data\": [\n        {\n            \"id\": 1,\n            \"name\": \"1984\",\n            \"ISBN\": \"9780436350221\",\n            \"editorial\": \"Debolsillo\",\n            \"pages_number\": 328,\n            \"author\": \"George Orwell\",\n            \"genre\": \"Sci-Fi\"\n        },\n        {\n            \"id\": 2,\n            \"name\": \"100 años de soledad\",\n            \"ISBN\": \"9780065023961\",\n            \"editorial\": \"Państwowy Instytut Wydawniczy\",\n            \"pages_number\": 471,\n            \"author\": \"Gabriel García Márquez\",\n            \"genre\": \"Novel\"\n        },\n        {\n            \"id\": 3,\n            \"name\": \"Paula\",\n            \"ISBN\": \"9780060172534\",\n            \"editorial\": \"Plaza & Janés\",\n            \"pages_number\": 366,\n            \"author\": \"Isabel Allende\",\n            \"genre\": \"Novel\"\n        }\n    ]\n}"}],"_postman_id":"e8f13ba4-f0dc-4dd7-a6f8-3f6115f264b1"},{"name":"7. Create book","id":"c8b593b7-ff7c-4e69-8ac5-009c8430b2d8","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"name\": \"TestBook2\",\r\n    \"ISBN\": \"123-4-56666667\",\r\n    \"editorial\": \"TestEditorial2\",\r\n    \"genre\": \"TestGenre2\",\r\n    \"author\": \"TestAuthor2\",\r\n    \"pages_number\": \"1234\"\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/books","description":"<p>Create a book with a unique ISBN code.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>Request.body:\n{\n  \"name\": str,\n  \"ISBN\": str,\n  \"editorial\": str,\n  \"pages_number\": int,\n  \"author\": str,\n  \"genre\": str\n}\nResponse.body:\n{\n  \"code\": int,\n  \"msg\": str,\n  \"data\": Object(book)\n}\n</code></pre>","urlObject":{"protocol":"http","port":"3000","path":["books"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"9e873ee6-4750-4df1-9ad7-d41da8ce9090","name":"Successful request","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"name\": \"TestBook2\",\r\n    \"ISBN\": \"123-4-56666667\",\r\n    \"editorial\": \"TestEditorial2\",\r\n    \"genre\": \"TestGenre2\",\r\n    \"author\": \"TestAuthor2\",\r\n    \"pages_number\": \"1234\"\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/books"},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"198"},{"key":"Date","value":"Wed, 16 Jun 2021 01:33:51 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"code\": 201,\n    \"msg\": \"Book created successfully\",\n    \"data\": {\n        \"id\": 6,\n        \"name\": \"TestBook2\",\n        \"ISBN\": \"123-4-56666667\",\n        \"editorial\": \"TestEditorial2\",\n        \"pages_number\": 1234,\n        \"author\": \"TestAuthor2\",\n        \"genre\": \"TestGenre2\"\n    }\n}"},{"id":"5dea5ec6-f3b7-4c58-bf12-85d1297e5996","name":"Tried to create book with ISBN already in database","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"name\": \"TestBook2\",\r\n    \"ISBN\": \"123-4-56666667\",\r\n    \"editorial\": \"TestEditorial2\",\r\n    \"genre\": \"TestGenre2\",\r\n    \"author\": \"TestAuthor2\",\r\n    \"pages_number\": \"1234\"\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/books"},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"40"},{"key":"Date","value":"Wed, 16 Jun 2021 01:37:13 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"code\": 400,\n    \"msg\": \"ISBN must be unique\"\n}"}],"_postman_id":"c8b593b7-ff7c-4e69-8ac5-009c8430b2d8"},{"name":"8. Get book info","id":"ffa5c143-f6f7-415f-bf0b-7feaf9acbbed","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"GET","header":[],"url":"http://localhost:3000/books/:book_id","description":"<p>Get info of book with id equal to <code>book_id</code>. Requires authentication via Bearer Token.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>Response.body:\n{\n  \"code\": int,\n  \"msg\": str,\n  \"data\": Object(book)\n}\n</code></pre>","urlObject":{"protocol":"http","port":"3000","path":["books",":book_id"],"host":["localhost"],"query":[],"variable":[{"type":"any","value":"2","key":"book_id"}]}},"response":[{"id":"44ae4be9-8139-4252-a63d-89baf5fbd87e","name":"Successful request","originalRequest":{"method":"GET","header":[],"url":{"raw":"http://localhost:3000/books/:book_id","protocol":"http","host":["localhost"],"port":"3000","path":["books",":book_id"],"variable":[{"key":"book_id","value":"1"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"183"},{"key":"Date","value":"Wed, 16 Jun 2021 01:34:48 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"code\": 200,\n    \"msg\": \"Book found successfully\",\n    \"data\": {\n        \"id\": 1,\n        \"name\": \"1984\",\n        \"ISBN\": \"9780436350221\",\n        \"editorial\": \"Debolsillo\",\n        \"pages_number\": 328,\n        \"author\": \"George Orwell\",\n        \"genre\": \"Sci-Fi\"\n    }\n}"}],"_postman_id":"ffa5c143-f6f7-415f-bf0b-7feaf9acbbed"},{"name":"9. Edit book info (admin)","id":"2d6e342f-a51b-45e8-99c5-33ea97b0afbc","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"PATCH","header":[],"body":{"mode":"raw","raw":"{\r\n    \"name\": \"Paula\",\r\n    \"ISBN\": \"9780060172534\",\r\n    \"editorial\": \"Plaza & Janés\",\r\n    \"pages_number\": 367,\r\n    \"author\": \"Isabel Allende\",\r\n    \"genre\": \"Novel\"\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/books/:book_id","description":"<p>Edit info of a book with id equal to <code>book_id</code>. Requieres auth token and for the holder to be an admin.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>Request.body:\n{\n  \"name\": str,\n  \"ISBN\": str,\n  \"editorial\": str,\n  \"pages_number\": int,\n  \"author\": str,\n  \"genre\": str\n}\nResponse.body:\n{\n  \"code\": int,\n  \"msg\": str,\n  \"data\": Object(book)\n}\n</code></pre>","urlObject":{"protocol":"http","port":"3000","path":["books",":book_id"],"host":["localhost"],"query":[],"variable":[{"type":"any","value":"3","key":"book_id"}]}},"response":[{"id":"a2900595-3ac5-4601-a74e-0ec1d1b7012b","name":"Successful request (modified pages number)","originalRequest":{"method":"PATCH","header":[],"body":{"mode":"raw","raw":"{\r\n    \"name\": \"Paula\",\r\n    \"ISBN\": \"9780060172534\",\r\n    \"editorial\": \"Plaza & Janés\",\r\n    \"pages_number\": 367,\r\n    \"author\": \"Isabel Allende\",\r\n    \"genre\": \"Novel\"\r\n}","options":{"raw":{"language":"json"}}},"url":{"raw":"http://localhost:3000/books/:book_id","protocol":"http","host":["localhost"],"port":"3000","path":["books",":book_id"],"variable":[{"key":"book_id","value":"3"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"184"},{"key":"Date","value":"Tue, 15 Jun 2021 18:59:52 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"code\": 200,\n    \"msg\": \"Book modified successfully\",\n    \"data\": {\n        \"name\": \"Paula\",\n        \"ISBN\": \"9780060172534\",\n        \"editorial\": \"Plaza & Janés\",\n        \"pages_number\": 367,\n        \"author\": \"Isabel Allende\",\n        \"genre\": \"Novel\"\n    }\n}"},{"id":"f9403a0f-012b-4ab2-af34-f67760e2cf10","name":"Non admin user tried to modify book","originalRequest":{"method":"PATCH","header":[],"body":{"mode":"raw","raw":"{\r\n    \"name\": \"Paula\",\r\n    \"ISBN\": \"9780060172534\",\r\n    \"editorial\": \"Plaza & Janés\",\r\n    \"pages_number\": 367,\r\n    \"author\": \"Isabel Allende\",\r\n    \"genre\": \"Novel\"\r\n}","options":{"raw":{"language":"json"}}},"url":{"raw":"http://localhost:3000/books/:book_id","protocol":"http","host":["localhost"],"port":"3000","path":["books",":book_id"],"variable":[{"key":"book_id","value":"3"}]}},"status":"Forbidden","code":403,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"54"},{"key":"Date","value":"Wed, 16 Jun 2021 01:36:34 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"code\": 403,\n    \"msg\": \"Only admin users can modify books\"\n}"}],"_postman_id":"2d6e342f-a51b-45e8-99c5-33ea97b0afbc"},{"name":"10. Get book reviews","id":"c892edaa-05e6-4217-ae4a-3615ec25f8cd","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"GET","header":[],"url":"http://localhost:3000/books/:book_id/reviews?page=1","description":"<p>Get list of reviews for book with id equal to <code>book_id</code>.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>Response.body:\n{\n  \"code\": int,\n  \"msg\": str,\n  \"data\": [list of Object(review)]\n}\n</code></pre>","urlObject":{"protocol":"http","port":"3000","path":["books",":book_id","reviews"],"host":["localhost"],"query":[{"key":"page","value":"1"}],"variable":[{"type":"any","value":"1","key":"book_id"}]}},"response":[{"id":"3f3d2af7-fdf8-4021-83a4-9e77f0eb6f50","name":"Successful request","originalRequest":{"method":"GET","header":[],"url":{"raw":"http://localhost:3000/books/:book_id/reviews","protocol":"http","host":["localhost"],"port":"3000","path":["books",":book_id","reviews"],"variable":[{"key":"book_id","value":"1"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"334"},{"key":"Date","value":"Tue, 15 Jun 2021 19:32:38 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"code\": 200,\n    \"msg\": \"Request successful\",\n    \"data\": [\n        {\n            \"id\": 1,\n            \"UserId\": 1,\n            \"BookId\": 1,\n            \"title\": \"Reseña de 1984\",\n            \"body\": \"Orwell effectively explores the themes of mass media control, government surveillance, totalitarianism and how a dictator can manipulate and control history, thoughts, and lives in such a way that no one can escape it. \"\n        }\n    ]\n}"},{"id":"8e9dec40-3e4f-4b39-b10f-57534da0493d","name":"Request successful but book doesn't have reviews","originalRequest":{"method":"GET","header":[],"url":{"raw":"http://localhost:3000/books/:book_id/reviews","protocol":"http","host":["localhost"],"port":"3000","path":["books",":book_id","reviews"],"variable":[{"key":"book_id","value":"3"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"71"},{"key":"Date","value":"Tue, 15 Jun 2021 19:31:50 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"code\": 200,\n    \"msg\": \"Request successful, but book does not have reviews\"\n}"},{"id":"1a16ab43-d91b-4b0e-ac11-7dbc5a726ac8","name":"Book not found","originalRequest":{"method":"GET","header":[],"url":{"raw":"http://localhost:3000/books/:book_id/reviews","protocol":"http","host":["localhost"],"port":"3000","path":["books",":book_id","reviews"],"variable":[{"key":"book_id","value":"10"}]}},"status":"Not Found","code":404,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"35"},{"key":"Date","value":"Tue, 15 Jun 2021 19:34:17 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"code\": 404,\n    \"msg\": \"Book not found\"\n}"}],"_postman_id":"c892edaa-05e6-4217-ae4a-3615ec25f8cd"},{"name":"11. Create book review","id":"0baba3aa-df05-435f-a798-c7667de4ab48","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"body\": \"Cuerpo3\",\n    \"title\": \"Titulo3\"\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/books/:book_id/reviews","description":"<p>Create review for a book with id equal to <code>book_id</code>. Requires auth token.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>Request.body:\n{\n  \"title\": str,\n  \"body\": str,\n}\n\nResponse.body:\n{\n  \"code\": int,\n  \"msg\": str,\n  \"data\": Object(review)\n}\n</code></pre>","urlObject":{"protocol":"http","port":"3000","path":["books",":book_id","reviews"],"host":["localhost"],"query":[],"variable":[{"type":"any","value":"1","key":"book_id"}]}},"response":[{"id":"6bdeb3c8-17c0-46c9-b16b-e4ec4baf84d6","name":"Successful request","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"body\": \"Cuerpo3\",\n    \"title\": \"Titulo3\"\n}","options":{"raw":{"language":"json"}}},"url":{"raw":"http://localhost:3000/books/:book_id/reviews","protocol":"http","host":["localhost"],"port":"3000","path":["books",":book_id","reviews"],"variable":[{"key":"book_id","value":"1"}]}},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"114"},{"key":"Date","value":"Tue, 15 Jun 2021 19:52:47 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"code\": 201,\n    \"msg\": \"Review created successfully\",\n    \"data\": {\n        \"UserId\": 3,\n        \"BookId\": 1,\n        \"title\": \"Titulo3\",\n        \"body\": \"Cuerpo3\"\n    }\n}"},{"id":"77abcd4e-8232-4dad-9ca3-7841c863f392","name":"Book not found","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"body\": \"Cuerpo3\",\n    \"title\": \"Titulo3\"\n}","options":{"raw":{"language":"json"}}},"url":{"raw":"http://localhost:3000/books/:book_id/reviews","protocol":"http","host":["localhost"],"port":"3000","path":["books",":book_id","reviews"],"variable":[{"key":"book_id","value":"10"}]}},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"35"},{"key":"Date","value":"Tue, 15 Jun 2021 19:52:21 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"code\": 400,\n    \"msg\": \"Book not found\"\n}"}],"_postman_id":"0baba3aa-df05-435f-a798-c7667de4ab48"},{"name":"12. Get review","id":"3c252402-5f43-4a79-bf43-1f76b26646b7","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:3000/books/:book_id/reviews/:review_id","description":"<p>Get review with id <code>review_id</code> for a book with id <code>book_id</code>.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>Response.body:\n{\n  \"code\": int,\n  \"msg\": str,\n  \"data\": Object(review)\n}\n</code></pre>","urlObject":{"protocol":"http","port":"3000","path":["books",":book_id","reviews",":review_id"],"host":["localhost"],"query":[],"variable":[{"type":"any","value":"1","key":"book_id"},{"type":"any","value":"1","key":"review_id"}]}},"response":[{"id":"b395651c-fd07-4252-b2a4-9c10ba2b64aa","name":"Successful request","originalRequest":{"method":"GET","header":[],"url":{"raw":"http://localhost:3000/books/:book_id/reviews/:review_id","protocol":"http","host":["localhost"],"port":"3000","path":["books",":book_id","reviews",":review_id"],"variable":[{"key":"book_id","value":"1"},{"key":"review_id","value":"1"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"325"},{"key":"Date","value":"Tue, 15 Jun 2021 20:00:15 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"code\": 200,\n    \"msg\": \"Request successful\",\n    \"data\": {\n        \"UserId\": 1,\n        \"BookId\": 1,\n        \"title\": \"Reseña de 1984\",\n        \"body\": \"Orwell effectively explores the themes of mass media control, government surveillance, totalitarianism and how a dictator can manipulate and control history, thoughts, and lives in such a way that no one can escape it. \"\n    }\n}"},{"id":"4b442e4f-913b-4c62-b40f-df5f7d11e08d","name":"Book not found","originalRequest":{"method":"GET","header":[],"url":{"raw":"http://localhost:3000/books/:book_id/reviews/:review_id","protocol":"http","host":["localhost"],"port":"3000","path":["books",":book_id","reviews",":review_id"],"variable":[{"key":"book_id","value":"19"},{"key":"review_id","value":"1"}]}},"status":"Not Found","code":404,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"35"},{"key":"Date","value":"Tue, 15 Jun 2021 19:59:07 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"code\": 404,\n    \"msg\": \"Book not found\"\n}"},{"id":"21d1f2b8-3365-46ad-94cf-bd9c41376302","name":"Review not found","originalRequest":{"method":"GET","header":[],"url":{"raw":"http://localhost:3000/books/:book_id/reviews/:review_id","protocol":"http","host":["localhost"],"port":"3000","path":["books",":book_id","reviews",":review_id"],"variable":[{"key":"book_id","value":"1"},{"key":"review_id","value":"19"}]}},"status":"Not Found","code":404,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"37"},{"key":"Date","value":"Tue, 15 Jun 2021 19:59:59 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"code\": 404,\n    \"msg\": \"Review not found\"\n}"}],"_postman_id":"3c252402-5f43-4a79-bf43-1f76b26646b7"},{"name":"13. Edit book review","id":"b5c77dc6-7163-4867-a312-3c383cf31ccc","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"PATCH","header":[],"body":{"mode":"raw","raw":"{\n    \"title\": \"New title\",\n    \"body\": \"its the new body\"\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/books/:book_id/reviews/:review_id","description":"<p>Edit a review with id <code>review_id</code> for a book <code>book_id</code>. Requires auth token and for the holder to have id equal to the reviews <code>UserId</code> or be an admin.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>Request.body:\n{\n  \"title\": str,\n  \"body\": str,\n}\n\nResponse.body:\n{\n  \"code\": int,\n  \"msg\": str,\n  \"data\": Object(review)\n}\n</code></pre>","urlObject":{"protocol":"http","port":"3000","path":["books",":book_id","reviews",":review_id"],"host":["localhost"],"query":[],"variable":[{"type":"any","value":"1","key":"book_id"},{"type":"any","value":"4","key":"review_id"}]}},"response":[{"id":"ffeba346-71fd-439d-904b-ea710d758dab","name":"Successful request","originalRequest":{"method":"PATCH","header":[],"body":{"mode":"raw","raw":"{\n    \"title\": \"New title\",\n    \"body\": \"its the new body\"\n}","options":{"raw":{"language":"json"}}},"url":{"raw":"http://localhost:3000/books/:book_id/reviews/:review_id","protocol":"http","host":["localhost"],"port":"3000","path":["books",":book_id","reviews",":review_id"],"variable":[{"key":"book_id","value":"1"},{"key":"review_id","value":"4"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"125"},{"key":"Date","value":"Tue, 15 Jun 2021 20:07:22 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"code\": 200,\n    \"msg\": \"Review updated successfully\",\n    \"data\": {\n        \"UserId\": 3,\n        \"BookId\": 1,\n        \"title\": \"New title\",\n        \"body\": \"its the new body\"\n    }\n}"},{"id":"22079ac2-2ebe-4220-9e5e-6dce040d59b5","name":"Book not found","originalRequest":{"method":"PATCH","header":[],"body":{"mode":"raw","raw":"{\n    \"title\": \"New title\",\n    \"body\": \"its the new body\"\n}","options":{"raw":{"language":"json"}}},"url":{"raw":"http://localhost:3000/books/:book_id/reviews/:review_id","protocol":"http","host":["localhost"],"port":"3000","path":["books",":book_id","reviews",":review_id"],"variable":[{"key":"book_id","value":"10"},{"key":"review_id","value":"4"}]}},"status":"Not Found","code":404,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"35"},{"key":"Date","value":"Tue, 15 Jun 2021 20:06:21 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"code\": 404,\n    \"msg\": \"Book not found\"\n}"},{"id":"7b2e5285-f62a-47c2-9780-a697857768e1","name":"Permission denied","originalRequest":{"method":"PATCH","header":[],"body":{"mode":"raw","raw":"{\n    \"title\": \"New title\",\n    \"body\": \"its the new body\"\n}","options":{"raw":{"language":"json"}}},"url":{"raw":"http://localhost:3000/books/:book_id/reviews/:review_id","protocol":"http","host":["localhost"],"port":"3000","path":["books",":book_id","reviews",":review_id"],"variable":[{"key":"book_id","value":"1"},{"key":"review_id","value":"1"}]}},"status":"Forbidden","code":403,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"37"},{"key":"Date","value":"Tue, 15 Jun 2021 20:06:49 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"code\": 403,\n    \"msg\": \"Permision denied\"\n}"},{"id":"be3c07dd-ba47-44fd-a0f2-10ecd929e553","name":"Review not found","originalRequest":{"method":"PATCH","header":[],"body":{"mode":"raw","raw":"{\n    \"title\": \"New title\",\n    \"body\": \"its the new body\"\n}","options":{"raw":{"language":"json"}}},"url":{"raw":"http://localhost:3000/books/:book_id/reviews/:review_id","protocol":"http","host":["localhost"],"port":"3000","path":["books",":book_id","reviews",":review_id"],"variable":[{"key":"book_id","value":"1"},{"key":"review_id","value":"40"}]}},"status":"Not Found","code":404,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"37"},{"key":"Date","value":"Tue, 15 Jun 2021 20:08:15 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"code\": 404,\n    \"msg\": \"Review not found\"\n}"},{"id":"a2a7ba0d-a6cd-4a64-b167-f7cfe39a65f9","name":"Tried to modify BookId of review","originalRequest":{"method":"PATCH","header":[],"body":{"mode":"raw","raw":"{\n    \"title\": \"New title\",\n    \"body\": \"its the new body\",\n    \"BookId\": \"10\"\n}","options":{"raw":{"language":"json"}}},"url":{"raw":"http://localhost:3000/books/:book_id/reviews/:review_id","protocol":"http","host":["localhost"],"port":"3000","path":["books",":book_id","reviews",":review_id"],"variable":[{"key":"book_id","value":"1"},{"key":"review_id","value":"4"}]}},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"56"},{"key":"Date","value":"Tue, 15 Jun 2021 20:15:25 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"code\": 400,\n    \"msg\": \"You can not modify BookId of review\"\n}"},{"id":"d410c014-fb77-4f18-b59d-6332420ae29a","name":"Tried to modify UserId of review","originalRequest":{"method":"PATCH","header":[],"body":{"mode":"raw","raw":"{\n    \"title\": \"New title\",\n    \"body\": \"its the new body\",\n    \"UserId\": \"10\"\n}","options":{"raw":{"language":"json"}}},"url":{"raw":"http://localhost:3000/books/:book_id/reviews/:review_id","protocol":"http","host":["localhost"],"port":"3000","path":["books",":book_id","reviews",":review_id"],"variable":[{"key":"book_id","value":"1"},{"key":"review_id","value":"4"}]}},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"56"},{"key":"Date","value":"Tue, 15 Jun 2021 20:16:30 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"code\": 400,\n    \"msg\": \"You can not modify UserId of review\"\n}"}],"_postman_id":"b5c77dc6-7163-4867-a312-3c383cf31ccc"},{"name":"14. Get reviews from user","id":"f99ef7a0-a10a-409e-b40b-3f2d4eee0075","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"GET","header":[],"url":"http://localhost:3000/users/:user_id/reviews","urlObject":{"protocol":"http","port":"3000","path":["users",":user_id","reviews"],"host":["localhost"],"query":[],"variable":[{"type":"any","value":"1","key":"user_id"}]}},"response":[{"id":"90a46987-8a10-4926-9853-acceb32a5cc3","name":"Successful request","originalRequest":{"method":"GET","header":[],"url":{"raw":"http://localhost:3000/users/:user_id/reviews","protocol":"http","host":["localhost"],"port":"3000","path":["users",":user_id","reviews"],"variable":[{"key":"user_id","value":"3"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"529"},{"key":"Date","value":"Sat, 26 Jun 2021 21:59:30 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"code\": 200,\n    \"msg\": \"Reviews found successfully\",\n    \"data\": [\n        {\n            \"id\": 3,\n            \"UserId\": 3,\n            \"BookId\": 1,\n            \"title\": \"Titulo\",\n            \"body\": \"Cuerpo\"\n        },\n        {\n            \"id\": 5,\n            \"UserId\": 3,\n            \"BookId\": 1,\n            \"title\": \"Titulo2\",\n            \"body\": \"Cuerpo2\"\n        },\n        {\n            \"id\": 6,\n            \"UserId\": 3,\n            \"BookId\": 1,\n            \"title\": \"Titulo2\",\n            \"body\": \"Cuerpo2\"\n        },\n        {\n            \"id\": 7,\n            \"UserId\": 3,\n            \"BookId\": 1,\n            \"title\": \"Titulo3\",\n            \"body\": \"Cuerpo3\"\n        },\n        {\n            \"id\": 14,\n            \"UserId\": 3,\n            \"BookId\": 2,\n            \"title\": \"Titulo3\",\n            \"body\": \"Cuerpo3\"\n        },\n        {\n            \"id\": 15,\n            \"UserId\": 3,\n            \"BookId\": 1,\n            \"title\": \"Titulo3\",\n            \"body\": \"Cuerpo3\"\n        },\n        {\n            \"id\": 4,\n            \"UserId\": 3,\n            \"BookId\": 1,\n            \"title\": \"New title\",\n            \"body\": \"its the new body\"\n        }\n    ]\n}"},{"id":"1c7237f2-64f3-4931-96cd-0f88f48794fa","name":"Token not provided","originalRequest":{"method":"GET","header":[],"url":{"raw":"http://localhost:3000/users/:user_id/reviews","protocol":"http","host":["localhost"],"port":"3000","path":["users",":user_id","reviews"],"variable":[{"key":"user_id","value":"1"}]}},"status":"Unauthorized","code":401,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"41"},{"key":"Date","value":"Sat, 26 Jun 2021 21:57:21 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"code\": 401,\n    \"msg\": \"Authentication Error\"\n}"},{"id":"a36f4e7d-9e2d-45a4-9775-de3a6cfef717","name":"User not found","originalRequest":{"method":"GET","header":[],"url":{"raw":"http://localhost:3000/users/:user_id/reviews","protocol":"http","host":["localhost"],"port":"3000","path":["users",":user_id","reviews"],"variable":[{"key":"user_id","value":"500"}]}},"status":"Not Found","code":404,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"35"},{"key":"Date","value":"Sat, 26 Jun 2021 22:00:47 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"code\": 404,\n    \"msg\": \"User not found\"\n}"},{"id":"cc0ad36d-b74a-41de-a14c-74c23bbae01a","name":"Successful, but user hasn't written reviews","originalRequest":{"method":"GET","header":[],"url":{"raw":"http://localhost:3000/users/:user_id/reviews","protocol":"http","host":["localhost"],"port":"3000","path":["users",":user_id","reviews"],"variable":[{"key":"user_id","value":"4"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"73"},{"key":"Date","value":"Sat, 26 Jun 2021 22:11:31 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"code\": 200,\n    \"msg\": \"Request successful, but user has not written reviews\"\n}"}],"_postman_id":"f99ef7a0-a10a-409e-b40b-3f2d4eee0075"},{"name":"15. Get user liked reviews","id":"b6d1e6af-6e6f-4ec2-8960-2c991f0d0e85","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"GET","header":[],"url":"http://localhost:3000/users/:user_id/liked_reviews","urlObject":{"protocol":"http","port":"3000","path":["users",":user_id","liked_reviews"],"host":["localhost"],"query":[],"variable":[{"type":"any","value":"3","key":"user_id"}]}},"response":[{"id":"cbd74158-2d85-4091-8433-95353177fbe7","name":"Token not provided","originalRequest":{"method":"GET","header":[],"url":{"raw":"http://localhost:3000/users/:user_id/liked_reviews","protocol":"http","host":["localhost"],"port":"3000","path":["users",":user_id","liked_reviews"],"variable":[{"key":"user_id","value":"1"}]}},"status":"Unauthorized","code":401,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"41"},{"key":"Date","value":"Sat, 26 Jun 2021 22:13:42 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"code\": 401,\n    \"msg\": \"Authentication Error\"\n}"},{"id":"4e1783ea-8658-45e5-af1c-5f436a2c2c40","name":"Request successful, but user has not liked any reviews","originalRequest":{"method":"GET","header":[],"url":{"raw":"http://localhost:3000/users/:user_id/liked_reviews","protocol":"http","host":["localhost"],"port":"3000","path":["users",":user_id","liked_reviews"],"variable":[{"key":"user_id","value":"4"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"71"},{"key":"Date","value":"Sat, 26 Jun 2021 22:17:19 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"code\": 200,\n    \"msg\": \"Request successful, but user has not liked reviews\"\n}"}],"_postman_id":"b6d1e6af-6e6f-4ec2-8960-2c991f0d0e85"},{"name":"16. Post like","id":"ac850497-572b-42db-ba49-b26cad6428b0","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"POST","header":[],"url":"http://localhost:3000/books/:book_id/reviews/:review_id/likes","urlObject":{"protocol":"http","port":"3000","path":["books",":book_id","reviews",":review_id","likes"],"host":["localhost"],"query":[],"variable":[{"type":"any","value":"1","key":"book_id"},{"type":"any","value":"1","key":"review_id"}]}},"response":[{"id":"b766ab7d-dbd4-4136-a230-0d7faba914ac","name":"Token not provided","originalRequest":{"method":"POST","header":[],"url":{"raw":"http://localhost:3000/books/:book_id/reviews/:review_id/likes","protocol":"http","host":["localhost"],"port":"3000","path":["books",":book_id","reviews",":review_id","likes"],"variable":[{"key":"book_id","value":"1"},{"key":"review_id","value":"3"}]}},"status":"Unauthorized","code":401,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"41"},{"key":"Date","value":"Sat, 26 Jun 2021 22:25:52 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"code\": 401,\n    \"msg\": \"Authentication Error\"\n}"},{"id":"be3abcbc-7679-49c4-a42d-36ee9ffb8258","name":"Successful request","originalRequest":{"method":"POST","header":[],"url":{"raw":"http://localhost:3000/books/:book_id/reviews/:review_id/likes","protocol":"http","host":["localhost"],"port":"3000","path":["books",":book_id","reviews",":review_id","likes"],"variable":[{"key":"book_id","value":"1"},{"key":"review_id","value":"3"}]}},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"480"},{"key":"Date","value":"Sat, 26 Jun 2021 23:52:55 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"code\": 201,\n    \"msg\": \"Review liked successfully\",\n    \"data\": {\n        \"id\": 3,\n        \"UserId\": 3,\n        \"BookId\": 1,\n        \"title\": \"Titulo\",\n        \"body\": \"Cuerpo\",\n        \"likes\": [\n            {\n                \"id\": 3,\n                \"username\": \"javi\",\n                \"first_name\": \"Javiera\",\n                \"last_name\": \"Rojas\",\n                \"is_admin\": false,\n                \"email\": \"jirojas5@uc.cl\",\n                \"profile_picture\": \"https://www.pavilionweb.com/wp-content/uploads/2017/03/man-300x300.png\",\n                \"description\": \"soy una persona buena\",\n                \"Likes\": {\n                    \"createdAt\": \"2021-06-26T23:52:55.155Z\",\n                    \"updatedAt\": \"2021-06-26T23:52:55.155Z\",\n                    \"ReviewId\": 3,\n                    \"UserId\": 3\n                }\n            }\n        ]\n    }\n}"}],"_postman_id":"ac850497-572b-42db-ba49-b26cad6428b0"},{"name":"17. Unlike","id":"31ef5c66-4652-45a5-b9c2-a43b52115151","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"DELETE","header":[],"url":"http://localhost:3000/books/:book_id/reviews/:review_id/likes","urlObject":{"protocol":"http","port":"3000","path":["books",":book_id","reviews",":review_id","likes"],"host":["localhost"],"query":[],"variable":[{"type":"any","value":"1","key":"book_id"},{"type":"any","value":"1","key":"review_id"}]}},"response":[{"id":"dc597048-ff27-42ee-8a60-16d5026e3174","name":"Review not previously liked by user","originalRequest":{"method":"DELETE","header":[],"url":{"raw":"http://localhost:3000/books/:book_id/reviews/:review_id/likes","protocol":"http","host":["localhost"],"port":"3000","path":["books",":book_id","reviews",":review_id","likes"],"variable":[{"key":"book_id","value":"1"},{"key":"review_id","value":"3"}]}},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"45"},{"key":"Date","value":"Sat, 26 Jun 2021 23:51:28 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"code\": 400,\n    \"msg\": \"Review not liked by user\"\n}"},{"id":"9710391f-8866-4765-b67a-3c30fd2b65eb","name":"Successful request","originalRequest":{"method":"DELETE","header":[],"url":{"raw":"http://localhost:3000/books/:book_id/reviews/:review_id/likes","protocol":"http","host":["localhost"],"port":"3000","path":["books",":book_id","reviews",":review_id","likes"],"variable":[{"key":"book_id","value":"1"},{"key":"review_id","value":"3"}]}},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"130"},{"key":"Date","value":"Sat, 26 Jun 2021 23:53:02 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"code\": 201,\n    \"msg\": \"Review unliked successfully\",\n    \"data\": {\n        \"id\": 3,\n        \"UserId\": 3,\n        \"BookId\": 1,\n        \"title\": \"Titulo\",\n        \"body\": \"Cuerpo\",\n        \"likes\": []\n    }\n}"}],"_postman_id":"31ef5c66-4652-45a5-b9c2-a43b52115151"},{"name":"18. Delete book review","id":"47e57378-2b55-48bc-9f07-e929ff78183f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"DELETE","header":[],"url":"http://localhost:3000/books/:book_id/reviews/:review_id","description":"<p>Delete review with id <code>review_id</code> of book with id <code>book_id</code>. Request must include auth token corresponding to the owner of the review or to an admin.</p>\n","urlObject":{"protocol":"http","port":"3000","path":["books",":book_id","reviews",":review_id"],"host":["localhost"],"query":[],"variable":[{"type":"any","value":"1","key":"book_id"},{"type":"any","value":"3","key":"review_id"}]}},"response":[{"id":"dcbbcf32-4875-4b02-a1c4-190d6752152d","name":"Succesfull request","originalRequest":{"method":"DELETE","header":[],"url":{"raw":"http://localhost:3000/books/:book_id/reviews/:review_id","protocol":"http","host":["localhost"],"port":"3000","path":["books",":book_id","reviews",":review_id"],"variable":[{"key":"book_id","value":"1"},{"key":"review_id","value":"3"}]}},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"343"},{"key":"Date","value":"Tue, 29 Jun 2021 20:00:10 GMT"},{"key":"Connection","value":"keep-alive"}],"cookie":[],"responseTime":null,"body":"{\n    \"code\": 201,\n    \"msg\": \"Review deleted successfully\",\n    \"data\": [\n        {\n            \"id\": 1,\n            \"UserId\": 1,\n            \"BookId\": 1,\n            \"title\": \"Reseña de 1984\",\n            \"body\": \"Orwell effectively explores the themes of mass media control, government surveillance, totalitarianism and how a dictator can manipulate and control history, thoughts, and lives in such a way that no one can escape it. \"\n        }\n    ]\n}"}],"_postman_id":"47e57378-2b55-48bc-9f07-e929ff78183f"},{"name":"19. Post review report","id":"7e6791f2-582a-4821-b06d-8b440592278e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"comment\": \"This report is a test\"\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/books/:book_id/reviews/:review_id/reports","description":"<p>Post report for review with id <code>review_id</code> of book with id <code>book_id</code>. Request must include auth token corresponding to a user or admin.</p>\n","urlObject":{"protocol":"http","port":"3000","path":["books",":book_id","reviews",":review_id","reports"],"host":["localhost"],"query":[],"variable":[{"type":"any","value":"1","key":"book_id"},{"type":"any","value":"1","key":"review_id"}]}},"response":[{"id":"c4c509dd-42c7-459a-b040-54291201475d","name":"Succesfull request","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"comment\": \"This report is a test\"\n}","options":{"raw":{"language":"json"}}},"url":{"raw":"http://localhost:3000/books/:book_id/reviews/:review_id/reports","protocol":"http","host":["localhost"],"port":"3000","path":["books",":book_id","reviews",":review_id","reports"],"variable":[{"key":"book_id","value":"1"},{"key":"review_id","value":"1"}]}},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"122"},{"key":"Date","value":"Tue, 29 Jun 2021 20:08:46 GMT"},{"key":"Connection","value":"keep-alive"}],"cookie":[],"responseTime":null,"body":"{\n    \"code\": 201,\n    \"msg\": \"Report created successfully\",\n    \"data\": {\n        \"id\": 1,\n        \"UserId\": 3,\n        \"ReviewId\": 1,\n        \"comment\": \"This report is a test\"\n    }\n}"}],"_postman_id":"7e6791f2-582a-4821-b06d-8b440592278e"},{"name":"20. Get review reports (admin)","id":"1a4d82b4-e67a-4b45-a7ae-6f0f155de312","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"GET","header":[],"url":"http://localhost:3000/books/:book_id/reviews/:review_id/reports","description":"<p>Get reports for review with id <code>review_id</code> of book with id <code>book_id</code>. Request must include auth token corresponding to an admin.</p>\n","urlObject":{"protocol":"http","port":"3000","path":["books",":book_id","reviews",":review_id","reports"],"host":["localhost"],"query":[],"variable":[{"type":"any","value":"1","key":"book_id"},{"type":"any","value":"1","key":"review_id"}]}},"response":[{"id":"0314e9b4-233e-484d-b4a9-45e147573d59","name":"Succesfull request","originalRequest":{"method":"GET","header":[],"url":{"raw":"http://localhost:3000/books/:book_id/reviews/:review_id/reports","protocol":"http","host":["localhost"],"port":"3000","path":["books",":book_id","reviews",":review_id","reports"],"variable":[{"key":"book_id","value":"1"},{"key":"review_id","value":"1"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"123"},{"key":"Date","value":"Tue, 29 Jun 2021 20:16:15 GMT"},{"key":"Connection","value":"keep-alive"}],"cookie":[],"responseTime":null,"body":"{\n    \"code\": 200,\n    \"msg\": \"Reports found successfully\",\n    \"data\": [\n        {\n            \"id\": 1,\n            \"UserId\": 3,\n            \"ReviewId\": 1,\n            \"comment\": \"This report is a test\"\n        }\n    ]\n}"}],"_postman_id":"1a4d82b4-e67a-4b45-a7ae-6f0f155de312"},{"name":"Delete book (admin)","id":"3079ba1b-7285-4e76-af92-f9a6548c560d","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"DELETE","header":[],"url":"http://localhost:3000/admin/books/:book_id","description":"<p>Delete book with id <code>book_id</code>. Request must include auth token corresponding to an admin.</p>\n","urlObject":{"protocol":"http","port":"3000","path":["admin","books",":book_id"],"host":["localhost"],"query":[],"variable":[{"type":"any","value":"1","key":"book_id"}]}},"response":[{"id":"35594e29-ef48-4571-bcd6-2d49e1cab8e7","name":"Successful request","originalRequest":{"method":"DELETE","header":[],"url":{"raw":"http://localhost:3000/admin/books/:book_id","protocol":"http","host":["localhost"],"port":"3000","path":["admin","books",":book_id"],"variable":[{"key":"book_id","value":"1"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"370"},{"key":"Date","value":"Wed, 30 Jun 2021 15:44:06 GMT"},{"key":"Connection","value":"keep-alive"}],"cookie":[],"responseTime":null,"body":"{\n    \"code\": 200,\n    \"msg\": \"Book deleted successfully\",\n    \"data\": [\n        {\n            \"id\": 2,\n            \"name\": \"100 años de soledad\",\n            \"ISBN\": \"9780065023961\",\n            \"editorial\": \"Państwowy Instytut Wydawniczy\",\n            \"pages_number\": 471,\n            \"author\": \"Gabriel García Márquez\",\n            \"genre\": \"Novel\"\n        },\n        {\n            \"id\": 3,\n            \"name\": \"Paula\",\n            \"ISBN\": \"9780060172534\",\n            \"editorial\": \"Plaza & Janés\",\n            \"pages_number\": 366,\n            \"author\": \"Isabel Allende\",\n            \"genre\": \"Novel\"\n        }\n    ]\n}"}],"_postman_id":"3079ba1b-7285-4e76-af92-f9a6548c560d"},{"name":"Delete user (admin)","id":"615738bf-d369-4b87-9b91-13cb4d921435","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"DELETE","header":[],"url":"http://localhost:3000/admin/users/:user_id","description":"<p>Delete user with id <code>user_id</code>. Request must include auth token corresponding to an admin.</p>\n","urlObject":{"protocol":"http","port":"3000","path":["admin","users",":user_id"],"host":["localhost"],"query":[],"variable":[{"type":"any","value":"1","key":"user_id"}]}},"response":[{"id":"c085072e-f745-4fb4-9f14-0a011e57deb5","name":"Succesfful request","originalRequest":{"method":"DELETE","header":[],"url":{"raw":"http://localhost:3000/admin/users/:user_id","protocol":"http","host":["localhost"],"port":"3000","path":["admin","users",":user_id"],"variable":[{"key":"user_id","value":"1"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"762"},{"key":"Date","value":"Wed, 30 Jun 2021 15:47:58 GMT"},{"key":"Connection","value":"keep-alive"}],"cookie":[],"responseTime":null,"body":"{\n    \"code\": 200,\n    \"msg\": \"User deleted successfully\",\n    \"data\": [\n        {\n            \"id\": 2,\n            \"username\": \"jose\",\n            \"first_name\": \"Jose\",\n            \"last_name\": \"Caraball\",\n            \"is_admin\": false,\n            \"email\": \"jtcaraball@uc.cl\",\n            \"profile_picture\": \"https://www.pavilionweb.com/wp-content/uploads/2017/03/man-300x300.png\",\n            \"description\": \"soy una persona\"\n        },\n        {\n            \"id\": 3,\n            \"username\": \"javi\",\n            \"first_name\": \"Javiera\",\n            \"last_name\": \"Rojas\",\n            \"is_admin\": false,\n            \"email\": \"jirojas5@uc.cl\",\n            \"profile_picture\": \"https://www.pavilionweb.com/wp-content/uploads/2017/03/man-300x300.png\",\n            \"description\": \"soy una persona\"\n        },\n        {\n            \"id\": 4,\n            \"username\": \"admin\",\n            \"first_name\": \"Admin\",\n            \"last_name\": \"User\",\n            \"is_admin\": true,\n            \"email\": \"admin@uc.cl\",\n            \"profile_picture\": \"https://www.pavilionweb.com/wp-content/uploads/2017/03/man-300x300.png\",\n            \"description\": \"soy una administrador\"\n        }\n    ]\n}"}],"_postman_id":"615738bf-d369-4b87-9b91-13cb4d921435"}]}