diff --git a/assets/email/statusEmail/Accepted.hbs b/assets/email/statusEmail/Accepted.hbs index 6501edc4..a586300a 100644 --- a/assets/email/statusEmail/Accepted.hbs +++ b/assets/email/statusEmail/Accepted.hbs @@ -390,20 +390,9 @@ We’re thrilled to offer you a spot at McHacks! We can't wait to see what you create with us this year.

- Here are your next steps: -

Confirm your attendance on our hacker - dashboard no later than January 20th at 11:59PM EST. -

- Join the McHacks participants Facebook - group and Slack - for announcements, to chat with other hackers, ask questions, and form - teams! + dashboard no later than January 25th at 11:59PM EST.

If you can no longer attend McHacks, please let us know as soon as possible by withdrawing your application on our Hi, {{firstName}},

- Thanks for confirming your attendance and securing your spot at McHacks! + Thanks for confirming your attendance for McHacks! We hope you’re just + as excited as we are. Keep an eye out for our week-of email with more + details regarding McHacks. Happy hacking!

- Don't forget to join the McHacks participants
Facebook - group and Slack - for announcements, to chat with other hackers, ask questions, and form - teams! -

- If plans change and you can no longer attend McHacks, please let us know - as soon as - possible by withdrawing your application on our hacker - dashboard so we can pass your spot along to someone else. -

- In the meantime, follow us on Facebook, Twitter, and Instagram - for important updates and news about McHacks! If you have any questions, + for important updates about McHacks! If you have any questions, feel free to reach out at contact@mchacks.ca.

diff --git a/assets/email/statusEmail/Declined.hbs b/assets/email/statusEmail/Declined.hbs index 92b1c326..c4d682b9 100644 --- a/assets/email/statusEmail/Declined.hbs +++ b/assets/email/statusEmail/Declined.hbs @@ -394,24 +394,17 @@ unfortunately can't accept everyone. We hope you understand and encourage you to apply again in the future.

- If you’re still interested in attending McHacks, we’ve opened up our volunteer - applications as well. -

Follow us on Facebook, Twitter, and Instagram - for important updates and news about McHacks. + for important updates about McHacks.

If you have any questions, feel free to reach out at contact@mchacks.ca. -

- We hope to see you next year!

diff --git a/docs/api/api_data.js b/docs/api/api_data.js index ca4aee3b..25e0c5a6 100644 --- a/docs/api/api_data.js +++ b/docs/api/api_data.js @@ -1 +1,4150 @@ -define({ "api": [ { "type": "post", "url": "/account/", "title": "create a new account", "name": "create", "group": "Account", "version": "0.0.8", "parameter": { "fields": { "body": [ { "group": "body", "type": "String", "optional": false, "field": "firstName", "description": "

First name of the account creator.

" }, { "group": "body", "type": "String", "optional": false, "field": "lastName", "description": "

Last name of the account creator.

" }, { "group": "body", "type": "String", "optional": false, "field": "pronoun", "description": "

the pronoun of the account creator.

" }, { "group": "body", "type": "String", "optional": false, "field": "email", "description": "

Email of the account.

" }, { "group": "body", "type": "String", "optional": false, "field": "gender", "description": "

Gender of the account creator.

" }, { "group": "body", "type": "String[]", "optional": false, "field": "dietaryRestrictions", "description": "

Any dietary restrictions for the user. 'None' if there are no restrictions

" }, { "group": "body", "type": "String", "optional": false, "field": "password", "description": "

The password of the account.

" }, { "group": "body", "type": "String", "optional": false, "field": "birthDate", "description": "

a Date parsable string.

" }, { "group": "body", "type": "Number", "optional": true, "field": "phoneNumber", "description": "

the user's phone number, represented as a string.

" } ], "header": [ { "group": "header", "type": "JWT", "optional": true, "field": "token", "description": "

the user's invite token.

" } ] }, "examples": [ { "title": "Request-Example:", "content": "{ \n \"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"password\":\"hunter2\",\n \"phoneNumber\":1234567890,\n \"gender\":\"Male\",\n \"birthDate\":\"10/30/1997\"\n}", "type": "json" } ] }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

Account object

" } ] }, "examples": [ { "title": "Success-Response: ", "content": "{\n \"message\": \"Account creation successful\", \n \"data\": {\n \"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \t\"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"phoneNumber\":1234567890,\n \t\"gender\":\"Male\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", "type": "object" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "string", "optional": false, "field": "message", "description": "

Error message

" }, { "group": "Error 4xx", "type": "object", "optional": false, "field": "data", "description": "

empty

" } ] }, "examples": [ { "title": "Error-Response: ", "content": "{\n \"message\": \"Account already exists\", \n \"data\": {\n \"route\": \"/\"\n }\n}", "type": "object" } ] }, "filename": "routes/api/account.js", "groupTitle": "Account", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/account/" } ] }, { "type": "get", "url": "/account/:id", "title": "gets information from an account with mongoid ':id'", "name": "getAccount", "group": "Account", "version": "0.0.8", "parameter": { "fields": { "param": [ { "group": "param", "type": "ObjectId", "optional": false, "field": "id", "description": "

MongoId of an account

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

Account object

" } ] }, "examples": [ { "title": "Success-Response: ", "content": "{\n \"message\": \"Account found by user id\", \n \"data\": {\n \"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"phoneNumber\":1234567890,\n \"gender\":\"Male\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", "type": "object" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "string", "optional": false, "field": "message", "description": "

Error message

" }, { "group": "Error 4xx", "type": "object", "optional": false, "field": "data", "description": "

empty

" } ] }, "examples": [ { "title": "Error-Response: ", "content": "{\"message\": \"Account not found\", \"data\": {}}", "type": "object" } ] }, "filename": "routes/api/account.js", "groupTitle": "Account", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/account/:id" } ] }, { "type": "get", "url": "/account/invite", "title": "Get all of the invites.", "name": "getAllInvites", "group": "Account", "version": "0.0.8", "description": "

Get all of the invites that currently exist in the database.

", "success": { "examples": [ { "title": "Success-Response: ", "content": "{\n \"message\": \"Invite retrieval successful.\", \n \"data\": [{\n \"email\":\"abc@def.com\",\n \"accountType\":\"Hacker\"\n }]\n }", "type": "object" } ] }, "filename": "routes/api/account.js", "groupTitle": "Account", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/account/invite" } ] }, { "type": "post", "url": "/account/invite", "title": "invites a user to create an account with the specified accountType", "name": "inviteAccount", "group": "Account", "version": "0.0.8", "description": "

sends link with token to be used with the account/create route

", "parameter": { "fields": { "body": [ { "group": "body", "type": "String", "optional": true, "field": "email", "description": "

email of the account to be created and where to send the link

" }, { "group": "body", "type": "String", "optional": true, "field": "accountType", "description": "

the type of the account which the user can create, for sponsor this should specify tier as well

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

Account object

" } ] }, "examples": [ { "title": "Success-Response: ", "content": "{\n \"message\": \"Successfully invited user\", \n \"data\": {}\n }", "type": "object" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "string", "optional": false, "field": "message", "description": "

Error message

" }, { "group": "Error 4xx", "type": "object", "optional": false, "field": "data", "description": "

Error object

" } ] }, "examples": [ { "title": "Error-Response:", "content": "{\n \"message\": \"Invalid Authentication\",\n \"data\": {\n \"route\": \"/invite\"\n }\n }", "type": "object" } ] }, "filename": "routes/api/account.js", "groupTitle": "Account", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/account/invite" } ] }, { "type": "get", "url": "/account/self", "title": "get information about own account", "name": "self", "group": "Account", "version": "0.0.8", "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

Account object

" } ] }, "examples": [ { "title": "Success-Response: ", "content": "{\n \"message\": \"Account found by user email\", \n \"data\": {\n \t\"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \t\"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"phoneNumber\":1234567890,\n \t\"gender\":\"Male\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", "type": "object" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "string", "optional": false, "field": "message", "description": "

Error message

" }, { "group": "Error 4xx", "type": "object", "optional": false, "field": "data", "description": "

empty object

" } ] }, "examples": [ { "title": "Error-Response: ", "content": "{\"message\": \"Account not found\", \"data\": {}}", "type": "object" } ] }, "filename": "routes/api/account.js", "groupTitle": "Account", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/account/self" } ] }, { "type": "patch", "url": "/account/:id", "title": "update an account's information", "name": "updateOneUser", "group": "Account", "version": "0.0.8", "parameter": { "fields": { "body": [ { "group": "body", "type": "String", "optional": true, "field": "firstName", "description": "

First name of the account creator.

" }, { "group": "body", "type": "String", "optional": true, "field": "lastName", "description": "

Last name of the account creator.

" }, { "group": "body", "type": "String", "optional": true, "field": "pronoun", "description": "

The pronoun of the account creator.

" }, { "group": "body", "type": "String", "optional": true, "field": "email", "description": "

Email of the account.

" }, { "group": "body", "type": "String", "optional": true, "field": "gender", "description": "

Gender of the account creator.

" }, { "group": "body", "type": "String", "optional": true, "field": "birthDate", "description": "

A Date parsable string.

" }, { "group": "body", "type": "Number", "optional": true, "field": "phoneNumber", "description": "

The user's phone number, represented as a string.

" }, { "group": "body", "type": "String[]", "optional": true, "field": "dietaryRestrictions", "description": "

Any dietary restrictions for the user. 'None' if there are no restrictions

" } ] }, "examples": [ { "title": "Request-Example:", "content": "{ \"gender\": \"Male\" }", "type": "json" } ] }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

Account object

" } ] }, "examples": [ { "title": "Success-Response: ", "content": "{\n \"message\": \"Account update successful.\", \n \"data\": {\n \"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \t\"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"phoneNumber\":1234567890,\n \t\"gender\": \"Male\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", "type": "object" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "string", "optional": false, "field": "message", "description": "

Error message

" }, { "group": "Error 4xx", "type": "object", "optional": false, "field": "data", "description": "

empty

" } ] }, "examples": [ { "title": "Error-Response: ", "content": "{\"message\": \"Error while updating account\", \"data\": {}}", "type": "object" } ] }, "filename": "routes/api/account.js", "groupTitle": "Account", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/account/:id" } ] }, { "type": "patch", "url": "/auth/password/change", "title": "change password for logged in user", "name": "changePassword", "group": "Authentication", "version": "0.0.8", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "oldPassword", "description": "

The current password of the user

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "newPassword", "description": "

The new password of the user

" } ] }, "examples": [ { "title": "Request-Example:", "content": "{\n \"oldPassword\": \"password12345\",\n \"newPassword\": \"password123456\"\n}", "type": "json" } ] }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

empty

" } ] }, "examples": [ { "title": "Success-Response:", "content": "{\"message\": \"Successfully reset password\", \"data\": {}}", "type": "json" } ] }, "permission": [ { "name": ": Must be logged in" } ], "filename": "routes/api/auth.js", "groupTitle": "Authentication", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/auth/password/change" } ] }, { "type": "post", "url": "/auth/confirm/:token", "title": "confirm account using the JWT in :token", "name": "confirmAccount", "group": "Authentication", "version": "0.0.8", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "JWT", "description": "

for confirming the account

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

empty

" } ] }, "examples": [ { "title": "Success-Response:", "content": "{\"message\": \"Successfully confirmed account\", \"data\": {}}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "string", "optional": false, "field": "message", "description": "

Error message

" }, { "group": "Error 4xx", "type": "object", "optional": false, "field": "data", "description": "

empty

" } ] }, "examples": [ { "title": "Error-Response:", "content": "{\"message\": \"Invalid token for confirming account, \"data\": {}}", "type": "object" } ] }, "filename": "routes/api/auth.js", "groupTitle": "Authentication", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/auth/confirm/:token" } ] }, { "type": "post", "url": "/auth/password/forgot", "title": "forgot password route", "name": "forgotPassword", "group": "Authentication", "version": "0.0.8", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "email", "description": "

the email address of the account

" } ] }, "examples": [ { "title": "Request-Example:", "content": "{ \"email\": \"myemail@mchacks.ca\" }", "type": "json" } ] }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

empty

" } ] }, "examples": [ { "title": "Success-Response:", "content": "{\"message\": \"Sent reset email\", \"data\": {}}", "type": "json" } ] }, "permission": [ { "name": ": public" } ], "filename": "routes/api/auth.js", "groupTitle": "Authentication", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/auth/password/forgot" } ] }, { "type": "get", "url": "/auth/rolebindings/:id", "title": "retrieve rolebindings for a user given by their user id :id", "name": "getRoleBindings", "group": "Authentication", "version": "0.0.8", "parameter": { "fields": { "param": [ { "group": "param", "type": "ObjectId", "optional": false, "field": "id", "description": "

MongoId of an account

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

Rolebindings object

" } ] }, "examples": [ { "title": "Success-Response: ", "content": "{\n \"message\": \"Successfully retrieved role bindings\",\n \"data\": {\n accountId:\"5beca4ab2e069a34f91697b2\"\n id:\"5beca4ae2e069a34f91698b1\"\n roles: [\n {\n _id:\"5beca4ab2e069a34f91697d9\",\n name:\"hacker\",\n routes: [\n {_id: \"5beca4ae2e069a34f9169852\", requestType: \"POST\", uri: \"/api/auth/login\"},\n {_id: \"5beca4ae2e069a34f9169851\", requestType: \"POST\", uri: \"/api/auth/logout\"},\n {_id: \"5beca4ae2e069a34f9169850\", requestType: \"GET\", uri: \"/api/auth/rolebindings/:self\"},\n {_id: \"5beca4ae2e069a34f916984f\", requestType: \"GET\", uri: \"/api/account/self\"},\n {_id: \"5beca4ae2e069a34f916984e\", requestType: \"GET\", uri: \"/api/account/:self\"},\n {_id: \"5beca4ae2e069a34f916984d\", requestType: \"PATCH\", uri: \"/api/account/:self\"},\n {_id: \"5beca4ae2e069a34f916984c\", requestType: \"POST\", uri: \"/api/hacker/\"},\n {_id: \"5beca4ae2e069a34f916984b\", requestType: \"GET\", uri: \"/api/hacker/:self\"},\n {_id: \"5beca4ae2e069a34f916984a\", requestType: \"GET\", uri: \"/api/hacker/:self/resume\"},\n {_id: \"5beca4ae2e069a34f9169849\", requestType: \"PATCH\", uri: \"/api/hacker/:self\"}\n ]\n }\n ]\n }\n }", "type": "object" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "string", "optional": false, "field": "message", "description": "

Error message

" }, { "group": "Error 4xx", "type": "object", "optional": false, "field": "data", "description": "

empty

" } ] }, "examples": [ { "title": "Error-Response: ", "content": "{\"message\": \"Role Bindings not found\", \"data\": {}}", "type": "object" } ] }, "filename": "routes/api/auth.js", "groupTitle": "Authentication", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/auth/rolebindings/:id" } ] }, { "type": "get", "url": "/auth/roles", "title": "get roles", "name": "getRoles", "description": "

get all roles that exist in the database

", "group": "Authentication", "version": "0.0.8", "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

empty

" } ] }, "examples": [ { "title": "Success-Response:", "content": "{\"message\": \"Sucessfully retrieved all roles\", \"data\":\n[{name: \"GodStaff\", routes: Array(27), id: \"5bee20ef3ca9dd4754382880\"},\n {name: \"Hacker\", routes: Array(10), id: \"5bee20ef3ca9dd4754382881\"},\n {name: \"Volunteer\", routes: Array(4), id: \"5bee20ef3ca9dd4754382882\"}]", "type": "json" } ] }, "filename": "routes/api/auth.js", "groupTitle": "Authentication", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/auth/roles" } ] }, { "type": "post", "url": "/auth/login", "title": "login to the service", "name": "login", "group": "Authentication", "version": "0.0.8", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "string", "optional": false, "field": "email", "description": "

Account email

" }, { "group": "Parameter", "type": "string", "optional": false, "field": "password", "description": "

Account password

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

empty

" } ] }, "examples": [ { "title": "Success-Response: ", "content": "{\"message\": \"Successfully logged in\", \"data\": {}}", "type": "object" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "string", "optional": false, "field": "message", "description": "

Error message

" }, { "group": "Error 4xx", "type": "object", "optional": false, "field": "data", "description": "

empty

" } ] }, "examples": [ { "title": "Error-Response: ", "content": "{\"message\": \"Invalid Authentication\", \"data\": {}}", "type": "object" } ] }, "permission": [ { "name": ": public" } ], "filename": "routes/api/auth.js", "groupTitle": "Authentication", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/auth/login" } ] }, { "type": "get", "url": "/auth/logout", "title": "logout of service", "name": "logout", "group": "Authentication", "version": "0.0.8", "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

empty

" } ] }, "examples": [ { "title": "Success-Response:", "content": "{\"message\": \"Successfully logged out\", \"data\": {}}", "type": "object" } ] }, "permission": [ { "name": ": public" } ], "filename": "routes/api/auth.js", "groupTitle": "Authentication", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/auth/logout" } ] }, { "type": "get", "url": "/auth/confirm/resend", "title": "resend confirmation token", "name": "resendConfirmAccount", "group": "Authentication", "version": "0.0.8", "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

empty

" } ] }, "examples": [ { "title": "Success-Response:", "content": "{\"message\": \"Successfully resent confirmation email\", \"data\": {}}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "string", "optional": false, "field": "message", "description": "

Error message

" }, { "group": "Error 4xx", "type": "object", "optional": false, "field": "data", "description": "

empty

" } ] }, "examples": [ { "title": "Error-Response:", "content": " HTTP/1.1 422\n{\"message\": \"Account already confirmed\", \"data\": {}}", "type": "json" }, { "title": "Error-Response:", "content": " HTTP/1.1 428\n{\"message\": \"Account confirmation token does not exist\", \"data\": {}}", "type": "json" } ] }, "filename": "routes/api/auth.js", "groupTitle": "Authentication", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/auth/confirm/resend" } ] }, { "type": "post", "url": "/auth/password/reset", "title": "reset password", "name": "resetPassword", "group": "Authentication", "version": "0.0.8", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "password", "description": "

the password of the account

" } ] }, "examples": [ { "title": "Request-Example:", "content": "{ \"password\": \"hunter2\" }", "type": "json" } ] }, "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "Authentication", "description": "

the token that was provided in the reset password email

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Reset-Token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c\"\n}", "type": "json" } ] }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

empty

" } ] }, "examples": [ { "title": "Success-Response:", "content": "{\"message\": \"Successfully reset password\", \"data\": {}}", "type": "json" } ] }, "permission": [ { "name": ": must have authentication token" } ], "filename": "routes/api/auth.js", "groupTitle": "Authentication", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/auth/password/reset" } ] }, { "type": "patch", "url": "/hacker/batchAccept/", "title": "accept array of Hackers", "name": "acceptHacker", "group": "Hacker", "version": "3.0.0", "parameter": { "fields": { "body) {{ids: ObjectId[]}} Array of id(s": [ { "group": "body) {{ids: ObjectId[]}} Array of id(s", "optional": false, "field": "that", "description": "

needed to be accepted

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

success_ids array and errors array. Errors array will contain a detailed error for why the batch update for a given ID did not work

" } ] }, "examples": [ { "title": "Success-Response:", "content": "{\n \"message\": \"Hacker batch update successful.\",\n \"data\": {\n \"success_ids\": [\"id1\", \"id2\"]\n \"errors\": [{status: 404, message: \"ACCOUNT_NOT_FOUND\", account: null, hacker_id: \"id3\"}]\n }\n}", "type": "object" } ] }, "permission": [ { "name": "Administrator" } ], "filename": "routes/api/hacker.js", "groupTitle": "Hacker", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/hacker/batchAccept/" } ] }, { "type": "patch", "url": "/hacker/acceptEmail/:email", "title": "accept a Hacker by email", "name": "acceptHacker", "group": "Hacker", "version": "2.0.0", "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

Hacker object

" } ] }, "examples": [ { "title": "Success-Response:", "content": "{\n \"message\": \"Changed hacker information\",\n \"data\": {\n \"status\": \"Accepted\"\n }\n}", "type": "object" } ] }, "permission": [ { "name": "Administrator" } ], "filename": "routes/api/hacker.js", "groupTitle": "Hacker", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/hacker/acceptEmail/:email" } ] }, { "type": "patch", "url": "/hacker/accept/:id", "title": "accept a Hacker", "name": "acceptHacker", "group": "Hacker", "version": "2.0.0", "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

Hacker object

" } ] }, "examples": [ { "title": "Success-Response:", "content": "{\n \"message\": \"Changed hacker information\",\n \"data\": {\n \"status\": \"Accepted\"\n }\n}", "type": "object" } ] }, "permission": [ { "name": "Administrator" } ], "filename": "routes/api/hacker.js", "groupTitle": "Hacker", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/hacker/accept/:id" } ] }, { "type": "patch", "url": "/hacker/checkin/:id", "title": "update a hacker's status to be 'Checked-in'. Note that the Hacker must eitehr be Accepted or Confirmed.", "name": "checkinHacker", "group": "Hacker", "version": "0.0.9", "parameter": { "fields": { "body": [ { "group": "body", "type": "string", "optional": true, "field": "status", "description": "

Check-in status. "Checked-in"

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

Hacker object

" } ] }, "examples": [ { "title": "Success-Response:", "content": "{\n \"message\": \"Changed hacker information\",\n \"data\": {\n \"status\": \"Checked-in\"\n }\n}", "type": "object" } ] }, "permission": [ { "name": "Administrator" }, { "name": "Volunteer" } ], "filename": "routes/api/hacker.js", "groupTitle": "Hacker", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/hacker/checkin/:id" } ] }, { "type": "post", "url": "/hacker/", "title": "create a new hacker", "name": "createHacker", "group": "Hacker", "version": "0.0.8", "parameter": { "fields": { "body": [ { "group": "body", "type": "MongoID", "optional": false, "field": "accountId", "description": "

ObjectID of the respective account

" }, { "group": "body", "type": "String", "optional": false, "field": "school", "description": "

Name of the school the hacker goes to

" }, { "group": "body", "type": "String", "optional": false, "field": "gender", "description": "

Gender of the hacker

" }, { "group": "body", "type": "Number", "optional": false, "field": "travel", "description": "

Whether the hacker requires a bus for transportation

" }, { "group": "body", "type": "String[]", "optional": false, "field": "ethnicity", "description": "

the ethnicities of the hacker

" }, { "group": "body", "type": "String[]", "optional": false, "field": "major", "description": "

the major of the hacker

" }, { "group": "body", "type": "Number", "optional": false, "field": "graduationYear", "description": "

the graduation year of the hacker

" }, { "group": "body", "type": "Boolean", "optional": false, "field": "codeOfConduct", "description": "

acceptance of the code of conduct

" }, { "group": "body", "type": "Json", "optional": false, "field": "application", "description": "

The hacker's application. Resume and jobInterest fields are required.

" } ] }, "examples": [ { "title": "application: ", "content": "{\n \"application\":{\n \"general\":{\n \"school\": \"McGill University\",\n \"degree\": \"Undergraduate\",\n \"fieldOfStudy\": \"Computer Science\",\n \"graduationYear\": \"2021\",\n \"jobInterest\":\"Internship\",\n \"URL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n },\n \"shortAnswer\": {\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"question1\": \"I love McHacks\",\n \"question2\":\"Pls accept me\",\n \"previousHackathons\": \"5\",\n \"comments\":\"hi!\",\n },\n \"other:\" {\n \"gender\": \"male\",\n \"ethnicity\": \"Asian or Pacific Islander\",\n \"privacyPolicy\": true,\n \"codeOfConduct\": true,\n }\n \"accomodation\": {\n \"travel\": 0\n },\n }\n}", "type": "Json" } ] }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

Hacker object

" } ] }, "examples": [ { "title": "Success-Response: ", "content": "{\n \"message\": \"Hacker creation successful\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"application\":{\n \"general\":{\n \"school\": \"McGill University\",\n \"degree\": \"Undergraduate\",\n \"fieldOfStudy\": \"Computer Science\",\n \"graduationYear\": \"2021\",\n \"jobInterest\":\"Internship\",\n \"URL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n },\n \"shortAnswer\": {\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"question1\": \"I love McHacks\",\n \"question2\":\"Pls accept me\",\n \"previousHackathons\": \"5\",\n \"comments\":\"hi!\",\n },\n \"other:\" {\n \"gender\": \"male\",\n \"ethnicity\": \"Asian or Pacific Islander\",\n \"privacyPolicy\": true,\n \"codeOfConduct\": true,\n }\n \"accomodation\": {\n \"travel\": 0\n },\n }\n}", "type": "object" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "string", "optional": false, "field": "message", "description": "

Error message

" }, { "group": "Error 4xx", "type": "object", "optional": false, "field": "data", "description": "

empty

" } ] }, "examples": [ { "title": "Error-Response: ", "content": "{\"message\": \"Error while creating hacker\", \"data\": {}}", "type": "object" } ] }, "filename": "routes/api/hacker.js", "groupTitle": "Hacker", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/hacker/" } ] }, { "type": "get", "url": "/hacker/:id", "title": "get a hacker's information", "name": "getHacker", "group": "Hacker", "version": "0.0.8", "parameter": { "fields": { "param": [ { "group": "param", "type": "String", "optional": false, "field": "id", "description": "

a hacker's unique mongoID

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "String", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "data", "description": "

Hacker object

" } ] }, "examples": [ { "title": "Success-Response: ", "content": "{\n \"message\": \"Successfully retrieved hacker information\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"status\": \"Applied\",\n \"application\":{\n \"general\":{\n \"school\": \"McGill University\",\n \"degree\": \"Undergraduate\",\n \"fieldOfStudy\": \"Computer Science\",\n \"graduationYear\": \"2021\",\n \"jobInterest\":\"Internship\",\n \"URL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n },\n \"shortAnswer\": {\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"question1\": \"I love McHacks\",\n \"question2\":\"Pls accept me\",\n \"previousHackathons\": \"5\",\n \"comments\":\"hi!\",\n },\n \"other:\" {\n \"gender\": \"male\",\n \"ethnicity\": \"Asian or Pacific Islander\",\n \"privacyPolicy\": true,\n \"codeOfConduct\": true,\n }\n \"accomodation\": {\n \"travel\": 0\n },\n }\n }\n }", "type": "object" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "String", "optional": false, "field": "message", "description": "

Error message

" }, { "group": "Error 4xx", "type": "Object", "optional": false, "field": "data", "description": "

empty

" } ] }, "examples": [ { "title": "Error-Response: ", "content": "{\"message\": \"Hacker not found\", \"data\": {}}", "type": "object" } ] }, "filename": "routes/api/hacker.js", "groupTitle": "Hacker", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/hacker/:id" } ] }, { "type": "get", "url": "/hacker/email/:email", "title": "get a hacker's information", "name": "getHacker", "group": "Hacker", "version": "0.0.8", "parameter": { "fields": { "param": [ { "group": "param", "type": "String", "optional": false, "field": "email", "description": "

a hacker's unique email

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "String", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "data", "description": "

Hacker object

" } ] }, "examples": [ { "title": "Success-Response: ", "content": "{\n \"message\": \"Successfully retrieved hacker information\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"status\": \"Applied\",\n \"application\":{\n \"general\":{\n \"school\": \"McGill University\",\n \"degree\": \"Undergraduate\",\n \"fieldOfStudy\": \"Computer Science\",\n \"graduationYear\": \"2021\",\n \"jobInterest\":\"Internship\",\n \"URL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n },\n \"shortAnswer\": {\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"question1\": \"I love McHacks\",\n \"question2\":\"Pls accept me\",\n \"previousHackathons\": \"5\",\n \"comments\":\"hi!\",\n },\n \"other:\" {\n \"gender\": \"male\",\n \"ethnicity\": \"Asian or Pacific Islander\",\n \"privacyPolicy\": true,\n \"codeOfConduct\": true,\n }\n \"accomodation\": {\n \"travel\": 0\n },\n }\n }\n }", "type": "object" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "String", "optional": false, "field": "message", "description": "

Error message

" }, { "group": "Error 4xx", "type": "Object", "optional": false, "field": "data", "description": "

empty

" } ] }, "examples": [ { "title": "Error-Response: ", "content": "{\"message\": \"Hacker not found\", \"data\": {}}", "type": "object" } ] }, "filename": "routes/api/hacker.js", "groupTitle": "Hacker", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/hacker/email/:email" } ] }, { "type": "get", "url": "/hacker/resume:id", "title": "get the resume for a hacker.", "name": "getHackerResume", "group": "Hacker", "version": "0.0.8", "parameter": { "fields": { "param": [ { "group": "param", "type": "ObjectId", "optional": false, "field": "id", "description": "

Hacker id

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "String", "optional": false, "field": "message", "description": "

Success message

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n message: \"Downloaded resume\",\n data: {\n id: \"507f191e810c19729de860ea\",\n resume: [Buffer]\n }\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "String", "optional": false, "field": "message", "description": "

"Resume does not exist"

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 404\n{\n message: \"Resume not found\",\n data: {}\n}", "type": "json" } ] }, "permission": [ { "name": "Must be logged in, and the account id must be linked to the hacker." } ], "filename": "routes/api/hacker.js", "groupTitle": "Hacker" }, { "type": "get", "url": "/hacker/stats", "title": "Gets the stats of all of the hackers who have applied.", "name": "getHackerStats", "group": "Hacker", "version": "0.0.9", "parameter": { "fields": { "query": [ { "group": "query", "type": "String", "optional": false, "field": "model", "description": "

the model to be searched (Only hacker supported)

" }, { "group": "query", "type": "Array", "optional": false, "field": "q", "description": "

the query to be executed. For more information on how to format this, please see https://docs.mchacks.ca/architecture/

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

Hacker object

" } ] }, "examples": [ { "title": "Success-Response: ", "content": "{\n \"message\": \"Retrieved stats\",\n \"data\": {\n \"stats\" : {\n \"total\": 10,\n \"status\": { \"Applied\": 10 },\n \"school\": { \"McGill University\": 3, \"Harvard University\": 7 },\n degree: { \"Undergraduate\": 10 },\n gender: { \"Male\": 1, \"Female\": 9 },\n travel: { \"true\": 7, \"false\": 3 },\n ethnicity: { \"White\": 10, },\n jobInterest: { \"Internship\": 10 },\n major: { \"Computer Science\": 10 },\n graduationYear: { \"2019\": 10 },\n dietaryRestrictions: { \"None\": 10 },\n shirtSize: { \"M\": 3, \"XL\": 7 },\n age: { \"22\": 10 }\n }\n }\n}", "type": "object" } ] }, "filename": "routes/api/hacker.js", "groupTitle": "Hacker", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/hacker/stats" } ] }, { "type": "patch", "url": "/hacker/:id", "title": "update a hacker's information.", "description": "

This route only contains the ability to update a subset of a hacker's information. If you want to update a status, you must have Admin priviledges and use PATCH /hacker/status/:id.

", "name": "patchHacker", "group": "Hacker", "version": "0.0.8", "parameter": { "fields": { "body": [ { "group": "body", "type": "String", "optional": true, "field": "school", "description": "

Name of the school the hacker goes to

" }, { "group": "body", "type": "String", "optional": true, "field": "gender", "description": "

Gender of the hacker

" }, { "group": "body", "type": "Number", "optional": true, "field": "travel", "description": "

How much the hacker requires a bus for transportation

" }, { "group": "body", "type": "String[]", "optional": true, "field": "ethnicity", "description": "

the ethnicities of the hacker

" }, { "group": "body", "type": "String[]", "optional": true, "field": "major", "description": "

the major of the hacker

" }, { "group": "body", "type": "Number", "optional": true, "field": "graduationYear", "description": "

the graduation year of the hacker

" }, { "group": "body", "type": "Json", "optional": true, "field": "application", "description": "

The hacker's application

" } ] }, "examples": [ { "title": "application: ", "content": "{\n \"application\":{\n \"general\":{\n \"school\": \"McGill University\",\n \"degree\": \"Undergraduate\",\n \"fieldOfStudy\": \"Computer Science\",\n \"graduationYear\": \"2021\",\n \"jobInterest\":\"Internship\",\n \"URL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n },\n \"shortAnswer\": {\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"question1\": \"I love McHacks\",\n \"question2\":\"Pls accept me\",\n \"previousHackathons\": \"5\",\n \"comments\":\"hi!\",\n },\n \"other:\" {\n \"gender\": \"male\",\n \"ethnicity\": \"Asian or Pacific Islander\",\n \"privacyPolicy\": true,\n \"codeOfConduct\": true,\n }\n \"accomodation\": {\n \"travel\": 0\n },\n }\n }", "type": "Json" } ] }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

Hacker object

" } ] }, "examples": [ { "title": "Success-Response: ", "content": "{\n \"message\": \"Changed hacker information\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"status\": \"Applied\",\n \"application\":{\n \"general\":{\n \"school\": \"McGill University\",\n \"degree\": \"Undergraduate\",\n \"fieldOfStudy\": \"Computer Science\",\n \"graduationYear\": \"2021\",\n \"jobInterest\":\"Internship\",\n \"URL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n },\n \"shortAnswer\": {\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"question1\": \"I love McHacks\",\n \"question2\":\"Pls accept me\",\n \"previousHackathons\": \"5\",\n \"comments\":\"hi!\",\n },\n \"other:\" {\n \"gender\": \"male\",\n \"ethnicity\": \"Asian or Pacific Islander\",\n \"privacyPolicy\": true,\n \"codeOfConduct\": true,\n }\n \"accomodation\": {\n \"travel\": 0\n },\n }\n }\n}", "type": "object" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "string", "optional": false, "field": "message", "description": "

Error message

" }, { "group": "Error 4xx", "type": "object", "optional": false, "field": "data", "description": "

empty

" } ] }, "examples": [ { "title": "Error-Response: ", "content": "{\"message\": \"Error while updating hacker\", \"data\": {}}", "type": "object" } ] }, "filename": "routes/api/hacker.js", "groupTitle": "Hacker", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/hacker/:id" } ] }, { "type": "patch", "url": "/hacker/confirmation/:id", "title": "Allows confirmation of hacker attendence if they are accepted. Also allows change from 'confirmed' to 'withdrawn'.", "name": "patchHackerConfirmed", "group": "Hacker", "version": "0.0.9", "parameter": { "fields": { "body": [ { "group": "body", "type": "string", "optional": true, "field": "status", "description": "

The new status of the hacker. "Accepted", "Confirmed", or "Withdrawn"

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

Hacker object

" } ] }, "examples": [ { "title": "Success-Response:", "content": "{\n \"message\": \"Changed hacker information\",\n \"data\": {\n \"status\": \"Confirmed\"\n }\n}", "type": "object" } ] }, "permission": [ { "name": "Administrator" }, { "name": "Hacker" } ], "filename": "routes/api/hacker.js", "groupTitle": "Hacker", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/hacker/confirmation/:id" } ] }, { "type": "patch", "url": "/hacker/status/:id", "title": "update a hacker's status", "name": "patchHackerStatus", "group": "Hacker", "version": "0.0.9", "parameter": { "fields": { "body": [ { "group": "body", "type": "string", "optional": true, "field": "status", "description": "

Status of the hacker's application ("None"|"Applied"|"Accepted"|"Declined"|"Waitlisted"|"Confirmed"|"Withdrawn"|"Checked-in")

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

Hacker object

" } ] }, "examples": [ { "title": "Success-Response:", "content": "{\n \"message\": \"Changed hacker information\",\n \"data\": {\n \"status\": \"Accepted\"\n }\n}", "type": "object" } ] }, "permission": [ { "name": "Administrator" } ], "filename": "routes/api/hacker.js", "groupTitle": "Hacker", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/hacker/status/:id" } ] }, { "type": "post", "url": "/hacker/resume/:id", "title": "upload or update resume for a hacker.", "name": "postHackerResume", "group": "Hacker", "version": "0.0.8", "description": "

NOTE: This must be sent via multipart/form-data POST request

", "parameter": { "fields": { "param": [ { "group": "param", "type": "ObjectId", "optional": false, "field": "id", "description": "

Hacker id

" } ], "body": [ { "group": "body", "type": "File", "optional": false, "field": "resume", "description": "

The uploaded file.

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "String", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "data", "description": "

Location in the bucket that the file was stored.

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n message: \"Uploaded resume\",\n data: {\n filename: \"resumes/1535032624768-507f191e810c19729de860ea\"\n }\n}", "type": "json" } ] }, "permission": [ { "name": "Must be logged in, and the account id must be linked to the hacker." } ], "filename": "routes/api/hacker.js", "groupTitle": "Hacker", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/hacker/resume/:id" } ] }, { "type": "post", "url": "/hacker/email/dayOf/:id", "title": "", "description": "

Sends a hacker the day-of email, along with the HackPass QR code to view their hacker profile (for checkin purposes). Hackers must be either confirmed, or checked in.

", "name": "postHackerSendDayOfEmail", "group": "Hacker", "version": "0.0.9", "parameter": { "fields": { "param": [ { "group": "param", "type": "string", "optional": true, "field": "status", "description": "

The hacker ID

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

empty

" } ] }, "examples": [ { "title": "Success-Response:", "content": "{\n \"message\": \"Hacker day-of email sent.\",\n \"data\": {}\n}", "type": "object" } ] }, "permission": [ { "name": "Administrator" } ], "filename": "routes/api/hacker.js", "groupTitle": "Hacker", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/hacker/email/dayOf/:id" } ] }, { "type": "post", "url": "/hacker/email/weekOf/:id", "title": "", "description": "

Sends a hacker the week-of email, along with the HackPass QR code to view their hacker profile (for checkin purposes). Hackers must be either confirmed, or checked in.

", "name": "postHackerSendWeekOfEmail", "group": "Hacker", "version": "0.0.9", "parameter": { "fields": { "param": [ { "group": "param", "type": "string", "optional": true, "field": "status", "description": "

The hacker ID

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

empty

" } ] }, "examples": [ { "title": "Success-Response:", "content": "{\n \"message\": \"Hacker week-of email sent.\",\n \"data\": {}\n}", "type": "object" } ] }, "permission": [ { "name": "Administrator" } ], "filename": "routes/api/hacker.js", "groupTitle": "Hacker", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/hacker/email/weekOf/:id" } ] }, { "type": "post", "url": "/hacker/email/weekOf/:id", "title": "", "description": "

Sends a hacker the week-of email, along with the HackPass QR code to view their hacker profile (for checkin purposes). Hackers must be eitherconfirmed, or checked in.

", "name": "postHackerSendWeekOfEmail", "group": "Hacker", "version": "0.0.9", "parameter": { "fields": { "param": [ { "group": "param", "type": "string", "optional": true, "field": "status", "description": "

The hacker ID

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

empty

" } ] }, "examples": [ { "title": "Success-Response:", "content": "{\n \"message\": \"Hacker week-of email sent.\",\n \"data\": {}\n}", "type": "object" } ] }, "permission": [ { "name": "Administrator" } ], "filename": "routes/api/hacker.js", "groupTitle": "Hacker", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/hacker/email/weekOf/:id" } ] }, { "type": "get", "url": "/sponsor/self", "title": "get information about logged in sponsor", "name": "self", "group": "Hacker", "version": "1.4.1", "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "String", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "data", "description": "

Sponsor object

" } ] }, "examples": [ { "title": "Success-Response: ", "content": "{\n \"message\": \"Successfully retrieved sponsor information\", \n \"data\": {\n \"id\": \"5bff4d736f86be0a41badb91\",\n \"accountId\": \"5bff4d736f86be0a41badb99\",\n \"tier\": 3,\n \"company\": \"companyName\",\n \"contractURL\": \"https://www.contractHere.com\",\n \"nominees\": [\"5bff4d736f86be0a41badb93\",\"5bff4d736f86be0a41badb94\"]\n }\n }", "type": "object" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "String", "optional": false, "field": "message", "description": "

Error message

" }, { "group": "Error 4xx", "type": "Object", "optional": false, "field": "data", "description": "

empty

" } ] }, "examples": [ { "title": "Error-Response: ", "content": "{\"message\": \"Sponsor not found\", \"data\": {}}", "type": "object" } ] }, "permission": [ { "name": ": Sponsor" } ], "filename": "routes/api/sponsor.js", "groupTitle": "Hacker", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/sponsor/self" } ] }, { "type": "get", "url": "/hacker/self", "title": "get information about own hacker", "name": "self", "group": "Hacker", "version": "0.0.8", "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

Hacker object

" } ] }, "examples": [ { "title": "Success-Response: ", "content": "{\n \"message\": \"Hacker found by logged in account id\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"application\":{\n \"URL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n },\n \"status\":\"Applied\",\n \"ethnicity\":[\"White or Caucasian\",\" Asian or Pacific Islander\"],\n \"accountId\":\"5bff2a35e533b0f6562b4998\",\n \"school\":\"McPherson College\",\n \"gender\":\"Female\",\n \"travel\":0,\n \"major\":[\"Accounting\"],\n \"graduationYear\":2019,\n \"codeOfConduct\":true,\n } \n }", "type": "object" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "string", "optional": false, "field": "message", "description": "

Error message

" }, { "group": "Error 4xx", "type": "object", "optional": false, "field": "data", "description": "

empty

" } ] }, "examples": [ { "title": "Error-Response: ", "content": "{\"message\": \"Hacker not found\", \"data\": {}}", "type": "object" } ] }, "filename": "routes/api/hacker.js", "groupTitle": "Hacker", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/hacker/self" } ] }, { "type": "get", "url": "/", "title": "version", "version": "0.0.8", "name": "index", "group": "Index", "permission": [ { "name": "public" } ], "filename": "routes/index.js", "groupTitle": "Index", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/" } ] }, { "type": "post", "url": "/api/role/", "title": "create a new role", "name": "createRole", "group": "Role", "version": "1.1.1", "parameter": { "fields": { "body": [ { "group": "body", "type": "String", "optional": false, "field": "name", "description": "

Name of the route

" }, { "group": "body", "type": "Route[]", "optional": false, "field": "routes", "description": "

The routes that this role gives access to

" } ] }, "examples": [ { "title": "application: ", "content": "{\n \"name\": \"routename\",\n \"routes\": [\n {\n uri: \"/api/hacker/\"\n requestType: \"POST\"\n }\n ]\n}", "type": "Json" } ] }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

Role object

" } ] }, "examples": [ { "title": "Success-Response: ", "content": "{\n \"message\": \"Role creation successful\", \n \"data\": {\n \"name\": \"routename\",\n \"routes\": [\n {\n uri: \"/api/hacker/\"\n requestType: \"POST\"\n }\n ]\n }\n}", "type": "object" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "string", "optional": false, "field": "message", "description": "

Error message

" }, { "group": "Error 4xx", "type": "object", "optional": false, "field": "data", "description": "

empty

" } ] }, "examples": [ { "title": "Error-Response: ", "content": "{\"message\": \"Error while creating role\", \"data\": {}}", "type": "object" } ] }, "filename": "routes/api/role.js", "groupTitle": "Role", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/api/role/" } ] }, { "type": "get", "url": "/search/", "title": "provide a specific query for any defined model", "name": "search", "group": "Search", "version": "0.0.8", "parameter": { "fields": { "query": [ { "group": "query", "type": "String", "optional": false, "field": "model", "description": "

the model to be searched

" }, { "group": "query", "type": "Array", "optional": false, "field": "q", "description": "

the query to be executed. For more information on how to format this, please see https://docs.mchacks.ca/architecture/

" }, { "group": "query", "type": "String", "optional": false, "field": "sort", "description": "

either "asc" or "desc"

" }, { "group": "query", "type": "number", "optional": false, "field": "page", "description": "

the page number that you would like

" }, { "group": "query", "type": "number", "optional": false, "field": "limit", "description": "

the maximum number of results that you would like returned

" }, { "group": "query", "type": "any", "optional": false, "field": "sort_by", "description": "

any parameter you want to sort the results by

" }, { "group": "query", "type": "boolean", "optional": false, "field": "expand", "description": "

whether you want to expand sub documents within the results

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "String", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "data", "description": "

Results

" } ] }, "examples": [ { "title": "Success-Response:", "content": "{\n \"message\": \"Successfully executed query, returning all results\",\n \"data\": [\n {...}\n ]\n }", "type": "object" }, { "title": "Success-Response:", "content": "{\n \"message\": \"No results found.\",\n \"data\": {}\n }", "type": "object" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "String", "optional": false, "field": "message", "description": "

Error message

" }, { "group": "Error 4xx", "type": "Object", "optional": false, "field": "data", "description": "

empty

" } ] }, "examples": [ { "title": "Error-Response:", "content": "{\"message\": \"Validation failed\", \"data\": {}}", "type": "object" } ] }, "filename": "routes/api/search.js", "groupTitle": "Search", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/search/" } ] }, { "type": "get", "url": "/settings/", "title": "Get the settings for the current hackathon", "name": "getSettings", "group": "Settings", "version": "1.1.1", "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

Settings Object

" } ] }, "examples": [ { "title": "Success-Response:", "content": "{\n \"message\": \"Settings creation successful.\",\n \"data\": {\n \"settings\": {\n openTime: \"Wed Feb 06 2019 00:00:00 GMT-0500 (GMT-05:00)\",\n closeTime: \"Sat Feb 01 2020 00:00:00 GMT-0500 (GMT-05:00)\",\n confirmTime: \"Sat Feb 20 2020 00:00:00 GMT-0500 (GMT-05:00)\",\n isRemote: false\n }\n }\n}", "type": "object" } ] }, "permission": [ { "name": "public" } ], "filename": "routes/api/settings.js", "groupTitle": "Settings", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/settings/" } ] }, { "type": "patch", "url": "/settings/", "title": "Patch the settings for the current hackathon", "name": "patchSettings", "group": "Settings", "version": "1.1.1", "parameter": { "fields": { "body": [ { "group": "body", "type": "Date", "optional": true, "field": "openTime", "description": "

The opening time for the hackathon.

" }, { "group": "body", "type": "Date", "optional": true, "field": "closeTime", "description": "

The closing time for the hackathon.

" }, { "group": "body", "type": "Date", "optional": true, "field": "confirmTime", "description": "

The deadline for confirmation for the hackathon.

" }, { "group": "body", "type": "Boolean", "optional": true, "field": "isRemote", "description": "

Whether this hackathon is remote or not.

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

Settings Object

" } ] }, "examples": [ { "title": "Success-Response:", "content": "{\n \"message\": \"Settings patch successful.\",\n \"data\": {\n \"settings\": {\n openTime: \"Wed Feb 06 2019 00:00:00 GMT-0500 (GMT-05:00)\",\n closeTime: \"Sat Feb 01 2020 00:00:00 GMT-0500 (GMT-05:00)\",\n confirmTime: \"Sat Feb 20 2020 00:00:00 GMT-0500 (GMT-05:00)\",\n isRemote: true\n }\n }\n}", "type": "object" } ] }, "permission": [ { "name": "Administrators" } ], "filename": "routes/api/settings.js", "groupTitle": "Settings", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/settings/" } ] }, { "type": "post", "url": "/sponsor/", "title": "create a new sponsor", "name": "createSponsor", "group": "Sponsor", "version": "0.0.8", "parameter": { "fields": { "body": [ { "group": "body", "type": "MongoID", "optional": false, "field": "accountId", "description": "

ObjectID of the respective account.

" }, { "group": "body", "type": "Number", "optional": false, "field": "tier", "description": "

Tier of the sponsor, from 0 to 5. 0 is lowest tier, and 5 is the custom tier.

" }, { "group": "body", "type": "String", "optional": false, "field": "company", "description": "

Name of the company.

" }, { "group": "body", "type": "String", "optional": false, "field": "contractURL", "description": "

URL link to the contract with the company.

" }, { "group": "body", "type": "MongoID[]", "optional": false, "field": "nominees", "description": "

Array of accounts that the company wish to nominate as hackers.

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "String", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "data", "description": "

Sponsor object

" } ] }, "examples": [ { "title": "Success-Response: ", "content": "{\n \"message\": \"Sponsor creation successful\", \n \"data\": {...}\n }", "type": "object" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "String", "optional": false, "field": "message", "description": "

Error message

" }, { "group": "Error 4xx", "type": "Object", "optional": false, "field": "data", "description": "

empty

" } ] }, "examples": [ { "title": "Error-Response: ", "content": "{\"message\": \"Error while creating sponsor\", \"data\": {}}", "type": "object" } ] }, "filename": "routes/api/sponsor.js", "groupTitle": "Sponsor", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/sponsor/" } ] }, { "type": "get", "url": "/sponsor/:id", "title": "get a sponsor's information", "name": "getSponsor", "group": "Sponsor", "version": "0.0.8", "parameter": { "fields": { "param": [ { "group": "param", "type": "string", "optional": false, "field": "id", "description": "

a sponsor's unique mongoID

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "String", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "data", "description": "

Sponsor object

" } ] }, "examples": [ { "title": "Success-Response: ", "content": "{\n \"message\": \"Successfully retrieved sponsor information\", \n \"data\": {\n \"id\": \"5bff4d736f86be0a41badb91\",\n \"accountId\": \"5bff4d736f86be0a41badb99\",\n \"tier\": 3,\n \"company\": \"companyName\",\n \"contractURL\": \"https://www.contractHere.com\",\n \"nominees\": [\"5bff4d736f86be0a41badb93\",\"5bff4d736f86be0a41badb94\"]\n }\n }", "type": "object" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "String", "optional": false, "field": "message", "description": "

Error message

" }, { "group": "Error 4xx", "type": "Object", "optional": false, "field": "data", "description": "

empty

" } ] }, "examples": [ { "title": "Error-Response: ", "content": "{\"message\": \"Sponsor not found\", \"data\": {}}", "type": "object" } ] }, "filename": "routes/api/sponsor.js", "groupTitle": "Sponsor", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/sponsor/:id" } ] }, { "type": "patch", "url": "/sponsor/", "title": "update a sponsor", "name": "patchSponsor", "group": "Sponsor", "version": "1.3.0", "parameter": { "fields": { "param": [ { "group": "param", "type": "ObjectId", "optional": false, "field": "id", "description": "

ObjectID of the sponsor

" } ], "body": [ { "group": "body", "type": "String", "optional": false, "field": "company", "description": "

Name of the company.

" }, { "group": "body", "type": "String", "optional": false, "field": "contractURL", "description": "

URL link to the contract with the company.

" }, { "group": "body", "type": "ObjectId[]", "optional": false, "field": "nominees", "description": "

Array of accounts that the company wish to nominate as hackers.

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "String", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "data", "description": "

Sponsor object

" } ] }, "examples": [ { "title": "Success-Response: ", "content": "{\n \"message\": \"Sponsor update successful\", \n \"data\": {...}\n }", "type": "object" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "String", "optional": false, "field": "message", "description": "

Error message

" }, { "group": "Error 4xx", "type": "Object", "optional": false, "field": "data", "description": "

empty

" } ] }, "examples": [ { "title": "Error-Response: ", "content": "{\"message\": \"Error while updating sponsor\", \"data\": {}}", "type": "object" } ] }, "filename": "routes/api/sponsor.js", "groupTitle": "Sponsor", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/sponsor/" } ] }, { "type": "post", "url": "/team/", "title": "create a new team consisting of only the logged in user", "name": "createTeam", "group": "Team", "version": "0.0.8", "parameter": { "fields": { "body": [ { "group": "body", "type": "String", "optional": false, "field": "name", "description": "

Name of the team.

" }, { "group": "body", "type": "String", "optional": true, "field": "devpostURL", "description": "

Devpost link to hack. Once the link is sent, the hack will be considered to be submitted.

" }, { "group": "body", "type": "String", "optional": true, "field": "projectName", "description": "

Name of the team.

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

Team object

" } ] }, "examples": [ { "title": "Success-Response: ", "content": "{\n \"message\": \"Team creation successful\", \n \"data\": {...}\n }", "type": "object" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "string", "optional": false, "field": "message", "description": "

Error message

" }, { "group": "Error 4xx", "type": "object", "optional": false, "field": "data", "description": "

empty

" } ] }, "examples": [ { "title": "Error-Response: ", "content": "{\"message\": \"Error while creating team\", \"data\": {}}", "type": "object" } ] }, "filename": "routes/api/team.js", "groupTitle": "Team", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/team/" } ] }, { "type": "patch", "url": "/team/leave/", "title": "Allows a logged in hacker to leave current team", "name": "deleteSelfFromTeam", "group": "Team", "version": "1.1.1", "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

{}

" } ] }, "examples": [ { "title": "Success-Response:", "content": "{\n \"message\": \"Removal from team successful.\",\n \"data\": {}\n}", "type": "object" } ] }, "filename": "routes/api/team.js", "groupTitle": "Team", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/team/leave/" } ] }, { "type": "get", "url": "/team/:id", "title": "get a team's information", "name": "getTeam", "group": "Team", "version": "0.0.8", "parameter": { "fields": { "param": [ { "group": "param", "type": "ObjectId", "optional": false, "field": "id", "description": "

MongoId of the team

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "String", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "data", "description": "

Team object

" } ] }, "examples": [ { "title": "Success-Response: ", "content": "{\n \"message\": \"Team retrieval successful\", \n \"data\": { \n \"team\": {\n \"name\":\"foo\",\n \"members\": [\n ObjectId('...')\n ],\n \"devpostURL\": \"www.devpost.com/foo\",\n \"projectName\": \"fooey\"\n },\n \"members\": [\n {\n \"firstName\": \"John\",\n \"lastName\": \"Doe\"\n }\n ],\n }\n }", "type": "object" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "String", "optional": false, "field": "message", "description": "

Error message

" }, { "group": "Error 4xx", "type": "Object", "optional": false, "field": "data", "description": "

empty

" } ] }, "examples": [ { "title": "Error-Response: ", "content": "{\"message\": \"Team not found\", \"data\": {}}", "type": "object" } ] }, "filename": "routes/api/team.js", "groupTitle": "Team", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/team/:id" } ] }, { "type": "patch", "url": "/team/join/", "title": "Allows a logged in hacker to join a team by name", "name": "patchJoinTeam", "group": "Team", "version": "1.1.1", "parameter": { "fields": { "body": [ { "group": "body", "type": "string", "optional": true, "field": "name", "description": "

Name of the team to join

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

{}

" } ] }, "examples": [ { "title": "Success-Response:", "content": "{\n \"message\": \"Team join successful.\",\n \"data\": {}\n}", "type": "object" } ] }, "filename": "routes/api/team.js", "groupTitle": "Team", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/team/join/" } ] }, { "type": "patch", "url": "/team/:hackerId", "title": "Update a team's information. The team is specified by the hacker belonging to it.", "name": "patchTeam", "group": "Team", "version": "0.0.8", "description": "

We use hackerId instead of teamId because authorization requires a one-to-one mapping from param id to accountId, but we are not able to have that from teamId to accountId due to multiple members in a team. Instead, we use hackerId, as there is a 1 to 1 link between hackerId to teamId, and a 1 to 1 link between hackerId and accountId

", "parameter": { "fields": { "param": [ { "group": "param", "type": "ObjectId", "optional": false, "field": "hackerId", "description": "

a hacker's unique Id

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "String", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "data", "description": "

Team object

" } ] }, "examples": [ { "title": "Success-Response: ", "content": "{\n \"message\": \"Team update successful.\", \n \"data\": {...}\n }", "type": "object" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "String", "optional": false, "field": "message", "description": "

Error message

" }, { "group": "Error 4xx", "type": "Object", "optional": false, "field": "data", "description": "

Query input that caused the error.

" } ] }, "examples": [ { "title": "Error-Response: ", "content": "{\"message\": \"Team not found\", \"data\": {teamId}}", "type": "object" } ] }, "filename": "routes/api/team.js", "groupTitle": "Team", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/team/:hackerId" } ] }, { "type": "post", "url": "/travel/", "title": "create a new travel", "name": "createTravel", "group": "Travel", "version": "2.0.1", "parameter": { "fields": { "body": [ { "group": "body", "type": "MongoID", "optional": false, "field": "accountId", "description": "

ObjectID of the respective account

" }, { "group": "body", "type": "MongoID", "optional": false, "field": "hackerId", "description": "

ObjectID of the respective hacker

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

Travel object

" } ] }, "examples": [ { "title": "Success-Response: ", "content": "{\n \"message\": \"Travel creation successful\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"status\": \"None\",\n \"request\": 50,\n \"offer\": 0\n }\n}", "type": "object" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "string", "optional": false, "field": "message", "description": "

Error message

" }, { "group": "Error 4xx", "type": "object", "optional": false, "field": "data", "description": "

empty

" } ] }, "examples": [ { "title": "Error-Response: ", "content": "{\"message\": \"Error while creating travel\", \"data\": {}}", "type": "object" } ] }, "filename": "routes/api/travel.js", "groupTitle": "Travel", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/travel/" } ] }, { "type": "get", "url": "/travel/email/:email", "title": "get a travel's information", "name": "getTravel", "group": "Travel", "version": "2.0.1", "parameter": { "fields": { "param": [ { "group": "param", "type": "String", "optional": false, "field": "email", "description": "

a travel's unique email

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "String", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "data", "description": "

Travel object

" } ] }, "examples": [ { "title": "Success-Response: ", "content": "{\n \"message\": \"Successfully retrieved travel information\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"status\": \"Valid\",\n \"request\": 100,\n \"offer\": 50\n }\n }", "type": "object" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "String", "optional": false, "field": "message", "description": "

Error message

" }, { "group": "Error 4xx", "type": "Object", "optional": false, "field": "data", "description": "

empty

" } ] }, "examples": [ { "title": "Error-Response: ", "content": "{\"message\": \"Travel not found\", \"data\": {}}", "type": "object" } ] }, "filename": "routes/api/travel.js", "groupTitle": "Travel", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/travel/email/:email" } ] }, { "type": "get", "url": "/travel/:id", "title": "get a traveler's information", "name": "getTravel", "group": "Travel", "version": "2.0.1", "parameter": { "fields": { "param": [ { "group": "param", "type": "String", "optional": false, "field": "id", "description": "

a travel's unique mongoID

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "String", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "data", "description": "

Travel object

" } ] }, "examples": [ { "title": "Success-Response: ", "content": "{\n \"message\": \"Successfully retrieved travel information\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"status\": \"Valid\",\n \"request\": 100,\n \"offer\": 50\n }\n }", "type": "object" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "String", "optional": false, "field": "message", "description": "

Error message

" }, { "group": "Error 4xx", "type": "Object", "optional": false, "field": "data", "description": "

empty

" } ] }, "examples": [ { "title": "Error-Response: ", "content": "{\"message\": \"Travel not found\", \"data\": {}}", "type": "object" } ] }, "filename": "routes/api/travel.js", "groupTitle": "Travel", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/travel/:id" } ] }, { "type": "patch", "url": "/travel/offer/:id", "title": "update a traveler's offer", "name": "patchTravelOffer", "group": "Travel", "version": "2.0.1", "parameter": { "fields": { "body": [ { "group": "body", "type": "number", "optional": true, "field": "offer", "description": "

Amount of money offered for travel

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

Travel object

" } ] }, "examples": [ { "title": "Success-Response:", "content": "{\n \"message\": \"Changed travel information\",\n \"data\": {\n \"offer\": 75\n }\n}", "type": "object" } ] }, "permission": [ { "name": "Administrator" } ], "filename": "routes/api/travel.js", "groupTitle": "Travel", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/travel/offer/:id" } ] }, { "type": "patch", "url": "/travel/status/:id", "title": "update a traveler's status", "name": "patchTravelStatus", "group": "Travel", "version": "2.0.1", "parameter": { "fields": { "body": [ { "group": "body", "type": "string", "optional": true, "field": "status", "description": "

Status of the travel's reimbursement ("None"|"Bus"|"Offered"|"Valid"|"Invalid"|"Claimed")

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

Travel object

" } ] }, "examples": [ { "title": "Success-Response:", "content": "{\n \"message\": \"Changed travel information\",\n \"data\": {\n \"status\": \"Accepted\"\n }\n}", "type": "object" } ] }, "permission": [ { "name": "Administrator" } ], "filename": "routes/api/travel.js", "groupTitle": "Travel", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/travel/status/:id" } ] }, { "type": "get", "url": "/travel/self", "title": "get information about own hacker's travel", "name": "self", "group": "Travel", "version": "2.0.1", "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

Travel object

" } ] }, "examples": [ { "title": "Success-Response: ", "content": "{\n \"message\": \"Travel found by logged in account id\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"status\": \"Claimed\"\n \"request\": 90,\n \"offer\": 80\n } \n }", "type": "object" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "string", "optional": false, "field": "message", "description": "

Error message

" }, { "group": "Error 4xx", "type": "object", "optional": false, "field": "data", "description": "

empty

" } ] }, "examples": [ { "title": "Error-Response: ", "content": "{\"message\": \"Travel not found\", \"data\": {}}", "type": "object" } ] }, "filename": "routes/api/travel.js", "groupTitle": "Travel", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/travel/self" } ] }, { "type": "post", "url": "/volunteer/", "title": "create a new volunteer", "name": "createVolunteer", "group": "Volunteer", "version": "0.0.8", "parameter": { "fields": { "body": [ { "group": "body", "type": "MongoID", "optional": false, "field": "accountId", "description": "

MongoID of the account of the volunteer

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

Volunteer object

" } ] }, "examples": [ { "title": "Success-Response: ", "content": "{\n \"message\": \"Volunteer creation successful\", \n \"data\": {...}\n }", "type": "object" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "string", "optional": false, "field": "message", "description": "

Error message

" }, { "group": "Error 4xx", "type": "object", "optional": false, "field": "data", "description": "

empty

" } ] }, "examples": [ { "title": "Error-Response: ", "content": "{\"message\": \"Error while creating volunteer\", \"data\": {}}", "type": "object" } ] }, "filename": "routes/api/volunteer.js", "groupTitle": "Volunteer", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/volunteer/" } ] }, { "type": "get", "url": "/volunteer/:id", "title": "get a volunteer's information", "name": "getVolunteer", "group": "Volunteer", "version": "1.3.0", "parameter": { "fields": { "param": [ { "group": "param", "type": "ObjectId", "optional": false, "field": "id", "description": "

a volunteer's unique mongoID

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "String", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "data", "description": "

Volunteer object

" } ] }, "examples": [ { "title": "Success-Response: ", "content": "{\n \"message\": \"Successfully retrieved volunteer information\", \n \"data\": {...}\n }", "type": "object" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "String", "optional": false, "field": "message", "description": "

Error message

" }, { "group": "Error 4xx", "type": "Object", "optional": false, "field": "data", "description": "

empty

" } ] }, "examples": [ { "title": "Error-Response: ", "content": "{\"message\": \"Volunteer not found\", \"data\": {}}", "type": "object" } ] }, "filename": "routes/api/volunteer.js", "groupTitle": "Volunteer", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/volunteer/:id" } ] } ] }); +define({ "api": [ + { + "type": "post", + "url": "/account/", + "title": "create a new account", + "name": "create", + "group": "Account", + "version": "0.0.8", + "parameter": { + "fields": { + "body": [ + { + "group": "body", + "type": "String", + "optional": false, + "field": "firstName", + "description": "

First name of the account creator.

" + }, + { + "group": "body", + "type": "String", + "optional": false, + "field": "lastName", + "description": "

Last name of the account creator.

" + }, + { + "group": "body", + "type": "String", + "optional": false, + "field": "pronoun", + "description": "

the pronoun of the account creator.

" + }, + { + "group": "body", + "type": "String", + "optional": false, + "field": "email", + "description": "

Email of the account.

" + }, + { + "group": "body", + "type": "String", + "optional": false, + "field": "gender", + "description": "

Gender of the account creator.

" + }, + { + "group": "body", + "type": "String[]", + "optional": false, + "field": "dietaryRestrictions", + "description": "

Any dietary restrictions for the user. 'None' if there are no restrictions

" + }, + { + "group": "body", + "type": "String", + "optional": false, + "field": "password", + "description": "

The password of the account.

" + }, + { + "group": "body", + "type": "String", + "optional": false, + "field": "birthDate", + "description": "

a Date parsable string.

" + }, + { + "group": "body", + "type": "Number", + "optional": true, + "field": "phoneNumber", + "description": "

the user's phone number, represented as a string.

" + } + ], + "header": [ + { + "group": "header", + "type": "JWT", + "optional": true, + "field": "token", + "description": "

the user's invite token.

" + } + ] + }, + "examples": [ + { + "title": "Request-Example:", + "content": "{ \n \"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"password\":\"hunter2\",\n \"phoneNumber\":1234567890,\n \"gender\":\"Male\",\n \"birthDate\":\"10/30/1997\"\n}", + "type": "json" + } + ] + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

Account object

" + } + ] + }, + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Account creation successful\", \n \"data\": {\n \"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \t\"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"phoneNumber\":1234567890,\n \t\"gender\":\"Male\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", + "type": "object" + } + ] + }, + "error": { + "fields": { + "Error 4xx": [ + { + "group": "Error 4xx", + "type": "string", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [ + { + "title": "Error-Response: ", + "content": "{\n \"message\": \"Account already exists\", \n \"data\": {\n \"route\": \"/\"\n }\n}", + "type": "object" + } + ] + }, + "filename": "routes/api/account.js", + "groupTitle": "Account", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/account/" + } + ] + }, + { + "type": "get", + "url": "/account/:id", + "title": "gets information from an account with mongoid ':id'", + "name": "getAccount", + "group": "Account", + "version": "0.0.8", + "parameter": { + "fields": { + "param": [ + { + "group": "param", + "type": "ObjectId", + "optional": false, + "field": "id", + "description": "

MongoId of an account

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

Account object

" + } + ] + }, + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Account found by user id\", \n \"data\": {\n \"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"phoneNumber\":1234567890,\n \"gender\":\"Male\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", + "type": "object" + } + ] + }, + "error": { + "fields": { + "Error 4xx": [ + { + "group": "Error 4xx", + "type": "string", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Account not found\", \"data\": {}}", + "type": "object" + } + ] + }, + "filename": "routes/api/account.js", + "groupTitle": "Account", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/account/:id" + } + ] + }, + { + "type": "get", + "url": "/account/invite", + "title": "Get all of the invites.", + "name": "getAllInvites", + "group": "Account", + "version": "0.0.8", + "description": "

Get all of the invites that currently exist in the database.

", + "success": { + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Invite retrieval successful.\", \n \"data\": [{\n \"email\":\"abc@def.com\",\n \"accountType\":\"Hacker\"\n }]\n }", + "type": "object" + } + ] + }, + "filename": "routes/api/account.js", + "groupTitle": "Account", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/account/invite" + } + ] + }, + { + "type": "post", + "url": "/account/invite", + "title": "invites a user to create an account with the specified accountType", + "name": "inviteAccount", + "group": "Account", + "version": "0.0.8", + "description": "

sends link with token to be used with the account/create route

", + "parameter": { + "fields": { + "body": [ + { + "group": "body", + "type": "String", + "optional": true, + "field": "email", + "description": "

email of the account to be created and where to send the link

" + }, + { + "group": "body", + "type": "String", + "optional": true, + "field": "accountType", + "description": "

the type of the account which the user can create, for sponsor this should specify tier as well

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

Account object

" + } + ] + }, + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Successfully invited user\", \n \"data\": {}\n }", + "type": "object" + } + ] + }, + "error": { + "fields": { + "Error 4xx": [ + { + "group": "Error 4xx", + "type": "string", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "object", + "optional": false, + "field": "data", + "description": "

Error object

" + } + ] + }, + "examples": [ + { + "title": "Error-Response:", + "content": "{\n \"message\": \"Invalid Authentication\",\n \"data\": {\n \"route\": \"/invite\"\n }\n }", + "type": "object" + } + ] + }, + "filename": "routes/api/account.js", + "groupTitle": "Account", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/account/invite" + } + ] + }, + { + "type": "get", + "url": "/account/self", + "title": "get information about own account", + "name": "self", + "group": "Account", + "version": "0.0.8", + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

Account object

" + } + ] + }, + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Account found by user email\", \n \"data\": {\n \t\"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \t\"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"phoneNumber\":1234567890,\n \t\"gender\":\"Male\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", + "type": "object" + } + ] + }, + "error": { + "fields": { + "Error 4xx": [ + { + "group": "Error 4xx", + "type": "string", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty object

" + } + ] + }, + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Account not found\", \"data\": {}}", + "type": "object" + } + ] + }, + "filename": "routes/api/account.js", + "groupTitle": "Account", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/account/self" + } + ] + }, + { + "type": "patch", + "url": "/account/:id", + "title": "update an account's information", + "name": "updateOneUser", + "group": "Account", + "version": "0.0.8", + "parameter": { + "fields": { + "body": [ + { + "group": "body", + "type": "String", + "optional": true, + "field": "firstName", + "description": "

First name of the account creator.

" + }, + { + "group": "body", + "type": "String", + "optional": true, + "field": "lastName", + "description": "

Last name of the account creator.

" + }, + { + "group": "body", + "type": "String", + "optional": true, + "field": "pronoun", + "description": "

The pronoun of the account creator.

" + }, + { + "group": "body", + "type": "String", + "optional": true, + "field": "email", + "description": "

Email of the account.

" + }, + { + "group": "body", + "type": "String", + "optional": true, + "field": "gender", + "description": "

Gender of the account creator.

" + }, + { + "group": "body", + "type": "String", + "optional": true, + "field": "birthDate", + "description": "

A Date parsable string.

" + }, + { + "group": "body", + "type": "Number", + "optional": true, + "field": "phoneNumber", + "description": "

The user's phone number, represented as a string.

" + }, + { + "group": "body", + "type": "String[]", + "optional": true, + "field": "dietaryRestrictions", + "description": "

Any dietary restrictions for the user. 'None' if there are no restrictions

" + } + ] + }, + "examples": [ + { + "title": "Request-Example:", + "content": "{ \"gender\": \"Male\" }", + "type": "json" + } + ] + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

Account object

" + } + ] + }, + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Account update successful.\", \n \"data\": {\n \"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \t\"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"phoneNumber\":1234567890,\n \t\"gender\": \"Male\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", + "type": "object" + } + ] + }, + "error": { + "fields": { + "Error 4xx": [ + { + "group": "Error 4xx", + "type": "string", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Error while updating account\", \"data\": {}}", + "type": "object" + } + ] + }, + "filename": "routes/api/account.js", + "groupTitle": "Account", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/account/:id" + } + ] + }, + { + "type": "patch", + "url": "/auth/password/change", + "title": "change password for logged in user", + "name": "changePassword", + "group": "Authentication", + "version": "0.0.8", + "parameter": { + "fields": { + "Parameter": [ + { + "group": "Parameter", + "type": "String", + "optional": false, + "field": "oldPassword", + "description": "

The current password of the user

" + }, + { + "group": "Parameter", + "type": "String", + "optional": false, + "field": "newPassword", + "description": "

The new password of the user

" + } + ] + }, + "examples": [ + { + "title": "Request-Example:", + "content": "{\n \"oldPassword\": \"password12345\",\n \"newPassword\": \"password123456\"\n}", + "type": "json" + } + ] + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [ + { + "title": "Success-Response:", + "content": "{\"message\": \"Successfully reset password\", \"data\": {}}", + "type": "json" + } + ] + }, + "permission": [ + { + "name": ": Must be logged in" + } + ], + "filename": "routes/api/auth.js", + "groupTitle": "Authentication", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/auth/password/change" + } + ] + }, + { + "type": "post", + "url": "/auth/confirm/:token", + "title": "confirm account using the JWT in :token", + "name": "confirmAccount", + "group": "Authentication", + "version": "0.0.8", + "parameter": { + "fields": { + "Parameter": [ + { + "group": "Parameter", + "type": "String", + "optional": false, + "field": "JWT", + "description": "

for confirming the account

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [ + { + "title": "Success-Response:", + "content": "{\"message\": \"Successfully confirmed account\", \"data\": {}}", + "type": "json" + } + ] + }, + "error": { + "fields": { + "Error 4xx": [ + { + "group": "Error 4xx", + "type": "string", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [ + { + "title": "Error-Response:", + "content": "{\"message\": \"Invalid token for confirming account, \"data\": {}}", + "type": "object" + } + ] + }, + "filename": "routes/api/auth.js", + "groupTitle": "Authentication", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/auth/confirm/:token" + } + ] + }, + { + "type": "post", + "url": "/auth/password/forgot", + "title": "forgot password route", + "name": "forgotPassword", + "group": "Authentication", + "version": "0.0.8", + "parameter": { + "fields": { + "Parameter": [ + { + "group": "Parameter", + "type": "String", + "optional": false, + "field": "email", + "description": "

the email address of the account

" + } + ] + }, + "examples": [ + { + "title": "Request-Example:", + "content": "{ \"email\": \"myemail@mchacks.ca\" }", + "type": "json" + } + ] + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [ + { + "title": "Success-Response:", + "content": "{\"message\": \"Sent reset email\", \"data\": {}}", + "type": "json" + } + ] + }, + "permission": [ + { + "name": ": public" + } + ], + "filename": "routes/api/auth.js", + "groupTitle": "Authentication", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/auth/password/forgot" + } + ] + }, + { + "type": "get", + "url": "/auth/rolebindings/:id", + "title": "retrieve rolebindings for a user given by their user id :id", + "name": "getRoleBindings", + "group": "Authentication", + "version": "0.0.8", + "parameter": { + "fields": { + "param": [ + { + "group": "param", + "type": "ObjectId", + "optional": false, + "field": "id", + "description": "

MongoId of an account

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

Rolebindings object

" + } + ] + }, + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Successfully retrieved role bindings\",\n \"data\": {\n accountId:\"5beca4ab2e069a34f91697b2\"\n id:\"5beca4ae2e069a34f91698b1\"\n roles: [\n {\n _id:\"5beca4ab2e069a34f91697d9\",\n name:\"hacker\",\n routes: [\n {_id: \"5beca4ae2e069a34f9169852\", requestType: \"POST\", uri: \"/api/auth/login\"},\n {_id: \"5beca4ae2e069a34f9169851\", requestType: \"POST\", uri: \"/api/auth/logout\"},\n {_id: \"5beca4ae2e069a34f9169850\", requestType: \"GET\", uri: \"/api/auth/rolebindings/:self\"},\n {_id: \"5beca4ae2e069a34f916984f\", requestType: \"GET\", uri: \"/api/account/self\"},\n {_id: \"5beca4ae2e069a34f916984e\", requestType: \"GET\", uri: \"/api/account/:self\"},\n {_id: \"5beca4ae2e069a34f916984d\", requestType: \"PATCH\", uri: \"/api/account/:self\"},\n {_id: \"5beca4ae2e069a34f916984c\", requestType: \"POST\", uri: \"/api/hacker/\"},\n {_id: \"5beca4ae2e069a34f916984b\", requestType: \"GET\", uri: \"/api/hacker/:self\"},\n {_id: \"5beca4ae2e069a34f916984a\", requestType: \"GET\", uri: \"/api/hacker/:self/resume\"},\n {_id: \"5beca4ae2e069a34f9169849\", requestType: \"PATCH\", uri: \"/api/hacker/:self\"}\n ]\n }\n ]\n }\n }", + "type": "object" + } + ] + }, + "error": { + "fields": { + "Error 4xx": [ + { + "group": "Error 4xx", + "type": "string", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Role Bindings not found\", \"data\": {}}", + "type": "object" + } + ] + }, + "filename": "routes/api/auth.js", + "groupTitle": "Authentication", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/auth/rolebindings/:id" + } + ] + }, + { + "type": "get", + "url": "/auth/roles", + "title": "get roles", + "name": "getRoles", + "description": "

get all roles that exist in the database

", + "group": "Authentication", + "version": "0.0.8", + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [ + { + "title": "Success-Response:", + "content": "{\"message\": \"Sucessfully retrieved all roles\", \"data\":\n[{name: \"GodStaff\", routes: Array(27), id: \"5bee20ef3ca9dd4754382880\"},\n {name: \"Hacker\", routes: Array(10), id: \"5bee20ef3ca9dd4754382881\"},\n {name: \"Volunteer\", routes: Array(4), id: \"5bee20ef3ca9dd4754382882\"}]", + "type": "json" + } + ] + }, + "filename": "routes/api/auth.js", + "groupTitle": "Authentication", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/auth/roles" + } + ] + }, + { + "type": "post", + "url": "/auth/login", + "title": "login to the service", + "name": "login", + "group": "Authentication", + "version": "0.0.8", + "parameter": { + "fields": { + "Parameter": [ + { + "group": "Parameter", + "type": "string", + "optional": false, + "field": "email", + "description": "

Account email

" + }, + { + "group": "Parameter", + "type": "string", + "optional": false, + "field": "password", + "description": "

Account password

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [ + { + "title": "Success-Response: ", + "content": "{\"message\": \"Successfully logged in\", \"data\": {}}", + "type": "object" + } + ] + }, + "error": { + "fields": { + "Error 4xx": [ + { + "group": "Error 4xx", + "type": "string", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Invalid Authentication\", \"data\": {}}", + "type": "object" + } + ] + }, + "permission": [ + { + "name": ": public" + } + ], + "filename": "routes/api/auth.js", + "groupTitle": "Authentication", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/auth/login" + } + ] + }, + { + "type": "get", + "url": "/auth/logout", + "title": "logout of service", + "name": "logout", + "group": "Authentication", + "version": "0.0.8", + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [ + { + "title": "Success-Response:", + "content": "{\"message\": \"Successfully logged out\", \"data\": {}}", + "type": "object" + } + ] + }, + "permission": [ + { + "name": ": public" + } + ], + "filename": "routes/api/auth.js", + "groupTitle": "Authentication", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/auth/logout" + } + ] + }, + { + "type": "get", + "url": "/auth/confirm/resend", + "title": "resend confirmation token", + "name": "resendConfirmAccount", + "group": "Authentication", + "version": "0.0.8", + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [ + { + "title": "Success-Response:", + "content": "{\"message\": \"Successfully resent confirmation email\", \"data\": {}}", + "type": "json" + } + ] + }, + "error": { + "fields": { + "Error 4xx": [ + { + "group": "Error 4xx", + "type": "string", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [ + { + "title": "Error-Response:", + "content": " HTTP/1.1 422\n{\"message\": \"Account already confirmed\", \"data\": {}}", + "type": "json" + }, + { + "title": "Error-Response:", + "content": " HTTP/1.1 428\n{\"message\": \"Account confirmation token does not exist\", \"data\": {}}", + "type": "json" + } + ] + }, + "filename": "routes/api/auth.js", + "groupTitle": "Authentication", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/auth/confirm/resend" + } + ] + }, + { + "type": "post", + "url": "/auth/password/reset", + "title": "reset password", + "name": "resetPassword", + "group": "Authentication", + "version": "0.0.8", + "parameter": { + "fields": { + "Parameter": [ + { + "group": "Parameter", + "type": "String", + "optional": false, + "field": "password", + "description": "

the password of the account

" + } + ] + }, + "examples": [ + { + "title": "Request-Example:", + "content": "{ \"password\": \"hunter2\" }", + "type": "json" + } + ] + }, + "header": { + "fields": { + "Header": [ + { + "group": "Header", + "type": "String", + "optional": false, + "field": "Authentication", + "description": "

the token that was provided in the reset password email

" + } + ] + }, + "examples": [ + { + "title": "Header-Example:", + "content": "{\n \"X-Reset-Token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c\"\n}", + "type": "json" + } + ] + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [ + { + "title": "Success-Response:", + "content": "{\"message\": \"Successfully reset password\", \"data\": {}}", + "type": "json" + } + ] + }, + "permission": [ + { + "name": ": must have authentication token" + } + ], + "filename": "routes/api/auth.js", + "groupTitle": "Authentication", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/auth/password/reset" + } + ] + }, + { + "type": "patch", + "url": "/hacker/batchAccept/", + "title": "accept array of Hackers", + "name": "acceptHacker", + "group": "Hacker", + "version": "3.0.0", + "parameter": { + "fields": { + "body) {{ids: ObjectId[]}} Array of id(s": [ + { + "group": "body) {{ids: ObjectId[]}} Array of id(s", + "optional": false, + "field": "that", + "description": "

needed to be accepted

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

success_ids array and errors array. Errors array will contain a detailed error for why the batch update for a given ID did not work

" + } + ] + }, + "examples": [ + { + "title": "Success-Response:", + "content": "{\n \"message\": \"Hacker batch update successful.\",\n \"data\": {\n \"success_ids\": [\"id1\", \"id2\"]\n \"errors\": [{status: 404, message: \"ACCOUNT_NOT_FOUND\", account: null, hacker_id: \"id3\"}]\n }\n}", + "type": "object" + } + ] + }, + "permission": [ + { + "name": "Administrator" + } + ], + "filename": "routes/api/hacker.js", + "groupTitle": "Hacker", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/hacker/batchAccept/" + } + ] + }, + { + "type": "patch", + "url": "/hacker/acceptEmail/:email", + "title": "accept a Hacker by email", + "name": "acceptHacker", + "group": "Hacker", + "version": "2.0.0", + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

Hacker object

" + } + ] + }, + "examples": [ + { + "title": "Success-Response:", + "content": "{\n \"message\": \"Changed hacker information\",\n \"data\": {\n \"status\": \"Accepted\"\n }\n}", + "type": "object" + } + ] + }, + "permission": [ + { + "name": "Administrator" + } + ], + "filename": "routes/api/hacker.js", + "groupTitle": "Hacker", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/hacker/acceptEmail/:email" + } + ] + }, + { + "type": "patch", + "url": "/hacker/accept/:id", + "title": "accept a Hacker", + "name": "acceptHacker", + "group": "Hacker", + "version": "2.0.0", + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

Hacker object

" + } + ] + }, + "examples": [ + { + "title": "Success-Response:", + "content": "{\n \"message\": \"Changed hacker information\",\n \"data\": {\n \"status\": \"Accepted\"\n }\n}", + "type": "object" + } + ] + }, + "permission": [ + { + "name": "Administrator" + } + ], + "filename": "routes/api/hacker.js", + "groupTitle": "Hacker", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/hacker/accept/:id" + } + ] + }, + { + "type": "patch", + "url": "/hacker/checkin/:id", + "title": "update a hacker's status to be 'Checked-in'. Note that the Hacker must eitehr be Accepted or Confirmed.", + "name": "checkinHacker", + "group": "Hacker", + "version": "0.0.9", + "parameter": { + "fields": { + "body": [ + { + "group": "body", + "type": "string", + "optional": true, + "field": "status", + "description": "

Check-in status. "Checked-in"

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

Hacker object

" + } + ] + }, + "examples": [ + { + "title": "Success-Response:", + "content": "{\n \"message\": \"Changed hacker information\",\n \"data\": {\n \"status\": \"Checked-in\"\n }\n}", + "type": "object" + } + ] + }, + "permission": [ + { + "name": "Administrator" + }, + { + "name": "Volunteer" + } + ], + "filename": "routes/api/hacker.js", + "groupTitle": "Hacker", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/hacker/checkin/:id" + } + ] + }, + { + "type": "post", + "url": "/hacker/", + "title": "create a new hacker", + "name": "createHacker", + "group": "Hacker", + "version": "0.0.8", + "parameter": { + "fields": { + "body": [ + { + "group": "body", + "type": "MongoID", + "optional": false, + "field": "accountId", + "description": "

ObjectID of the respective account

" + }, + { + "group": "body", + "type": "String", + "optional": false, + "field": "school", + "description": "

Name of the school the hacker goes to

" + }, + { + "group": "body", + "type": "String", + "optional": false, + "field": "gender", + "description": "

Gender of the hacker

" + }, + { + "group": "body", + "type": "Number", + "optional": false, + "field": "travel", + "description": "

Whether the hacker requires a bus for transportation

" + }, + { + "group": "body", + "type": "String[]", + "optional": false, + "field": "ethnicity", + "description": "

the ethnicities of the hacker

" + }, + { + "group": "body", + "type": "String[]", + "optional": false, + "field": "major", + "description": "

the major of the hacker

" + }, + { + "group": "body", + "type": "Number", + "optional": false, + "field": "graduationYear", + "description": "

the graduation year of the hacker

" + }, + { + "group": "body", + "type": "Boolean", + "optional": false, + "field": "codeOfConduct", + "description": "

acceptance of the code of conduct

" + }, + { + "group": "body", + "type": "Json", + "optional": false, + "field": "application", + "description": "

The hacker's application. Resume and jobInterest fields are required.

" + } + ] + }, + "examples": [ + { + "title": "application: ", + "content": "{\n \"application\":{\n \"general\":{\n \"school\": \"McGill University\",\n \"degree\": \"Undergraduate\",\n \"fieldOfStudy\": \"Computer Science\",\n \"graduationYear\": \"2021\",\n \"jobInterest\":\"Internship\",\n \"URL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n },\n \"shortAnswer\": {\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"question1\": \"I love McHacks\",\n \"question2\":\"Pls accept me\",\n \"previousHackathons\": \"5\",\n \"comments\":\"hi!\",\n },\n \"other:\" {\n \"gender\": \"male\",\n \"ethnicity\": \"Asian or Pacific Islander\",\n \"privacyPolicy\": true,\n \"codeOfConduct\": true,\n }\n \"accomodation\": {\n \"travel\": 0\n },\n \"location:\" {\n \"timeZone\": \"GMT-5\",\n \"country\": \"Canada\",\n \"city\": \"Montreal\",\n }\n }\n}", + "type": "Json" + } + ] + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

Hacker object

" + } + ] + }, + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Hacker creation successful\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"application\":{\n \"general\":{\n \"school\": \"McGill University\",\n \"degree\": \"Undergraduate\",\n \"fieldOfStudy\": \"Computer Science\",\n \"graduationYear\": \"2021\",\n \"jobInterest\":\"Internship\",\n \"URL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n },\n \"shortAnswer\": {\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"question1\": \"I love McHacks\",\n \"question2\":\"Pls accept me\",\n \"previousHackathons\": \"5\",\n \"comments\":\"hi!\",\n },\n \"other:\" {\n \"gender\": \"male\",\n \"ethnicity\": \"Asian or Pacific Islander\",\n \"privacyPolicy\": true,\n \"codeOfConduct\": true,\n }\n \"accomodation\": {\n \"travel\": 0\n },\n \"location:\" {\n \"timeZone\": \"GMT-5\",\n \"country\": \"Canada\",\n \"city\": \"Montreal\",\n }\n }\n}", + "type": "object" + } + ] + }, + "error": { + "fields": { + "Error 4xx": [ + { + "group": "Error 4xx", + "type": "string", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Error while creating hacker\", \"data\": {}}", + "type": "object" + } + ] + }, + "filename": "routes/api/hacker.js", + "groupTitle": "Hacker", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/hacker/" + } + ] + }, + { + "type": "get", + "url": "/hacker/:id", + "title": "get a hacker's information", + "name": "getHacker", + "group": "Hacker", + "version": "0.0.8", + "parameter": { + "fields": { + "param": [ + { + "group": "param", + "type": "String", + "optional": false, + "field": "id", + "description": "

a hacker's unique mongoID

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "String", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "Object", + "optional": false, + "field": "data", + "description": "

Hacker object

" + } + ] + }, + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Successfully retrieved hacker information\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"status\": \"Applied\",\n \"application\":{\n \"general\":{\n \"school\": \"McGill University\",\n \"degree\": \"Undergraduate\",\n \"fieldOfStudy\": \"Computer Science\",\n \"graduationYear\": \"2021\",\n \"jobInterest\":\"Internship\",\n \"URL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n },\n \"shortAnswer\": {\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"question1\": \"I love McHacks\",\n \"question2\":\"Pls accept me\",\n \"previousHackathons\": \"5\",\n \"comments\":\"hi!\",\n },\n \"other:\" {\n \"gender\": \"male\",\n \"ethnicity\": \"Asian or Pacific Islander\",\n \"privacyPolicy\": true,\n \"codeOfConduct\": true,\n }\n \"accomodation\": {\n \"travel\": 0\n },\n \"location:\" {\n \"timeZone\": \"GMT-5\",\n \"country\": \"Canada\",\n \"city\": \"Montreal\",\n }\n }\n }\n }", + "type": "object" + } + ] + }, + "error": { + "fields": { + "Error 4xx": [ + { + "group": "Error 4xx", + "type": "String", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "Object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Hacker not found\", \"data\": {}}", + "type": "object" + } + ] + }, + "filename": "routes/api/hacker.js", + "groupTitle": "Hacker", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/hacker/:id" + } + ] + }, + { + "type": "get", + "url": "/hacker/email/:email", + "title": "get a hacker's information", + "name": "getHacker", + "group": "Hacker", + "version": "0.0.8", + "parameter": { + "fields": { + "param": [ + { + "group": "param", + "type": "String", + "optional": false, + "field": "email", + "description": "

a hacker's unique email

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "String", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "Object", + "optional": false, + "field": "data", + "description": "

Hacker object

" + } + ] + }, + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Successfully retrieved hacker information\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"status\": \"Applied\",\n \"application\":{\n \"general\":{\n \"school\": \"McGill University\",\n \"degree\": \"Undergraduate\",\n \"fieldOfStudy\": \"Computer Science\",\n \"graduationYear\": \"2021\",\n \"jobInterest\":\"Internship\",\n \"URL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n },\n \"shortAnswer\": {\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"question1\": \"I love McHacks\",\n \"question2\":\"Pls accept me\",\n \"previousHackathons\": \"5\",\n \"comments\":\"hi!\",\n },\n \"other:\" {\n \"gender\": \"male\",\n \"ethnicity\": \"Asian or Pacific Islander\",\n \"privacyPolicy\": true,\n \"codeOfConduct\": true,\n }\n \"accomodation\": {\n \"travel\": 0\n },\n \"location:\" {\n \"timeZone\": \"GMT-5\",\n \"country\": \"Canada\",\n \"city\": \"Montreal\",\n }\n }\n }\n }", + "type": "object" + } + ] + }, + "error": { + "fields": { + "Error 4xx": [ + { + "group": "Error 4xx", + "type": "String", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "Object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Hacker not found\", \"data\": {}}", + "type": "object" + } + ] + }, + "filename": "routes/api/hacker.js", + "groupTitle": "Hacker", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/hacker/email/:email" + } + ] + }, + { + "type": "get", + "url": "/hacker/resume:id", + "title": "get the resume for a hacker.", + "name": "getHackerResume", + "group": "Hacker", + "version": "0.0.8", + "parameter": { + "fields": { + "param": [ + { + "group": "param", + "type": "ObjectId", + "optional": false, + "field": "id", + "description": "

Hacker id

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "String", + "optional": false, + "field": "message", + "description": "

Success message

" + } + ] + }, + "examples": [ + { + "title": "Success-Response:", + "content": "HTTP/1.1 200 OK\n{\n message: \"Downloaded resume\",\n data: {\n id: \"507f191e810c19729de860ea\",\n resume: [Buffer]\n }\n}", + "type": "json" + } + ] + }, + "error": { + "fields": { + "Error 4xx": [ + { + "group": "Error 4xx", + "type": "String", + "optional": false, + "field": "message", + "description": "

"Resume does not exist"

" + } + ] + }, + "examples": [ + { + "title": "Error-Response:", + "content": "HTTP/1.1 404\n{\n message: \"Resume not found\",\n data: {}\n}", + "type": "json" + } + ] + }, + "permission": [ + { + "name": "Must be logged in, and the account id must be linked to the hacker." + } + ], + "filename": "routes/api/hacker.js", + "groupTitle": "Hacker" + }, + { + "type": "get", + "url": "/hacker/stats", + "title": "Gets the stats of all of the hackers who have applied.", + "name": "getHackerStats", + "group": "Hacker", + "version": "0.0.9", + "parameter": { + "fields": { + "query": [ + { + "group": "query", + "type": "String", + "optional": false, + "field": "model", + "description": "

the model to be searched (Only hacker supported)

" + }, + { + "group": "query", + "type": "Array", + "optional": false, + "field": "q", + "description": "

the query to be executed. For more information on how to format this, please see https://docs.mchacks.ca/architecture/

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

Hacker object

" + } + ] + }, + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Retrieved stats\",\n \"data\": {\n \"stats\" : {\n \"total\": 10,\n \"status\": { \"Applied\": 10 },\n \"school\": { \"McGill University\": 3, \"Harvard University\": 7 },\n degree: { \"Undergraduate\": 10 },\n gender: { \"Male\": 1, \"Female\": 9 },\n travel: { \"true\": 7, \"false\": 3 },\n ethnicity: { \"White\": 10, },\n jobInterest: { \"Internship\": 10 },\n major: { \"Computer Science\": 10 },\n graduationYear: { \"2019\": 10 },\n dietaryRestrictions: { \"None\": 10 },\n shirtSize: { \"M\": 3, \"XL\": 7 },\n age: { \"22\": 10 }\n }\n }\n}", + "type": "object" + } + ] + }, + "filename": "routes/api/hacker.js", + "groupTitle": "Hacker", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/hacker/stats" + } + ] + }, + { + "type": "patch", + "url": "/hacker/:id", + "title": "update a hacker's information.", + "description": "

This route only contains the ability to update a subset of a hacker's information. If you want to update a status, you must have Admin priviledges and use PATCH /hacker/status/:id.

", + "name": "patchHacker", + "group": "Hacker", + "version": "0.0.8", + "parameter": { + "fields": { + "body": [ + { + "group": "body", + "type": "String", + "optional": true, + "field": "school", + "description": "

Name of the school the hacker goes to

" + }, + { + "group": "body", + "type": "String", + "optional": true, + "field": "gender", + "description": "

Gender of the hacker

" + }, + { + "group": "body", + "type": "Number", + "optional": true, + "field": "travel", + "description": "

How much the hacker requires a bus for transportation

" + }, + { + "group": "body", + "type": "String[]", + "optional": true, + "field": "ethnicity", + "description": "

the ethnicities of the hacker

" + }, + { + "group": "body", + "type": "String[]", + "optional": true, + "field": "major", + "description": "

the major of the hacker

" + }, + { + "group": "body", + "type": "Number", + "optional": true, + "field": "graduationYear", + "description": "

the graduation year of the hacker

" + }, + { + "group": "body", + "type": "Json", + "optional": true, + "field": "application", + "description": "

The hacker's application

" + } + ] + }, + "examples": [ + { + "title": "application: ", + "content": "{\n \"application\":{\n \"general\":{\n \"school\": \"McGill University\",\n \"degree\": \"Undergraduate\",\n \"fieldOfStudy\": \"Computer Science\",\n \"graduationYear\": \"2021\",\n \"jobInterest\":\"Internship\",\n \"URL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n },\n \"shortAnswer\": {\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"question1\": \"I love McHacks\",\n \"question2\":\"Pls accept me\",\n \"previousHackathons\": \"5\",\n \"comments\":\"hi!\",\n },\n \"other:\" {\n \"gender\": \"male\",\n \"ethnicity\": \"Asian or Pacific Islander\",\n \"privacyPolicy\": true,\n \"codeOfConduct\": true,\n }\n \"accomodation\": {\n \"travel\": 0\n },\n \"location:\" {\n \"timeZone\": \"GMT-5\",\n \"country\": \"Canada\",\n \"city\": \"Montreal\",\n }\n }\n }", + "type": "Json" + } + ] + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

Hacker object

" + } + ] + }, + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Changed hacker information\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"status\": \"Applied\",\n \"application\":{\n \"general\":{\n \"school\": \"McGill University\",\n \"degree\": \"Undergraduate\",\n \"fieldOfStudy\": \"Computer Science\",\n \"graduationYear\": \"2021\",\n \"jobInterest\":\"Internship\",\n \"URL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n },\n \"shortAnswer\": {\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"question1\": \"I love McHacks\",\n \"question2\":\"Pls accept me\",\n \"previousHackathons\": \"5\",\n \"comments\":\"hi!\",\n },\n \"other:\" {\n \"gender\": \"male\",\n \"ethnicity\": \"Asian or Pacific Islander\",\n \"privacyPolicy\": true,\n \"codeOfConduct\": true,\n }\n \"accomodation\": {\n \"travel\": 0\n },\n \"location:\" {\n \"timeZone\": \"GMT-5\",\n \"country\": \"Canada\",\n \"city\": \"Montreal\",\n }\n }\n }\n}", + "type": "object" + } + ] + }, + "error": { + "fields": { + "Error 4xx": [ + { + "group": "Error 4xx", + "type": "string", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Error while updating hacker\", \"data\": {}}", + "type": "object" + } + ] + }, + "filename": "routes/api/hacker.js", + "groupTitle": "Hacker", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/hacker/:id" + } + ] + }, + { + "type": "patch", + "url": "/hacker/confirmation/:id", + "title": "Allows confirmation of hacker attendence if they are accepted. Also allows change from 'confirmed' to 'withdrawn'.", + "name": "patchHackerConfirmed", + "group": "Hacker", + "version": "0.0.9", + "parameter": { + "fields": { + "body": [ + { + "group": "body", + "type": "string", + "optional": true, + "field": "status", + "description": "

The new status of the hacker. "Accepted", "Confirmed", or "Withdrawn"

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

Hacker object

" + } + ] + }, + "examples": [ + { + "title": "Success-Response:", + "content": "{\n \"message\": \"Changed hacker information\",\n \"data\": {\n \"status\": \"Confirmed\"\n }\n}", + "type": "object" + } + ] + }, + "permission": [ + { + "name": "Administrator" + }, + { + "name": "Hacker" + } + ], + "filename": "routes/api/hacker.js", + "groupTitle": "Hacker", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/hacker/confirmation/:id" + } + ] + }, + { + "type": "patch", + "url": "/hacker/status/:id", + "title": "update a hacker's status", + "name": "patchHackerStatus", + "group": "Hacker", + "version": "0.0.9", + "parameter": { + "fields": { + "body": [ + { + "group": "body", + "type": "string", + "optional": true, + "field": "status", + "description": "

Status of the hacker's application ("None"|"Applied"|"Accepted"|"Declined"|"Waitlisted"|"Confirmed"|"Withdrawn"|"Checked-in")

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

Hacker object

" + } + ] + }, + "examples": [ + { + "title": "Success-Response:", + "content": "{\n \"message\": \"Changed hacker information\",\n \"data\": {\n \"status\": \"Accepted\"\n }\n}", + "type": "object" + } + ] + }, + "permission": [ + { + "name": "Administrator" + } + ], + "filename": "routes/api/hacker.js", + "groupTitle": "Hacker", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/hacker/status/:id" + } + ] + }, + { + "type": "post", + "url": "/hacker/resume/:id", + "title": "upload or update resume for a hacker.", + "name": "postHackerResume", + "group": "Hacker", + "version": "0.0.8", + "description": "

NOTE: This must be sent via multipart/form-data POST request

", + "parameter": { + "fields": { + "param": [ + { + "group": "param", + "type": "ObjectId", + "optional": false, + "field": "id", + "description": "

Hacker id

" + } + ], + "body": [ + { + "group": "body", + "type": "File", + "optional": false, + "field": "resume", + "description": "

The uploaded file.

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "String", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "Object", + "optional": false, + "field": "data", + "description": "

Location in the bucket that the file was stored.

" + } + ] + }, + "examples": [ + { + "title": "Success-Response:", + "content": "HTTP/1.1 200 OK\n{\n message: \"Uploaded resume\",\n data: {\n filename: \"resumes/1535032624768-507f191e810c19729de860ea\"\n }\n}", + "type": "json" + } + ] + }, + "permission": [ + { + "name": "Must be logged in, and the account id must be linked to the hacker." + } + ], + "filename": "routes/api/hacker.js", + "groupTitle": "Hacker", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/hacker/resume/:id" + } + ] + }, + { + "type": "post", + "url": "/hacker/email/dayOf/:id", + "title": "", + "description": "

Sends a hacker the day-of email, along with the HackPass QR code to view their hacker profile (for checkin purposes). Hackers must be either confirmed, or checked in.

", + "name": "postHackerSendDayOfEmail", + "group": "Hacker", + "version": "0.0.9", + "parameter": { + "fields": { + "param": [ + { + "group": "param", + "type": "string", + "optional": true, + "field": "status", + "description": "

The hacker ID

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [ + { + "title": "Success-Response:", + "content": "{\n \"message\": \"Hacker day-of email sent.\",\n \"data\": {}\n}", + "type": "object" + } + ] + }, + "permission": [ + { + "name": "Administrator" + } + ], + "filename": "routes/api/hacker.js", + "groupTitle": "Hacker", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/hacker/email/dayOf/:id" + } + ] + }, + { + "type": "post", + "url": "/hacker/email/weekOf/:id", + "title": "", + "description": "

Sends a hacker the week-of email, along with the HackPass QR code to view their hacker profile (for checkin purposes). Hackers must be either confirmed, or checked in.

", + "name": "postHackerSendWeekOfEmail", + "group": "Hacker", + "version": "0.0.9", + "parameter": { + "fields": { + "param": [ + { + "group": "param", + "type": "string", + "optional": true, + "field": "status", + "description": "

The hacker ID

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [ + { + "title": "Success-Response:", + "content": "{\n \"message\": \"Hacker week-of email sent.\",\n \"data\": {}\n}", + "type": "object" + } + ] + }, + "permission": [ + { + "name": "Administrator" + } + ], + "filename": "routes/api/hacker.js", + "groupTitle": "Hacker", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/hacker/email/weekOf/:id" + } + ] + }, + { + "type": "post", + "url": "/hacker/email/weekOf/:id", + "title": "", + "description": "

Sends a hacker the week-of email, along with the HackPass QR code to view their hacker profile (for checkin purposes). Hackers must be eitherconfirmed, or checked in.

", + "name": "postHackerSendWeekOfEmail", + "group": "Hacker", + "version": "0.0.9", + "parameter": { + "fields": { + "param": [ + { + "group": "param", + "type": "string", + "optional": true, + "field": "status", + "description": "

The hacker ID

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [ + { + "title": "Success-Response:", + "content": "{\n \"message\": \"Hacker week-of email sent.\",\n \"data\": {}\n}", + "type": "object" + } + ] + }, + "permission": [ + { + "name": "Administrator" + } + ], + "filename": "routes/api/hacker.js", + "groupTitle": "Hacker", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/hacker/email/weekOf/:id" + } + ] + }, + { + "type": "get", + "url": "/sponsor/self", + "title": "get information about logged in sponsor", + "name": "self", + "group": "Hacker", + "version": "1.4.1", + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "String", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "Object", + "optional": false, + "field": "data", + "description": "

Sponsor object

" + } + ] + }, + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Successfully retrieved sponsor information\", \n \"data\": {\n \"id\": \"5bff4d736f86be0a41badb91\",\n \"accountId\": \"5bff4d736f86be0a41badb99\",\n \"tier\": 3,\n \"company\": \"companyName\",\n \"contractURL\": \"https://www.contractHere.com\",\n \"nominees\": [\"5bff4d736f86be0a41badb93\",\"5bff4d736f86be0a41badb94\"]\n }\n }", + "type": "object" + } + ] + }, + "error": { + "fields": { + "Error 4xx": [ + { + "group": "Error 4xx", + "type": "String", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "Object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Sponsor not found\", \"data\": {}}", + "type": "object" + } + ] + }, + "permission": [ + { + "name": ": Sponsor" + } + ], + "filename": "routes/api/sponsor.js", + "groupTitle": "Hacker", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/sponsor/self" + } + ] + }, + { + "type": "get", + "url": "/hacker/self", + "title": "get information about own hacker", + "name": "self", + "group": "Hacker", + "version": "0.0.8", + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

Hacker object

" + } + ] + }, + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Hacker found by logged in account id\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"application\":{\n \"URL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n },\n \"status\":\"Applied\",\n \"ethnicity\":[\"White or Caucasian\",\" Asian or Pacific Islander\"],\n \"accountId\":\"5bff2a35e533b0f6562b4998\",\n \"school\":\"McPherson College\",\n \"gender\":\"Female\",\n \"travel\":0,\n \"major\":[\"Accounting\"],\n \"graduationYear\":2019,\n \"codeOfConduct\":true,\n } \n }", + "type": "object" + } + ] + }, + "error": { + "fields": { + "Error 4xx": [ + { + "group": "Error 4xx", + "type": "string", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Hacker not found\", \"data\": {}}", + "type": "object" + } + ] + }, + "filename": "routes/api/hacker.js", + "groupTitle": "Hacker", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/hacker/self" + } + ] + }, + { + "type": "get", + "url": "/", + "title": "version", + "version": "0.0.8", + "name": "index", + "group": "Index", + "permission": [ + { + "name": "public" + } + ], + "filename": "routes/index.js", + "groupTitle": "Index", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/" + } + ] + }, + { + "type": "post", + "url": "/api/role/", + "title": "create a new role", + "name": "createRole", + "group": "Role", + "version": "1.1.1", + "parameter": { + "fields": { + "body": [ + { + "group": "body", + "type": "String", + "optional": false, + "field": "name", + "description": "

Name of the route

" + }, + { + "group": "body", + "type": "Route[]", + "optional": false, + "field": "routes", + "description": "

The routes that this role gives access to

" + } + ] + }, + "examples": [ + { + "title": "application: ", + "content": "{\n \"name\": \"routename\",\n \"routes\": [\n {\n uri: \"/api/hacker/\"\n requestType: \"POST\"\n }\n ]\n}", + "type": "Json" + } + ] + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

Role object

" + } + ] + }, + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Role creation successful\", \n \"data\": {\n \"name\": \"routename\",\n \"routes\": [\n {\n uri: \"/api/hacker/\"\n requestType: \"POST\"\n }\n ]\n }\n}", + "type": "object" + } + ] + }, + "error": { + "fields": { + "Error 4xx": [ + { + "group": "Error 4xx", + "type": "string", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Error while creating role\", \"data\": {}}", + "type": "object" + } + ] + }, + "filename": "routes/api/role.js", + "groupTitle": "Role", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/api/role/" + } + ] + }, + { + "type": "get", + "url": "/search/", + "title": "provide a specific query for any defined model", + "name": "search", + "group": "Search", + "version": "0.0.8", + "parameter": { + "fields": { + "query": [ + { + "group": "query", + "type": "String", + "optional": false, + "field": "model", + "description": "

the model to be searched

" + }, + { + "group": "query", + "type": "Array", + "optional": false, + "field": "q", + "description": "

the query to be executed. For more information on how to format this, please see https://docs.mchacks.ca/architecture/

" + }, + { + "group": "query", + "type": "String", + "optional": false, + "field": "sort", + "description": "

either "asc" or "desc"

" + }, + { + "group": "query", + "type": "number", + "optional": false, + "field": "page", + "description": "

the page number that you would like

" + }, + { + "group": "query", + "type": "number", + "optional": false, + "field": "limit", + "description": "

the maximum number of results that you would like returned

" + }, + { + "group": "query", + "type": "any", + "optional": false, + "field": "sort_by", + "description": "

any parameter you want to sort the results by

" + }, + { + "group": "query", + "type": "boolean", + "optional": false, + "field": "expand", + "description": "

whether you want to expand sub documents within the results

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "String", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "Object", + "optional": false, + "field": "data", + "description": "

Results

" + } + ] + }, + "examples": [ + { + "title": "Success-Response:", + "content": "{\n \"message\": \"Successfully executed query, returning all results\",\n \"data\": [\n {...}\n ]\n }", + "type": "object" + }, + { + "title": "Success-Response:", + "content": "{\n \"message\": \"No results found.\",\n \"data\": {}\n }", + "type": "object" + } + ] + }, + "error": { + "fields": { + "Error 4xx": [ + { + "group": "Error 4xx", + "type": "String", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "Object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [ + { + "title": "Error-Response:", + "content": "{\"message\": \"Validation failed\", \"data\": {}}", + "type": "object" + } + ] + }, + "filename": "routes/api/search.js", + "groupTitle": "Search", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/search/" + } + ] + }, + { + "type": "get", + "url": "/settings/", + "title": "Get the settings for the current hackathon", + "name": "getSettings", + "group": "Settings", + "version": "1.1.1", + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

Settings Object

" + } + ] + }, + "examples": [ + { + "title": "Success-Response:", + "content": "{\n \"message\": \"Settings creation successful.\",\n \"data\": {\n \"settings\": {\n openTime: \"Wed Feb 06 2019 00:00:00 GMT-0500 (GMT-05:00)\",\n closeTime: \"Sat Feb 01 2020 00:00:00 GMT-0500 (GMT-05:00)\",\n confirmTime: \"Sat Feb 20 2020 00:00:00 GMT-0500 (GMT-05:00)\",\n isRemote: false\n }\n }\n}", + "type": "object" + } + ] + }, + "permission": [ + { + "name": "public" + } + ], + "filename": "routes/api/settings.js", + "groupTitle": "Settings", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/settings/" + } + ] + }, + { + "type": "patch", + "url": "/settings/", + "title": "Patch the settings for the current hackathon", + "name": "patchSettings", + "group": "Settings", + "version": "1.1.1", + "parameter": { + "fields": { + "body": [ + { + "group": "body", + "type": "Date", + "optional": true, + "field": "openTime", + "description": "

The opening time for the hackathon.

" + }, + { + "group": "body", + "type": "Date", + "optional": true, + "field": "closeTime", + "description": "

The closing time for the hackathon.

" + }, + { + "group": "body", + "type": "Date", + "optional": true, + "field": "confirmTime", + "description": "

The deadline for confirmation for the hackathon.

" + }, + { + "group": "body", + "type": "Boolean", + "optional": true, + "field": "isRemote", + "description": "

Whether this hackathon is remote or not.

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

Settings Object

" + } + ] + }, + "examples": [ + { + "title": "Success-Response:", + "content": "{\n \"message\": \"Settings patch successful.\",\n \"data\": {\n \"settings\": {\n openTime: \"Wed Feb 06 2019 00:00:00 GMT-0500 (GMT-05:00)\",\n closeTime: \"Sat Feb 01 2020 00:00:00 GMT-0500 (GMT-05:00)\",\n confirmTime: \"Sat Feb 20 2020 00:00:00 GMT-0500 (GMT-05:00)\",\n isRemote: true\n }\n }\n}", + "type": "object" + } + ] + }, + "permission": [ + { + "name": "Administrators" + } + ], + "filename": "routes/api/settings.js", + "groupTitle": "Settings", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/settings/" + } + ] + }, + { + "type": "post", + "url": "/sponsor/", + "title": "create a new sponsor", + "name": "createSponsor", + "group": "Sponsor", + "version": "0.0.8", + "parameter": { + "fields": { + "body": [ + { + "group": "body", + "type": "MongoID", + "optional": false, + "field": "accountId", + "description": "

ObjectID of the respective account.

" + }, + { + "group": "body", + "type": "Number", + "optional": false, + "field": "tier", + "description": "

Tier of the sponsor, from 0 to 5. 0 is lowest tier, and 5 is the custom tier.

" + }, + { + "group": "body", + "type": "String", + "optional": false, + "field": "company", + "description": "

Name of the company.

" + }, + { + "group": "body", + "type": "String", + "optional": false, + "field": "contractURL", + "description": "

URL link to the contract with the company.

" + }, + { + "group": "body", + "type": "MongoID[]", + "optional": false, + "field": "nominees", + "description": "

Array of accounts that the company wish to nominate as hackers.

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "String", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "Object", + "optional": false, + "field": "data", + "description": "

Sponsor object

" + } + ] + }, + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Sponsor creation successful\", \n \"data\": {...}\n }", + "type": "object" + } + ] + }, + "error": { + "fields": { + "Error 4xx": [ + { + "group": "Error 4xx", + "type": "String", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "Object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Error while creating sponsor\", \"data\": {}}", + "type": "object" + } + ] + }, + "filename": "routes/api/sponsor.js", + "groupTitle": "Sponsor", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/sponsor/" + } + ] + }, + { + "type": "get", + "url": "/sponsor/:id", + "title": "get a sponsor's information", + "name": "getSponsor", + "group": "Sponsor", + "version": "0.0.8", + "parameter": { + "fields": { + "param": [ + { + "group": "param", + "type": "string", + "optional": false, + "field": "id", + "description": "

a sponsor's unique mongoID

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "String", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "Object", + "optional": false, + "field": "data", + "description": "

Sponsor object

" + } + ] + }, + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Successfully retrieved sponsor information\", \n \"data\": {\n \"id\": \"5bff4d736f86be0a41badb91\",\n \"accountId\": \"5bff4d736f86be0a41badb99\",\n \"tier\": 3,\n \"company\": \"companyName\",\n \"contractURL\": \"https://www.contractHere.com\",\n \"nominees\": [\"5bff4d736f86be0a41badb93\",\"5bff4d736f86be0a41badb94\"]\n }\n }", + "type": "object" + } + ] + }, + "error": { + "fields": { + "Error 4xx": [ + { + "group": "Error 4xx", + "type": "String", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "Object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Sponsor not found\", \"data\": {}}", + "type": "object" + } + ] + }, + "filename": "routes/api/sponsor.js", + "groupTitle": "Sponsor", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/sponsor/:id" + } + ] + }, + { + "type": "patch", + "url": "/sponsor/", + "title": "update a sponsor", + "name": "patchSponsor", + "group": "Sponsor", + "version": "1.3.0", + "parameter": { + "fields": { + "param": [ + { + "group": "param", + "type": "ObjectId", + "optional": false, + "field": "id", + "description": "

ObjectID of the sponsor

" + } + ], + "body": [ + { + "group": "body", + "type": "String", + "optional": false, + "field": "company", + "description": "

Name of the company.

" + }, + { + "group": "body", + "type": "String", + "optional": false, + "field": "contractURL", + "description": "

URL link to the contract with the company.

" + }, + { + "group": "body", + "type": "ObjectId[]", + "optional": false, + "field": "nominees", + "description": "

Array of accounts that the company wish to nominate as hackers.

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "String", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "Object", + "optional": false, + "field": "data", + "description": "

Sponsor object

" + } + ] + }, + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Sponsor update successful\", \n \"data\": {...}\n }", + "type": "object" + } + ] + }, + "error": { + "fields": { + "Error 4xx": [ + { + "group": "Error 4xx", + "type": "String", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "Object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Error while updating sponsor\", \"data\": {}}", + "type": "object" + } + ] + }, + "filename": "routes/api/sponsor.js", + "groupTitle": "Sponsor", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/sponsor/" + } + ] + }, + { + "type": "post", + "url": "/team/", + "title": "create a new team consisting of only the logged in user", + "name": "createTeam", + "group": "Team", + "version": "0.0.8", + "parameter": { + "fields": { + "body": [ + { + "group": "body", + "type": "String", + "optional": false, + "field": "name", + "description": "

Name of the team.

" + }, + { + "group": "body", + "type": "String", + "optional": true, + "field": "devpostURL", + "description": "

Devpost link to hack. Once the link is sent, the hack will be considered to be submitted.

" + }, + { + "group": "body", + "type": "String", + "optional": true, + "field": "projectName", + "description": "

Name of the team.

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

Team object

" + } + ] + }, + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Team creation successful\", \n \"data\": {...}\n }", + "type": "object" + } + ] + }, + "error": { + "fields": { + "Error 4xx": [ + { + "group": "Error 4xx", + "type": "string", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Error while creating team\", \"data\": {}}", + "type": "object" + } + ] + }, + "filename": "routes/api/team.js", + "groupTitle": "Team", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/team/" + } + ] + }, + { + "type": "patch", + "url": "/team/leave/", + "title": "Allows a logged in hacker to leave current team", + "name": "deleteSelfFromTeam", + "group": "Team", + "version": "1.1.1", + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

{}

" + } + ] + }, + "examples": [ + { + "title": "Success-Response:", + "content": "{\n \"message\": \"Removal from team successful.\",\n \"data\": {}\n}", + "type": "object" + } + ] + }, + "filename": "routes/api/team.js", + "groupTitle": "Team", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/team/leave/" + } + ] + }, + { + "type": "get", + "url": "/team/:id", + "title": "get a team's information", + "name": "getTeam", + "group": "Team", + "version": "0.0.8", + "parameter": { + "fields": { + "param": [ + { + "group": "param", + "type": "ObjectId", + "optional": false, + "field": "id", + "description": "

MongoId of the team

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "String", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "Object", + "optional": false, + "field": "data", + "description": "

Team object

" + } + ] + }, + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Team retrieval successful\", \n \"data\": { \n \"team\": {\n \"name\":\"foo\",\n \"members\": [\n ObjectId('...')\n ],\n \"devpostURL\": \"www.devpost.com/foo\",\n \"projectName\": \"fooey\"\n },\n \"members\": [\n {\n \"firstName\": \"John\",\n \"lastName\": \"Doe\"\n }\n ],\n }\n }", + "type": "object" + } + ] + }, + "error": { + "fields": { + "Error 4xx": [ + { + "group": "Error 4xx", + "type": "String", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "Object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Team not found\", \"data\": {}}", + "type": "object" + } + ] + }, + "filename": "routes/api/team.js", + "groupTitle": "Team", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/team/:id" + } + ] + }, + { + "type": "patch", + "url": "/team/join/", + "title": "Allows a logged in hacker to join a team by name", + "name": "patchJoinTeam", + "group": "Team", + "version": "1.1.1", + "parameter": { + "fields": { + "body": [ + { + "group": "body", + "type": "string", + "optional": true, + "field": "name", + "description": "

Name of the team to join

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

{}

" + } + ] + }, + "examples": [ + { + "title": "Success-Response:", + "content": "{\n \"message\": \"Team join successful.\",\n \"data\": {}\n}", + "type": "object" + } + ] + }, + "filename": "routes/api/team.js", + "groupTitle": "Team", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/team/join/" + } + ] + }, + { + "type": "patch", + "url": "/team/:hackerId", + "title": "Update a team's information. The team is specified by the hacker belonging to it.", + "name": "patchTeam", + "group": "Team", + "version": "0.0.8", + "description": "

We use hackerId instead of teamId because authorization requires a one-to-one mapping from param id to accountId, but we are not able to have that from teamId to accountId due to multiple members in a team. Instead, we use hackerId, as there is a 1 to 1 link between hackerId to teamId, and a 1 to 1 link between hackerId and accountId

", + "parameter": { + "fields": { + "param": [ + { + "group": "param", + "type": "ObjectId", + "optional": false, + "field": "hackerId", + "description": "

a hacker's unique Id

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "String", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "Object", + "optional": false, + "field": "data", + "description": "

Team object

" + } + ] + }, + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Team update successful.\", \n \"data\": {...}\n }", + "type": "object" + } + ] + }, + "error": { + "fields": { + "Error 4xx": [ + { + "group": "Error 4xx", + "type": "String", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "Object", + "optional": false, + "field": "data", + "description": "

Query input that caused the error.

" + } + ] + }, + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Team not found\", \"data\": {teamId}}", + "type": "object" + } + ] + }, + "filename": "routes/api/team.js", + "groupTitle": "Team", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/team/:hackerId" + } + ] + }, + { + "type": "post", + "url": "/travel/", + "title": "create a new travel", + "name": "createTravel", + "group": "Travel", + "version": "2.0.1", + "parameter": { + "fields": { + "body": [ + { + "group": "body", + "type": "MongoID", + "optional": false, + "field": "accountId", + "description": "

ObjectID of the respective account

" + }, + { + "group": "body", + "type": "MongoID", + "optional": false, + "field": "hackerId", + "description": "

ObjectID of the respective hacker

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

Travel object

" + } + ] + }, + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Travel creation successful\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"status\": \"None\",\n \"request\": 50,\n \"offer\": 0\n }\n}", + "type": "object" + } + ] + }, + "error": { + "fields": { + "Error 4xx": [ + { + "group": "Error 4xx", + "type": "string", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Error while creating travel\", \"data\": {}}", + "type": "object" + } + ] + }, + "filename": "routes/api/travel.js", + "groupTitle": "Travel", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/travel/" + } + ] + }, + { + "type": "get", + "url": "/travel/email/:email", + "title": "get a travel's information", + "name": "getTravel", + "group": "Travel", + "version": "2.0.1", + "parameter": { + "fields": { + "param": [ + { + "group": "param", + "type": "String", + "optional": false, + "field": "email", + "description": "

a travel's unique email

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "String", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "Object", + "optional": false, + "field": "data", + "description": "

Travel object

" + } + ] + }, + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Successfully retrieved travel information\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"status\": \"Valid\",\n \"request\": 100,\n \"offer\": 50\n }\n }", + "type": "object" + } + ] + }, + "error": { + "fields": { + "Error 4xx": [ + { + "group": "Error 4xx", + "type": "String", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "Object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Travel not found\", \"data\": {}}", + "type": "object" + } + ] + }, + "filename": "routes/api/travel.js", + "groupTitle": "Travel", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/travel/email/:email" + } + ] + }, + { + "type": "get", + "url": "/travel/:id", + "title": "get a traveler's information", + "name": "getTravel", + "group": "Travel", + "version": "2.0.1", + "parameter": { + "fields": { + "param": [ + { + "group": "param", + "type": "String", + "optional": false, + "field": "id", + "description": "

a travel's unique mongoID

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "String", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "Object", + "optional": false, + "field": "data", + "description": "

Travel object

" + } + ] + }, + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Successfully retrieved travel information\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"status\": \"Valid\",\n \"request\": 100,\n \"offer\": 50\n }\n }", + "type": "object" + } + ] + }, + "error": { + "fields": { + "Error 4xx": [ + { + "group": "Error 4xx", + "type": "String", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "Object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Travel not found\", \"data\": {}}", + "type": "object" + } + ] + }, + "filename": "routes/api/travel.js", + "groupTitle": "Travel", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/travel/:id" + } + ] + }, + { + "type": "patch", + "url": "/travel/offer/:id", + "title": "update a traveler's offer", + "name": "patchTravelOffer", + "group": "Travel", + "version": "2.0.1", + "parameter": { + "fields": { + "body": [ + { + "group": "body", + "type": "number", + "optional": true, + "field": "offer", + "description": "

Amount of money offered for travel

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

Travel object

" + } + ] + }, + "examples": [ + { + "title": "Success-Response:", + "content": "{\n \"message\": \"Changed travel information\",\n \"data\": {\n \"offer\": 75\n }\n}", + "type": "object" + } + ] + }, + "permission": [ + { + "name": "Administrator" + } + ], + "filename": "routes/api/travel.js", + "groupTitle": "Travel", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/travel/offer/:id" + } + ] + }, + { + "type": "patch", + "url": "/travel/status/:id", + "title": "update a traveler's status", + "name": "patchTravelStatus", + "group": "Travel", + "version": "2.0.1", + "parameter": { + "fields": { + "body": [ + { + "group": "body", + "type": "string", + "optional": true, + "field": "status", + "description": "

Status of the travel's reimbursement ("None"|"Bus"|"Offered"|"Valid"|"Invalid"|"Claimed")

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

Travel object

" + } + ] + }, + "examples": [ + { + "title": "Success-Response:", + "content": "{\n \"message\": \"Changed travel information\",\n \"data\": {\n \"status\": \"Accepted\"\n }\n}", + "type": "object" + } + ] + }, + "permission": [ + { + "name": "Administrator" + } + ], + "filename": "routes/api/travel.js", + "groupTitle": "Travel", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/travel/status/:id" + } + ] + }, + { + "type": "get", + "url": "/travel/self", + "title": "get information about own hacker's travel", + "name": "self", + "group": "Travel", + "version": "2.0.1", + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

Travel object

" + } + ] + }, + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Travel found by logged in account id\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"status\": \"Claimed\"\n \"request\": 90,\n \"offer\": 80\n } \n }", + "type": "object" + } + ] + }, + "error": { + "fields": { + "Error 4xx": [ + { + "group": "Error 4xx", + "type": "string", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Travel not found\", \"data\": {}}", + "type": "object" + } + ] + }, + "filename": "routes/api/travel.js", + "groupTitle": "Travel", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/travel/self" + } + ] + }, + { + "type": "post", + "url": "/volunteer/", + "title": "create a new volunteer", + "name": "createVolunteer", + "group": "Volunteer", + "version": "0.0.8", + "parameter": { + "fields": { + "body": [ + { + "group": "body", + "type": "MongoID", + "optional": false, + "field": "accountId", + "description": "

MongoID of the account of the volunteer

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

Volunteer object

" + } + ] + }, + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Volunteer creation successful\", \n \"data\": {...}\n }", + "type": "object" + } + ] + }, + "error": { + "fields": { + "Error 4xx": [ + { + "group": "Error 4xx", + "type": "string", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Error while creating volunteer\", \"data\": {}}", + "type": "object" + } + ] + }, + "filename": "routes/api/volunteer.js", + "groupTitle": "Volunteer", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/volunteer/" + } + ] + }, + { + "type": "get", + "url": "/volunteer/:id", + "title": "get a volunteer's information", + "name": "getVolunteer", + "group": "Volunteer", + "version": "1.3.0", + "parameter": { + "fields": { + "param": [ + { + "group": "param", + "type": "ObjectId", + "optional": false, + "field": "id", + "description": "

a volunteer's unique mongoID

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "String", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "Object", + "optional": false, + "field": "data", + "description": "

Volunteer object

" + } + ] + }, + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Successfully retrieved volunteer information\", \n \"data\": {...}\n }", + "type": "object" + } + ] + }, + "error": { + "fields": { + "Error 4xx": [ + { + "group": "Error 4xx", + "type": "String", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "Object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Volunteer not found\", \"data\": {}}", + "type": "object" + } + ] + }, + "filename": "routes/api/volunteer.js", + "groupTitle": "Volunteer", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/volunteer/:id" + } + ] + } +] }); diff --git a/docs/api/api_data.json b/docs/api/api_data.json index b846536d..2c40a0dd 100644 --- a/docs/api/api_data.json +++ b/docs/api/api_data.json @@ -1 +1,4150 @@ -[ { "type": "post", "url": "/account/", "title": "create a new account", "name": "create", "group": "Account", "version": "0.0.8", "parameter": { "fields": { "body": [ { "group": "body", "type": "String", "optional": false, "field": "firstName", "description": "

First name of the account creator.

" }, { "group": "body", "type": "String", "optional": false, "field": "lastName", "description": "

Last name of the account creator.

" }, { "group": "body", "type": "String", "optional": false, "field": "pronoun", "description": "

the pronoun of the account creator.

" }, { "group": "body", "type": "String", "optional": false, "field": "email", "description": "

Email of the account.

" }, { "group": "body", "type": "String", "optional": false, "field": "gender", "description": "

Gender of the account creator.

" }, { "group": "body", "type": "String[]", "optional": false, "field": "dietaryRestrictions", "description": "

Any dietary restrictions for the user. 'None' if there are no restrictions

" }, { "group": "body", "type": "String", "optional": false, "field": "password", "description": "

The password of the account.

" }, { "group": "body", "type": "String", "optional": false, "field": "birthDate", "description": "

a Date parsable string.

" }, { "group": "body", "type": "Number", "optional": true, "field": "phoneNumber", "description": "

the user's phone number, represented as a string.

" } ], "header": [ { "group": "header", "type": "JWT", "optional": true, "field": "token", "description": "

the user's invite token.

" } ] }, "examples": [ { "title": "Request-Example:", "content": "{ \n \"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"password\":\"hunter2\",\n \"phoneNumber\":1234567890,\n \"gender\":\"Male\",\n \"birthDate\":\"10/30/1997\"\n}", "type": "json" } ] }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

Account object

" } ] }, "examples": [ { "title": "Success-Response: ", "content": "{\n \"message\": \"Account creation successful\", \n \"data\": {\n \"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \t\"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"phoneNumber\":1234567890,\n \t\"gender\":\"Male\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", "type": "object" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "string", "optional": false, "field": "message", "description": "

Error message

" }, { "group": "Error 4xx", "type": "object", "optional": false, "field": "data", "description": "

empty

" } ] }, "examples": [ { "title": "Error-Response: ", "content": "{\n \"message\": \"Account already exists\", \n \"data\": {\n \"route\": \"/\"\n }\n}", "type": "object" } ] }, "filename": "routes/api/account.js", "groupTitle": "Account", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/account/" } ] }, { "type": "get", "url": "/account/:id", "title": "gets information from an account with mongoid ':id'", "name": "getAccount", "group": "Account", "version": "0.0.8", "parameter": { "fields": { "param": [ { "group": "param", "type": "ObjectId", "optional": false, "field": "id", "description": "

MongoId of an account

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

Account object

" } ] }, "examples": [ { "title": "Success-Response: ", "content": "{\n \"message\": \"Account found by user id\", \n \"data\": {\n \"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"phoneNumber\":1234567890,\n \"gender\":\"Male\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", "type": "object" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "string", "optional": false, "field": "message", "description": "

Error message

" }, { "group": "Error 4xx", "type": "object", "optional": false, "field": "data", "description": "

empty

" } ] }, "examples": [ { "title": "Error-Response: ", "content": "{\"message\": \"Account not found\", \"data\": {}}", "type": "object" } ] }, "filename": "routes/api/account.js", "groupTitle": "Account", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/account/:id" } ] }, { "type": "get", "url": "/account/invite", "title": "Get all of the invites.", "name": "getAllInvites", "group": "Account", "version": "0.0.8", "description": "

Get all of the invites that currently exist in the database.

", "success": { "examples": [ { "title": "Success-Response: ", "content": "{\n \"message\": \"Invite retrieval successful.\", \n \"data\": [{\n \"email\":\"abc@def.com\",\n \"accountType\":\"Hacker\"\n }]\n }", "type": "object" } ] }, "filename": "routes/api/account.js", "groupTitle": "Account", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/account/invite" } ] }, { "type": "post", "url": "/account/invite", "title": "invites a user to create an account with the specified accountType", "name": "inviteAccount", "group": "Account", "version": "0.0.8", "description": "

sends link with token to be used with the account/create route

", "parameter": { "fields": { "body": [ { "group": "body", "type": "String", "optional": true, "field": "email", "description": "

email of the account to be created and where to send the link

" }, { "group": "body", "type": "String", "optional": true, "field": "accountType", "description": "

the type of the account which the user can create, for sponsor this should specify tier as well

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

Account object

" } ] }, "examples": [ { "title": "Success-Response: ", "content": "{\n \"message\": \"Successfully invited user\", \n \"data\": {}\n }", "type": "object" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "string", "optional": false, "field": "message", "description": "

Error message

" }, { "group": "Error 4xx", "type": "object", "optional": false, "field": "data", "description": "

Error object

" } ] }, "examples": [ { "title": "Error-Response:", "content": "{\n \"message\": \"Invalid Authentication\",\n \"data\": {\n \"route\": \"/invite\"\n }\n }", "type": "object" } ] }, "filename": "routes/api/account.js", "groupTitle": "Account", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/account/invite" } ] }, { "type": "get", "url": "/account/self", "title": "get information about own account", "name": "self", "group": "Account", "version": "0.0.8", "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

Account object

" } ] }, "examples": [ { "title": "Success-Response: ", "content": "{\n \"message\": \"Account found by user email\", \n \"data\": {\n \t\"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \t\"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"phoneNumber\":1234567890,\n \t\"gender\":\"Male\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", "type": "object" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "string", "optional": false, "field": "message", "description": "

Error message

" }, { "group": "Error 4xx", "type": "object", "optional": false, "field": "data", "description": "

empty object

" } ] }, "examples": [ { "title": "Error-Response: ", "content": "{\"message\": \"Account not found\", \"data\": {}}", "type": "object" } ] }, "filename": "routes/api/account.js", "groupTitle": "Account", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/account/self" } ] }, { "type": "patch", "url": "/account/:id", "title": "update an account's information", "name": "updateOneUser", "group": "Account", "version": "0.0.8", "parameter": { "fields": { "body": [ { "group": "body", "type": "String", "optional": true, "field": "firstName", "description": "

First name of the account creator.

" }, { "group": "body", "type": "String", "optional": true, "field": "lastName", "description": "

Last name of the account creator.

" }, { "group": "body", "type": "String", "optional": true, "field": "pronoun", "description": "

The pronoun of the account creator.

" }, { "group": "body", "type": "String", "optional": true, "field": "email", "description": "

Email of the account.

" }, { "group": "body", "type": "String", "optional": true, "field": "gender", "description": "

Gender of the account creator.

" }, { "group": "body", "type": "String", "optional": true, "field": "birthDate", "description": "

A Date parsable string.

" }, { "group": "body", "type": "Number", "optional": true, "field": "phoneNumber", "description": "

The user's phone number, represented as a string.

" }, { "group": "body", "type": "String[]", "optional": true, "field": "dietaryRestrictions", "description": "

Any dietary restrictions for the user. 'None' if there are no restrictions

" } ] }, "examples": [ { "title": "Request-Example:", "content": "{ \"gender\": \"Male\" }", "type": "json" } ] }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

Account object

" } ] }, "examples": [ { "title": "Success-Response: ", "content": "{\n \"message\": \"Account update successful.\", \n \"data\": {\n \"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \t\"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"phoneNumber\":1234567890,\n \t\"gender\": \"Male\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", "type": "object" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "string", "optional": false, "field": "message", "description": "

Error message

" }, { "group": "Error 4xx", "type": "object", "optional": false, "field": "data", "description": "

empty

" } ] }, "examples": [ { "title": "Error-Response: ", "content": "{\"message\": \"Error while updating account\", \"data\": {}}", "type": "object" } ] }, "filename": "routes/api/account.js", "groupTitle": "Account", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/account/:id" } ] }, { "type": "patch", "url": "/auth/password/change", "title": "change password for logged in user", "name": "changePassword", "group": "Authentication", "version": "0.0.8", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "oldPassword", "description": "

The current password of the user

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "newPassword", "description": "

The new password of the user

" } ] }, "examples": [ { "title": "Request-Example:", "content": "{\n \"oldPassword\": \"password12345\",\n \"newPassword\": \"password123456\"\n}", "type": "json" } ] }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

empty

" } ] }, "examples": [ { "title": "Success-Response:", "content": "{\"message\": \"Successfully reset password\", \"data\": {}}", "type": "json" } ] }, "permission": [ { "name": ": Must be logged in" } ], "filename": "routes/api/auth.js", "groupTitle": "Authentication", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/auth/password/change" } ] }, { "type": "post", "url": "/auth/confirm/:token", "title": "confirm account using the JWT in :token", "name": "confirmAccount", "group": "Authentication", "version": "0.0.8", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "JWT", "description": "

for confirming the account

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

empty

" } ] }, "examples": [ { "title": "Success-Response:", "content": "{\"message\": \"Successfully confirmed account\", \"data\": {}}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "string", "optional": false, "field": "message", "description": "

Error message

" }, { "group": "Error 4xx", "type": "object", "optional": false, "field": "data", "description": "

empty

" } ] }, "examples": [ { "title": "Error-Response:", "content": "{\"message\": \"Invalid token for confirming account, \"data\": {}}", "type": "object" } ] }, "filename": "routes/api/auth.js", "groupTitle": "Authentication", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/auth/confirm/:token" } ] }, { "type": "post", "url": "/auth/password/forgot", "title": "forgot password route", "name": "forgotPassword", "group": "Authentication", "version": "0.0.8", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "email", "description": "

the email address of the account

" } ] }, "examples": [ { "title": "Request-Example:", "content": "{ \"email\": \"myemail@mchacks.ca\" }", "type": "json" } ] }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

empty

" } ] }, "examples": [ { "title": "Success-Response:", "content": "{\"message\": \"Sent reset email\", \"data\": {}}", "type": "json" } ] }, "permission": [ { "name": ": public" } ], "filename": "routes/api/auth.js", "groupTitle": "Authentication", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/auth/password/forgot" } ] }, { "type": "get", "url": "/auth/rolebindings/:id", "title": "retrieve rolebindings for a user given by their user id :id", "name": "getRoleBindings", "group": "Authentication", "version": "0.0.8", "parameter": { "fields": { "param": [ { "group": "param", "type": "ObjectId", "optional": false, "field": "id", "description": "

MongoId of an account

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

Rolebindings object

" } ] }, "examples": [ { "title": "Success-Response: ", "content": "{\n \"message\": \"Successfully retrieved role bindings\",\n \"data\": {\n accountId:\"5beca4ab2e069a34f91697b2\"\n id:\"5beca4ae2e069a34f91698b1\"\n roles: [\n {\n _id:\"5beca4ab2e069a34f91697d9\",\n name:\"hacker\",\n routes: [\n {_id: \"5beca4ae2e069a34f9169852\", requestType: \"POST\", uri: \"/api/auth/login\"},\n {_id: \"5beca4ae2e069a34f9169851\", requestType: \"POST\", uri: \"/api/auth/logout\"},\n {_id: \"5beca4ae2e069a34f9169850\", requestType: \"GET\", uri: \"/api/auth/rolebindings/:self\"},\n {_id: \"5beca4ae2e069a34f916984f\", requestType: \"GET\", uri: \"/api/account/self\"},\n {_id: \"5beca4ae2e069a34f916984e\", requestType: \"GET\", uri: \"/api/account/:self\"},\n {_id: \"5beca4ae2e069a34f916984d\", requestType: \"PATCH\", uri: \"/api/account/:self\"},\n {_id: \"5beca4ae2e069a34f916984c\", requestType: \"POST\", uri: \"/api/hacker/\"},\n {_id: \"5beca4ae2e069a34f916984b\", requestType: \"GET\", uri: \"/api/hacker/:self\"},\n {_id: \"5beca4ae2e069a34f916984a\", requestType: \"GET\", uri: \"/api/hacker/:self/resume\"},\n {_id: \"5beca4ae2e069a34f9169849\", requestType: \"PATCH\", uri: \"/api/hacker/:self\"}\n ]\n }\n ]\n }\n }", "type": "object" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "string", "optional": false, "field": "message", "description": "

Error message

" }, { "group": "Error 4xx", "type": "object", "optional": false, "field": "data", "description": "

empty

" } ] }, "examples": [ { "title": "Error-Response: ", "content": "{\"message\": \"Role Bindings not found\", \"data\": {}}", "type": "object" } ] }, "filename": "routes/api/auth.js", "groupTitle": "Authentication", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/auth/rolebindings/:id" } ] }, { "type": "get", "url": "/auth/roles", "title": "get roles", "name": "getRoles", "description": "

get all roles that exist in the database

", "group": "Authentication", "version": "0.0.8", "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

empty

" } ] }, "examples": [ { "title": "Success-Response:", "content": "{\"message\": \"Sucessfully retrieved all roles\", \"data\":\n[{name: \"GodStaff\", routes: Array(27), id: \"5bee20ef3ca9dd4754382880\"},\n {name: \"Hacker\", routes: Array(10), id: \"5bee20ef3ca9dd4754382881\"},\n {name: \"Volunteer\", routes: Array(4), id: \"5bee20ef3ca9dd4754382882\"}]", "type": "json" } ] }, "filename": "routes/api/auth.js", "groupTitle": "Authentication", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/auth/roles" } ] }, { "type": "post", "url": "/auth/login", "title": "login to the service", "name": "login", "group": "Authentication", "version": "0.0.8", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "string", "optional": false, "field": "email", "description": "

Account email

" }, { "group": "Parameter", "type": "string", "optional": false, "field": "password", "description": "

Account password

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

empty

" } ] }, "examples": [ { "title": "Success-Response: ", "content": "{\"message\": \"Successfully logged in\", \"data\": {}}", "type": "object" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "string", "optional": false, "field": "message", "description": "

Error message

" }, { "group": "Error 4xx", "type": "object", "optional": false, "field": "data", "description": "

empty

" } ] }, "examples": [ { "title": "Error-Response: ", "content": "{\"message\": \"Invalid Authentication\", \"data\": {}}", "type": "object" } ] }, "permission": [ { "name": ": public" } ], "filename": "routes/api/auth.js", "groupTitle": "Authentication", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/auth/login" } ] }, { "type": "get", "url": "/auth/logout", "title": "logout of service", "name": "logout", "group": "Authentication", "version": "0.0.8", "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

empty

" } ] }, "examples": [ { "title": "Success-Response:", "content": "{\"message\": \"Successfully logged out\", \"data\": {}}", "type": "object" } ] }, "permission": [ { "name": ": public" } ], "filename": "routes/api/auth.js", "groupTitle": "Authentication", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/auth/logout" } ] }, { "type": "get", "url": "/auth/confirm/resend", "title": "resend confirmation token", "name": "resendConfirmAccount", "group": "Authentication", "version": "0.0.8", "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

empty

" } ] }, "examples": [ { "title": "Success-Response:", "content": "{\"message\": \"Successfully resent confirmation email\", \"data\": {}}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "string", "optional": false, "field": "message", "description": "

Error message

" }, { "group": "Error 4xx", "type": "object", "optional": false, "field": "data", "description": "

empty

" } ] }, "examples": [ { "title": "Error-Response:", "content": " HTTP/1.1 422\n{\"message\": \"Account already confirmed\", \"data\": {}}", "type": "json" }, { "title": "Error-Response:", "content": " HTTP/1.1 428\n{\"message\": \"Account confirmation token does not exist\", \"data\": {}}", "type": "json" } ] }, "filename": "routes/api/auth.js", "groupTitle": "Authentication", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/auth/confirm/resend" } ] }, { "type": "post", "url": "/auth/password/reset", "title": "reset password", "name": "resetPassword", "group": "Authentication", "version": "0.0.8", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "password", "description": "

the password of the account

" } ] }, "examples": [ { "title": "Request-Example:", "content": "{ \"password\": \"hunter2\" }", "type": "json" } ] }, "header": { "fields": { "Header": [ { "group": "Header", "type": "String", "optional": false, "field": "Authentication", "description": "

the token that was provided in the reset password email

" } ] }, "examples": [ { "title": "Header-Example:", "content": "{\n \"X-Reset-Token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c\"\n}", "type": "json" } ] }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

empty

" } ] }, "examples": [ { "title": "Success-Response:", "content": "{\"message\": \"Successfully reset password\", \"data\": {}}", "type": "json" } ] }, "permission": [ { "name": ": must have authentication token" } ], "filename": "routes/api/auth.js", "groupTitle": "Authentication", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/auth/password/reset" } ] }, { "type": "patch", "url": "/hacker/batchAccept/", "title": "accept array of Hackers", "name": "acceptHacker", "group": "Hacker", "version": "3.0.0", "parameter": { "fields": { "body) {{ids: ObjectId[]}} Array of id(s": [ { "group": "body) {{ids: ObjectId[]}} Array of id(s", "optional": false, "field": "that", "description": "

needed to be accepted

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

success_ids array and errors array. Errors array will contain a detailed error for why the batch update for a given ID did not work

" } ] }, "examples": [ { "title": "Success-Response:", "content": "{\n \"message\": \"Hacker batch update successful.\",\n \"data\": {\n \"success_ids\": [\"id1\", \"id2\"]\n \"errors\": [{status: 404, message: \"ACCOUNT_NOT_FOUND\", account: null, hacker_id: \"id3\"}]\n }\n}", "type": "object" } ] }, "permission": [ { "name": "Administrator" } ], "filename": "routes/api/hacker.js", "groupTitle": "Hacker", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/hacker/batchAccept/" } ] }, { "type": "patch", "url": "/hacker/acceptEmail/:email", "title": "accept a Hacker by email", "name": "acceptHacker", "group": "Hacker", "version": "2.0.0", "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

Hacker object

" } ] }, "examples": [ { "title": "Success-Response:", "content": "{\n \"message\": \"Changed hacker information\",\n \"data\": {\n \"status\": \"Accepted\"\n }\n}", "type": "object" } ] }, "permission": [ { "name": "Administrator" } ], "filename": "routes/api/hacker.js", "groupTitle": "Hacker", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/hacker/acceptEmail/:email" } ] }, { "type": "patch", "url": "/hacker/accept/:id", "title": "accept a Hacker", "name": "acceptHacker", "group": "Hacker", "version": "2.0.0", "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

Hacker object

" } ] }, "examples": [ { "title": "Success-Response:", "content": "{\n \"message\": \"Changed hacker information\",\n \"data\": {\n \"status\": \"Accepted\"\n }\n}", "type": "object" } ] }, "permission": [ { "name": "Administrator" } ], "filename": "routes/api/hacker.js", "groupTitle": "Hacker", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/hacker/accept/:id" } ] }, { "type": "patch", "url": "/hacker/checkin/:id", "title": "update a hacker's status to be 'Checked-in'. Note that the Hacker must eitehr be Accepted or Confirmed.", "name": "checkinHacker", "group": "Hacker", "version": "0.0.9", "parameter": { "fields": { "body": [ { "group": "body", "type": "string", "optional": true, "field": "status", "description": "

Check-in status. "Checked-in"

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

Hacker object

" } ] }, "examples": [ { "title": "Success-Response:", "content": "{\n \"message\": \"Changed hacker information\",\n \"data\": {\n \"status\": \"Checked-in\"\n }\n}", "type": "object" } ] }, "permission": [ { "name": "Administrator" }, { "name": "Volunteer" } ], "filename": "routes/api/hacker.js", "groupTitle": "Hacker", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/hacker/checkin/:id" } ] }, { "type": "post", "url": "/hacker/", "title": "create a new hacker", "name": "createHacker", "group": "Hacker", "version": "0.0.8", "parameter": { "fields": { "body": [ { "group": "body", "type": "MongoID", "optional": false, "field": "accountId", "description": "

ObjectID of the respective account

" }, { "group": "body", "type": "String", "optional": false, "field": "school", "description": "

Name of the school the hacker goes to

" }, { "group": "body", "type": "String", "optional": false, "field": "gender", "description": "

Gender of the hacker

" }, { "group": "body", "type": "Number", "optional": false, "field": "travel", "description": "

Whether the hacker requires a bus for transportation

" }, { "group": "body", "type": "String[]", "optional": false, "field": "ethnicity", "description": "

the ethnicities of the hacker

" }, { "group": "body", "type": "String[]", "optional": false, "field": "major", "description": "

the major of the hacker

" }, { "group": "body", "type": "Number", "optional": false, "field": "graduationYear", "description": "

the graduation year of the hacker

" }, { "group": "body", "type": "Boolean", "optional": false, "field": "codeOfConduct", "description": "

acceptance of the code of conduct

" }, { "group": "body", "type": "Json", "optional": false, "field": "application", "description": "

The hacker's application. Resume and jobInterest fields are required.

" } ] }, "examples": [ { "title": "application: ", "content": "{\n \"application\":{\n \"general\":{\n \"school\": \"McGill University\",\n \"degree\": \"Undergraduate\",\n \"fieldOfStudy\": \"Computer Science\",\n \"graduationYear\": \"2021\",\n \"jobInterest\":\"Internship\",\n \"URL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n },\n \"shortAnswer\": {\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"question1\": \"I love McHacks\",\n \"question2\":\"Pls accept me\",\n \"previousHackathons\": \"5\",\n \"comments\":\"hi!\",\n },\n \"other:\" {\n \"gender\": \"male\",\n \"ethnicity\": \"Asian or Pacific Islander\",\n \"privacyPolicy\": true,\n \"codeOfConduct\": true,\n }\n \"accomodation\": {\n \"travel\": 0\n },\n }\n}", "type": "Json" } ] }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

Hacker object

" } ] }, "examples": [ { "title": "Success-Response: ", "content": "{\n \"message\": \"Hacker creation successful\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"application\":{\n \"general\":{\n \"school\": \"McGill University\",\n \"degree\": \"Undergraduate\",\n \"fieldOfStudy\": \"Computer Science\",\n \"graduationYear\": \"2021\",\n \"jobInterest\":\"Internship\",\n \"URL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n },\n \"shortAnswer\": {\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"question1\": \"I love McHacks\",\n \"question2\":\"Pls accept me\",\n \"previousHackathons\": \"5\",\n \"comments\":\"hi!\",\n },\n \"other:\" {\n \"gender\": \"male\",\n \"ethnicity\": \"Asian or Pacific Islander\",\n \"privacyPolicy\": true,\n \"codeOfConduct\": true,\n }\n \"accomodation\": {\n \"travel\": 0\n },\n }\n}", "type": "object" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "string", "optional": false, "field": "message", "description": "

Error message

" }, { "group": "Error 4xx", "type": "object", "optional": false, "field": "data", "description": "

empty

" } ] }, "examples": [ { "title": "Error-Response: ", "content": "{\"message\": \"Error while creating hacker\", \"data\": {}}", "type": "object" } ] }, "filename": "routes/api/hacker.js", "groupTitle": "Hacker", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/hacker/" } ] }, { "type": "get", "url": "/hacker/:id", "title": "get a hacker's information", "name": "getHacker", "group": "Hacker", "version": "0.0.8", "parameter": { "fields": { "param": [ { "group": "param", "type": "String", "optional": false, "field": "id", "description": "

a hacker's unique mongoID

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "String", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "data", "description": "

Hacker object

" } ] }, "examples": [ { "title": "Success-Response: ", "content": "{\n \"message\": \"Successfully retrieved hacker information\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"status\": \"Applied\",\n \"application\":{\n \"general\":{\n \"school\": \"McGill University\",\n \"degree\": \"Undergraduate\",\n \"fieldOfStudy\": \"Computer Science\",\n \"graduationYear\": \"2021\",\n \"jobInterest\":\"Internship\",\n \"URL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n },\n \"shortAnswer\": {\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"question1\": \"I love McHacks\",\n \"question2\":\"Pls accept me\",\n \"previousHackathons\": \"5\",\n \"comments\":\"hi!\",\n },\n \"other:\" {\n \"gender\": \"male\",\n \"ethnicity\": \"Asian or Pacific Islander\",\n \"privacyPolicy\": true,\n \"codeOfConduct\": true,\n }\n \"accomodation\": {\n \"travel\": 0\n },\n }\n }\n }", "type": "object" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "String", "optional": false, "field": "message", "description": "

Error message

" }, { "group": "Error 4xx", "type": "Object", "optional": false, "field": "data", "description": "

empty

" } ] }, "examples": [ { "title": "Error-Response: ", "content": "{\"message\": \"Hacker not found\", \"data\": {}}", "type": "object" } ] }, "filename": "routes/api/hacker.js", "groupTitle": "Hacker", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/hacker/:id" } ] }, { "type": "get", "url": "/hacker/email/:email", "title": "get a hacker's information", "name": "getHacker", "group": "Hacker", "version": "0.0.8", "parameter": { "fields": { "param": [ { "group": "param", "type": "String", "optional": false, "field": "email", "description": "

a hacker's unique email

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "String", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "data", "description": "

Hacker object

" } ] }, "examples": [ { "title": "Success-Response: ", "content": "{\n \"message\": \"Successfully retrieved hacker information\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"status\": \"Applied\",\n \"application\":{\n \"general\":{\n \"school\": \"McGill University\",\n \"degree\": \"Undergraduate\",\n \"fieldOfStudy\": \"Computer Science\",\n \"graduationYear\": \"2021\",\n \"jobInterest\":\"Internship\",\n \"URL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n },\n \"shortAnswer\": {\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"question1\": \"I love McHacks\",\n \"question2\":\"Pls accept me\",\n \"previousHackathons\": \"5\",\n \"comments\":\"hi!\",\n },\n \"other:\" {\n \"gender\": \"male\",\n \"ethnicity\": \"Asian or Pacific Islander\",\n \"privacyPolicy\": true,\n \"codeOfConduct\": true,\n }\n \"accomodation\": {\n \"travel\": 0\n },\n }\n }\n }", "type": "object" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "String", "optional": false, "field": "message", "description": "

Error message

" }, { "group": "Error 4xx", "type": "Object", "optional": false, "field": "data", "description": "

empty

" } ] }, "examples": [ { "title": "Error-Response: ", "content": "{\"message\": \"Hacker not found\", \"data\": {}}", "type": "object" } ] }, "filename": "routes/api/hacker.js", "groupTitle": "Hacker", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/hacker/email/:email" } ] }, { "type": "get", "url": "/hacker/resume:id", "title": "get the resume for a hacker.", "name": "getHackerResume", "group": "Hacker", "version": "0.0.8", "parameter": { "fields": { "param": [ { "group": "param", "type": "ObjectId", "optional": false, "field": "id", "description": "

Hacker id

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "String", "optional": false, "field": "message", "description": "

Success message

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n message: \"Downloaded resume\",\n data: {\n id: \"507f191e810c19729de860ea\",\n resume: [Buffer]\n }\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "String", "optional": false, "field": "message", "description": "

"Resume does not exist"

" } ] }, "examples": [ { "title": "Error-Response:", "content": "HTTP/1.1 404\n{\n message: \"Resume not found\",\n data: {}\n}", "type": "json" } ] }, "permission": [ { "name": "Must be logged in, and the account id must be linked to the hacker." } ], "filename": "routes/api/hacker.js", "groupTitle": "Hacker" }, { "type": "get", "url": "/hacker/stats", "title": "Gets the stats of all of the hackers who have applied.", "name": "getHackerStats", "group": "Hacker", "version": "0.0.9", "parameter": { "fields": { "query": [ { "group": "query", "type": "String", "optional": false, "field": "model", "description": "

the model to be searched (Only hacker supported)

" }, { "group": "query", "type": "Array", "optional": false, "field": "q", "description": "

the query to be executed. For more information on how to format this, please see https://docs.mchacks.ca/architecture/

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

Hacker object

" } ] }, "examples": [ { "title": "Success-Response: ", "content": "{\n \"message\": \"Retrieved stats\",\n \"data\": {\n \"stats\" : {\n \"total\": 10,\n \"status\": { \"Applied\": 10 },\n \"school\": { \"McGill University\": 3, \"Harvard University\": 7 },\n degree: { \"Undergraduate\": 10 },\n gender: { \"Male\": 1, \"Female\": 9 },\n travel: { \"true\": 7, \"false\": 3 },\n ethnicity: { \"White\": 10, },\n jobInterest: { \"Internship\": 10 },\n major: { \"Computer Science\": 10 },\n graduationYear: { \"2019\": 10 },\n dietaryRestrictions: { \"None\": 10 },\n shirtSize: { \"M\": 3, \"XL\": 7 },\n age: { \"22\": 10 }\n }\n }\n}", "type": "object" } ] }, "filename": "routes/api/hacker.js", "groupTitle": "Hacker", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/hacker/stats" } ] }, { "type": "patch", "url": "/hacker/:id", "title": "update a hacker's information.", "description": "

This route only contains the ability to update a subset of a hacker's information. If you want to update a status, you must have Admin priviledges and use PATCH /hacker/status/:id.

", "name": "patchHacker", "group": "Hacker", "version": "0.0.8", "parameter": { "fields": { "body": [ { "group": "body", "type": "String", "optional": true, "field": "school", "description": "

Name of the school the hacker goes to

" }, { "group": "body", "type": "String", "optional": true, "field": "gender", "description": "

Gender of the hacker

" }, { "group": "body", "type": "Number", "optional": true, "field": "travel", "description": "

How much the hacker requires a bus for transportation

" }, { "group": "body", "type": "String[]", "optional": true, "field": "ethnicity", "description": "

the ethnicities of the hacker

" }, { "group": "body", "type": "String[]", "optional": true, "field": "major", "description": "

the major of the hacker

" }, { "group": "body", "type": "Number", "optional": true, "field": "graduationYear", "description": "

the graduation year of the hacker

" }, { "group": "body", "type": "Json", "optional": true, "field": "application", "description": "

The hacker's application

" } ] }, "examples": [ { "title": "application: ", "content": "{\n \"application\":{\n \"general\":{\n \"school\": \"McGill University\",\n \"degree\": \"Undergraduate\",\n \"fieldOfStudy\": \"Computer Science\",\n \"graduationYear\": \"2021\",\n \"jobInterest\":\"Internship\",\n \"URL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n },\n \"shortAnswer\": {\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"question1\": \"I love McHacks\",\n \"question2\":\"Pls accept me\",\n \"previousHackathons\": \"5\",\n \"comments\":\"hi!\",\n },\n \"other:\" {\n \"gender\": \"male\",\n \"ethnicity\": \"Asian or Pacific Islander\",\n \"privacyPolicy\": true,\n \"codeOfConduct\": true,\n }\n \"accomodation\": {\n \"travel\": 0\n },\n }\n }", "type": "Json" } ] }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

Hacker object

" } ] }, "examples": [ { "title": "Success-Response: ", "content": "{\n \"message\": \"Changed hacker information\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"status\": \"Applied\",\n \"application\":{\n \"general\":{\n \"school\": \"McGill University\",\n \"degree\": \"Undergraduate\",\n \"fieldOfStudy\": \"Computer Science\",\n \"graduationYear\": \"2021\",\n \"jobInterest\":\"Internship\",\n \"URL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n },\n \"shortAnswer\": {\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"question1\": \"I love McHacks\",\n \"question2\":\"Pls accept me\",\n \"previousHackathons\": \"5\",\n \"comments\":\"hi!\",\n },\n \"other:\" {\n \"gender\": \"male\",\n \"ethnicity\": \"Asian or Pacific Islander\",\n \"privacyPolicy\": true,\n \"codeOfConduct\": true,\n }\n \"accomodation\": {\n \"travel\": 0\n },\n }\n }\n}", "type": "object" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "string", "optional": false, "field": "message", "description": "

Error message

" }, { "group": "Error 4xx", "type": "object", "optional": false, "field": "data", "description": "

empty

" } ] }, "examples": [ { "title": "Error-Response: ", "content": "{\"message\": \"Error while updating hacker\", \"data\": {}}", "type": "object" } ] }, "filename": "routes/api/hacker.js", "groupTitle": "Hacker", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/hacker/:id" } ] }, { "type": "patch", "url": "/hacker/confirmation/:id", "title": "Allows confirmation of hacker attendence if they are accepted. Also allows change from 'confirmed' to 'withdrawn'.", "name": "patchHackerConfirmed", "group": "Hacker", "version": "0.0.9", "parameter": { "fields": { "body": [ { "group": "body", "type": "string", "optional": true, "field": "status", "description": "

The new status of the hacker. "Accepted", "Confirmed", or "Withdrawn"

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

Hacker object

" } ] }, "examples": [ { "title": "Success-Response:", "content": "{\n \"message\": \"Changed hacker information\",\n \"data\": {\n \"status\": \"Confirmed\"\n }\n}", "type": "object" } ] }, "permission": [ { "name": "Administrator" }, { "name": "Hacker" } ], "filename": "routes/api/hacker.js", "groupTitle": "Hacker", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/hacker/confirmation/:id" } ] }, { "type": "patch", "url": "/hacker/status/:id", "title": "update a hacker's status", "name": "patchHackerStatus", "group": "Hacker", "version": "0.0.9", "parameter": { "fields": { "body": [ { "group": "body", "type": "string", "optional": true, "field": "status", "description": "

Status of the hacker's application ("None"|"Applied"|"Accepted"|"Declined"|"Waitlisted"|"Confirmed"|"Withdrawn"|"Checked-in")

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

Hacker object

" } ] }, "examples": [ { "title": "Success-Response:", "content": "{\n \"message\": \"Changed hacker information\",\n \"data\": {\n \"status\": \"Accepted\"\n }\n}", "type": "object" } ] }, "permission": [ { "name": "Administrator" } ], "filename": "routes/api/hacker.js", "groupTitle": "Hacker", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/hacker/status/:id" } ] }, { "type": "post", "url": "/hacker/resume/:id", "title": "upload or update resume for a hacker.", "name": "postHackerResume", "group": "Hacker", "version": "0.0.8", "description": "

NOTE: This must be sent via multipart/form-data POST request

", "parameter": { "fields": { "param": [ { "group": "param", "type": "ObjectId", "optional": false, "field": "id", "description": "

Hacker id

" } ], "body": [ { "group": "body", "type": "File", "optional": false, "field": "resume", "description": "

The uploaded file.

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "String", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "data", "description": "

Location in the bucket that the file was stored.

" } ] }, "examples": [ { "title": "Success-Response:", "content": "HTTP/1.1 200 OK\n{\n message: \"Uploaded resume\",\n data: {\n filename: \"resumes/1535032624768-507f191e810c19729de860ea\"\n }\n}", "type": "json" } ] }, "permission": [ { "name": "Must be logged in, and the account id must be linked to the hacker." } ], "filename": "routes/api/hacker.js", "groupTitle": "Hacker", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/hacker/resume/:id" } ] }, { "type": "post", "url": "/hacker/email/dayOf/:id", "title": "", "description": "

Sends a hacker the day-of email, along with the HackPass QR code to view their hacker profile (for checkin purposes). Hackers must be either confirmed, or checked in.

", "name": "postHackerSendDayOfEmail", "group": "Hacker", "version": "0.0.9", "parameter": { "fields": { "param": [ { "group": "param", "type": "string", "optional": true, "field": "status", "description": "

The hacker ID

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

empty

" } ] }, "examples": [ { "title": "Success-Response:", "content": "{\n \"message\": \"Hacker day-of email sent.\",\n \"data\": {}\n}", "type": "object" } ] }, "permission": [ { "name": "Administrator" } ], "filename": "routes/api/hacker.js", "groupTitle": "Hacker", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/hacker/email/dayOf/:id" } ] }, { "type": "post", "url": "/hacker/email/weekOf/:id", "title": "", "description": "

Sends a hacker the week-of email, along with the HackPass QR code to view their hacker profile (for checkin purposes). Hackers must be either confirmed, or checked in.

", "name": "postHackerSendWeekOfEmail", "group": "Hacker", "version": "0.0.9", "parameter": { "fields": { "param": [ { "group": "param", "type": "string", "optional": true, "field": "status", "description": "

The hacker ID

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

empty

" } ] }, "examples": [ { "title": "Success-Response:", "content": "{\n \"message\": \"Hacker week-of email sent.\",\n \"data\": {}\n}", "type": "object" } ] }, "permission": [ { "name": "Administrator" } ], "filename": "routes/api/hacker.js", "groupTitle": "Hacker", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/hacker/email/weekOf/:id" } ] }, { "type": "post", "url": "/hacker/email/weekOf/:id", "title": "", "description": "

Sends a hacker the week-of email, along with the HackPass QR code to view their hacker profile (for checkin purposes). Hackers must be eitherconfirmed, or checked in.

", "name": "postHackerSendWeekOfEmail", "group": "Hacker", "version": "0.0.9", "parameter": { "fields": { "param": [ { "group": "param", "type": "string", "optional": true, "field": "status", "description": "

The hacker ID

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

empty

" } ] }, "examples": [ { "title": "Success-Response:", "content": "{\n \"message\": \"Hacker week-of email sent.\",\n \"data\": {}\n}", "type": "object" } ] }, "permission": [ { "name": "Administrator" } ], "filename": "routes/api/hacker.js", "groupTitle": "Hacker", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/hacker/email/weekOf/:id" } ] }, { "type": "get", "url": "/sponsor/self", "title": "get information about logged in sponsor", "name": "self", "group": "Hacker", "version": "1.4.1", "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "String", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "data", "description": "

Sponsor object

" } ] }, "examples": [ { "title": "Success-Response: ", "content": "{\n \"message\": \"Successfully retrieved sponsor information\", \n \"data\": {\n \"id\": \"5bff4d736f86be0a41badb91\",\n \"accountId\": \"5bff4d736f86be0a41badb99\",\n \"tier\": 3,\n \"company\": \"companyName\",\n \"contractURL\": \"https://www.contractHere.com\",\n \"nominees\": [\"5bff4d736f86be0a41badb93\",\"5bff4d736f86be0a41badb94\"]\n }\n }", "type": "object" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "String", "optional": false, "field": "message", "description": "

Error message

" }, { "group": "Error 4xx", "type": "Object", "optional": false, "field": "data", "description": "

empty

" } ] }, "examples": [ { "title": "Error-Response: ", "content": "{\"message\": \"Sponsor not found\", \"data\": {}}", "type": "object" } ] }, "permission": [ { "name": ": Sponsor" } ], "filename": "routes/api/sponsor.js", "groupTitle": "Hacker", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/sponsor/self" } ] }, { "type": "get", "url": "/hacker/self", "title": "get information about own hacker", "name": "self", "group": "Hacker", "version": "0.0.8", "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

Hacker object

" } ] }, "examples": [ { "title": "Success-Response: ", "content": "{\n \"message\": \"Hacker found by logged in account id\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"application\":{\n \"URL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n },\n \"status\":\"Applied\",\n \"ethnicity\":[\"White or Caucasian\",\" Asian or Pacific Islander\"],\n \"accountId\":\"5bff2a35e533b0f6562b4998\",\n \"school\":\"McPherson College\",\n \"gender\":\"Female\",\n \"travel\":0,\n \"major\":[\"Accounting\"],\n \"graduationYear\":2019,\n \"codeOfConduct\":true,\n } \n }", "type": "object" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "string", "optional": false, "field": "message", "description": "

Error message

" }, { "group": "Error 4xx", "type": "object", "optional": false, "field": "data", "description": "

empty

" } ] }, "examples": [ { "title": "Error-Response: ", "content": "{\"message\": \"Hacker not found\", \"data\": {}}", "type": "object" } ] }, "filename": "routes/api/hacker.js", "groupTitle": "Hacker", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/hacker/self" } ] }, { "type": "get", "url": "/", "title": "version", "version": "0.0.8", "name": "index", "group": "Index", "permission": [ { "name": "public" } ], "filename": "routes/index.js", "groupTitle": "Index", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/" } ] }, { "type": "post", "url": "/api/role/", "title": "create a new role", "name": "createRole", "group": "Role", "version": "1.1.1", "parameter": { "fields": { "body": [ { "group": "body", "type": "String", "optional": false, "field": "name", "description": "

Name of the route

" }, { "group": "body", "type": "Route[]", "optional": false, "field": "routes", "description": "

The routes that this role gives access to

" } ] }, "examples": [ { "title": "application: ", "content": "{\n \"name\": \"routename\",\n \"routes\": [\n {\n uri: \"/api/hacker/\"\n requestType: \"POST\"\n }\n ]\n}", "type": "Json" } ] }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

Role object

" } ] }, "examples": [ { "title": "Success-Response: ", "content": "{\n \"message\": \"Role creation successful\", \n \"data\": {\n \"name\": \"routename\",\n \"routes\": [\n {\n uri: \"/api/hacker/\"\n requestType: \"POST\"\n }\n ]\n }\n}", "type": "object" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "string", "optional": false, "field": "message", "description": "

Error message

" }, { "group": "Error 4xx", "type": "object", "optional": false, "field": "data", "description": "

empty

" } ] }, "examples": [ { "title": "Error-Response: ", "content": "{\"message\": \"Error while creating role\", \"data\": {}}", "type": "object" } ] }, "filename": "routes/api/role.js", "groupTitle": "Role", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/api/role/" } ] }, { "type": "get", "url": "/search/", "title": "provide a specific query for any defined model", "name": "search", "group": "Search", "version": "0.0.8", "parameter": { "fields": { "query": [ { "group": "query", "type": "String", "optional": false, "field": "model", "description": "

the model to be searched

" }, { "group": "query", "type": "Array", "optional": false, "field": "q", "description": "

the query to be executed. For more information on how to format this, please see https://docs.mchacks.ca/architecture/

" }, { "group": "query", "type": "String", "optional": false, "field": "sort", "description": "

either "asc" or "desc"

" }, { "group": "query", "type": "number", "optional": false, "field": "page", "description": "

the page number that you would like

" }, { "group": "query", "type": "number", "optional": false, "field": "limit", "description": "

the maximum number of results that you would like returned

" }, { "group": "query", "type": "any", "optional": false, "field": "sort_by", "description": "

any parameter you want to sort the results by

" }, { "group": "query", "type": "boolean", "optional": false, "field": "expand", "description": "

whether you want to expand sub documents within the results

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "String", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "data", "description": "

Results

" } ] }, "examples": [ { "title": "Success-Response:", "content": "{\n \"message\": \"Successfully executed query, returning all results\",\n \"data\": [\n {...}\n ]\n }", "type": "object" }, { "title": "Success-Response:", "content": "{\n \"message\": \"No results found.\",\n \"data\": {}\n }", "type": "object" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "String", "optional": false, "field": "message", "description": "

Error message

" }, { "group": "Error 4xx", "type": "Object", "optional": false, "field": "data", "description": "

empty

" } ] }, "examples": [ { "title": "Error-Response:", "content": "{\"message\": \"Validation failed\", \"data\": {}}", "type": "object" } ] }, "filename": "routes/api/search.js", "groupTitle": "Search", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/search/" } ] }, { "type": "get", "url": "/settings/", "title": "Get the settings for the current hackathon", "name": "getSettings", "group": "Settings", "version": "1.1.1", "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

Settings Object

" } ] }, "examples": [ { "title": "Success-Response:", "content": "{\n \"message\": \"Settings creation successful.\",\n \"data\": {\n \"settings\": {\n openTime: \"Wed Feb 06 2019 00:00:00 GMT-0500 (GMT-05:00)\",\n closeTime: \"Sat Feb 01 2020 00:00:00 GMT-0500 (GMT-05:00)\",\n confirmTime: \"Sat Feb 20 2020 00:00:00 GMT-0500 (GMT-05:00)\",\n isRemote: false\n }\n }\n}", "type": "object" } ] }, "permission": [ { "name": "public" } ], "filename": "routes/api/settings.js", "groupTitle": "Settings", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/settings/" } ] }, { "type": "patch", "url": "/settings/", "title": "Patch the settings for the current hackathon", "name": "patchSettings", "group": "Settings", "version": "1.1.1", "parameter": { "fields": { "body": [ { "group": "body", "type": "Date", "optional": true, "field": "openTime", "description": "

The opening time for the hackathon.

" }, { "group": "body", "type": "Date", "optional": true, "field": "closeTime", "description": "

The closing time for the hackathon.

" }, { "group": "body", "type": "Date", "optional": true, "field": "confirmTime", "description": "

The deadline for confirmation for the hackathon.

" }, { "group": "body", "type": "Boolean", "optional": true, "field": "isRemote", "description": "

Whether this hackathon is remote or not.

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

Settings Object

" } ] }, "examples": [ { "title": "Success-Response:", "content": "{\n \"message\": \"Settings patch successful.\",\n \"data\": {\n \"settings\": {\n openTime: \"Wed Feb 06 2019 00:00:00 GMT-0500 (GMT-05:00)\",\n closeTime: \"Sat Feb 01 2020 00:00:00 GMT-0500 (GMT-05:00)\",\n confirmTime: \"Sat Feb 20 2020 00:00:00 GMT-0500 (GMT-05:00)\",\n isRemote: true\n }\n }\n}", "type": "object" } ] }, "permission": [ { "name": "Administrators" } ], "filename": "routes/api/settings.js", "groupTitle": "Settings", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/settings/" } ] }, { "type": "post", "url": "/sponsor/", "title": "create a new sponsor", "name": "createSponsor", "group": "Sponsor", "version": "0.0.8", "parameter": { "fields": { "body": [ { "group": "body", "type": "MongoID", "optional": false, "field": "accountId", "description": "

ObjectID of the respective account.

" }, { "group": "body", "type": "Number", "optional": false, "field": "tier", "description": "

Tier of the sponsor, from 0 to 5. 0 is lowest tier, and 5 is the custom tier.

" }, { "group": "body", "type": "String", "optional": false, "field": "company", "description": "

Name of the company.

" }, { "group": "body", "type": "String", "optional": false, "field": "contractURL", "description": "

URL link to the contract with the company.

" }, { "group": "body", "type": "MongoID[]", "optional": false, "field": "nominees", "description": "

Array of accounts that the company wish to nominate as hackers.

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "String", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "data", "description": "

Sponsor object

" } ] }, "examples": [ { "title": "Success-Response: ", "content": "{\n \"message\": \"Sponsor creation successful\", \n \"data\": {...}\n }", "type": "object" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "String", "optional": false, "field": "message", "description": "

Error message

" }, { "group": "Error 4xx", "type": "Object", "optional": false, "field": "data", "description": "

empty

" } ] }, "examples": [ { "title": "Error-Response: ", "content": "{\"message\": \"Error while creating sponsor\", \"data\": {}}", "type": "object" } ] }, "filename": "routes/api/sponsor.js", "groupTitle": "Sponsor", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/sponsor/" } ] }, { "type": "get", "url": "/sponsor/:id", "title": "get a sponsor's information", "name": "getSponsor", "group": "Sponsor", "version": "0.0.8", "parameter": { "fields": { "param": [ { "group": "param", "type": "string", "optional": false, "field": "id", "description": "

a sponsor's unique mongoID

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "String", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "data", "description": "

Sponsor object

" } ] }, "examples": [ { "title": "Success-Response: ", "content": "{\n \"message\": \"Successfully retrieved sponsor information\", \n \"data\": {\n \"id\": \"5bff4d736f86be0a41badb91\",\n \"accountId\": \"5bff4d736f86be0a41badb99\",\n \"tier\": 3,\n \"company\": \"companyName\",\n \"contractURL\": \"https://www.contractHere.com\",\n \"nominees\": [\"5bff4d736f86be0a41badb93\",\"5bff4d736f86be0a41badb94\"]\n }\n }", "type": "object" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "String", "optional": false, "field": "message", "description": "

Error message

" }, { "group": "Error 4xx", "type": "Object", "optional": false, "field": "data", "description": "

empty

" } ] }, "examples": [ { "title": "Error-Response: ", "content": "{\"message\": \"Sponsor not found\", \"data\": {}}", "type": "object" } ] }, "filename": "routes/api/sponsor.js", "groupTitle": "Sponsor", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/sponsor/:id" } ] }, { "type": "patch", "url": "/sponsor/", "title": "update a sponsor", "name": "patchSponsor", "group": "Sponsor", "version": "1.3.0", "parameter": { "fields": { "param": [ { "group": "param", "type": "ObjectId", "optional": false, "field": "id", "description": "

ObjectID of the sponsor

" } ], "body": [ { "group": "body", "type": "String", "optional": false, "field": "company", "description": "

Name of the company.

" }, { "group": "body", "type": "String", "optional": false, "field": "contractURL", "description": "

URL link to the contract with the company.

" }, { "group": "body", "type": "ObjectId[]", "optional": false, "field": "nominees", "description": "

Array of accounts that the company wish to nominate as hackers.

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "String", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "data", "description": "

Sponsor object

" } ] }, "examples": [ { "title": "Success-Response: ", "content": "{\n \"message\": \"Sponsor update successful\", \n \"data\": {...}\n }", "type": "object" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "String", "optional": false, "field": "message", "description": "

Error message

" }, { "group": "Error 4xx", "type": "Object", "optional": false, "field": "data", "description": "

empty

" } ] }, "examples": [ { "title": "Error-Response: ", "content": "{\"message\": \"Error while updating sponsor\", \"data\": {}}", "type": "object" } ] }, "filename": "routes/api/sponsor.js", "groupTitle": "Sponsor", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/sponsor/" } ] }, { "type": "post", "url": "/team/", "title": "create a new team consisting of only the logged in user", "name": "createTeam", "group": "Team", "version": "0.0.8", "parameter": { "fields": { "body": [ { "group": "body", "type": "String", "optional": false, "field": "name", "description": "

Name of the team.

" }, { "group": "body", "type": "String", "optional": true, "field": "devpostURL", "description": "

Devpost link to hack. Once the link is sent, the hack will be considered to be submitted.

" }, { "group": "body", "type": "String", "optional": true, "field": "projectName", "description": "

Name of the team.

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

Team object

" } ] }, "examples": [ { "title": "Success-Response: ", "content": "{\n \"message\": \"Team creation successful\", \n \"data\": {...}\n }", "type": "object" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "string", "optional": false, "field": "message", "description": "

Error message

" }, { "group": "Error 4xx", "type": "object", "optional": false, "field": "data", "description": "

empty

" } ] }, "examples": [ { "title": "Error-Response: ", "content": "{\"message\": \"Error while creating team\", \"data\": {}}", "type": "object" } ] }, "filename": "routes/api/team.js", "groupTitle": "Team", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/team/" } ] }, { "type": "patch", "url": "/team/leave/", "title": "Allows a logged in hacker to leave current team", "name": "deleteSelfFromTeam", "group": "Team", "version": "1.1.1", "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

{}

" } ] }, "examples": [ { "title": "Success-Response:", "content": "{\n \"message\": \"Removal from team successful.\",\n \"data\": {}\n}", "type": "object" } ] }, "filename": "routes/api/team.js", "groupTitle": "Team", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/team/leave/" } ] }, { "type": "get", "url": "/team/:id", "title": "get a team's information", "name": "getTeam", "group": "Team", "version": "0.0.8", "parameter": { "fields": { "param": [ { "group": "param", "type": "ObjectId", "optional": false, "field": "id", "description": "

MongoId of the team

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "String", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "data", "description": "

Team object

" } ] }, "examples": [ { "title": "Success-Response: ", "content": "{\n \"message\": \"Team retrieval successful\", \n \"data\": { \n \"team\": {\n \"name\":\"foo\",\n \"members\": [\n ObjectId('...')\n ],\n \"devpostURL\": \"www.devpost.com/foo\",\n \"projectName\": \"fooey\"\n },\n \"members\": [\n {\n \"firstName\": \"John\",\n \"lastName\": \"Doe\"\n }\n ],\n }\n }", "type": "object" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "String", "optional": false, "field": "message", "description": "

Error message

" }, { "group": "Error 4xx", "type": "Object", "optional": false, "field": "data", "description": "

empty

" } ] }, "examples": [ { "title": "Error-Response: ", "content": "{\"message\": \"Team not found\", \"data\": {}}", "type": "object" } ] }, "filename": "routes/api/team.js", "groupTitle": "Team", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/team/:id" } ] }, { "type": "patch", "url": "/team/join/", "title": "Allows a logged in hacker to join a team by name", "name": "patchJoinTeam", "group": "Team", "version": "1.1.1", "parameter": { "fields": { "body": [ { "group": "body", "type": "string", "optional": true, "field": "name", "description": "

Name of the team to join

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

{}

" } ] }, "examples": [ { "title": "Success-Response:", "content": "{\n \"message\": \"Team join successful.\",\n \"data\": {}\n}", "type": "object" } ] }, "filename": "routes/api/team.js", "groupTitle": "Team", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/team/join/" } ] }, { "type": "patch", "url": "/team/:hackerId", "title": "Update a team's information. The team is specified by the hacker belonging to it.", "name": "patchTeam", "group": "Team", "version": "0.0.8", "description": "

We use hackerId instead of teamId because authorization requires a one-to-one mapping from param id to accountId, but we are not able to have that from teamId to accountId due to multiple members in a team. Instead, we use hackerId, as there is a 1 to 1 link between hackerId to teamId, and a 1 to 1 link between hackerId and accountId

", "parameter": { "fields": { "param": [ { "group": "param", "type": "ObjectId", "optional": false, "field": "hackerId", "description": "

a hacker's unique Id

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "String", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "data", "description": "

Team object

" } ] }, "examples": [ { "title": "Success-Response: ", "content": "{\n \"message\": \"Team update successful.\", \n \"data\": {...}\n }", "type": "object" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "String", "optional": false, "field": "message", "description": "

Error message

" }, { "group": "Error 4xx", "type": "Object", "optional": false, "field": "data", "description": "

Query input that caused the error.

" } ] }, "examples": [ { "title": "Error-Response: ", "content": "{\"message\": \"Team not found\", \"data\": {teamId}}", "type": "object" } ] }, "filename": "routes/api/team.js", "groupTitle": "Team", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/team/:hackerId" } ] }, { "type": "post", "url": "/travel/", "title": "create a new travel", "name": "createTravel", "group": "Travel", "version": "2.0.1", "parameter": { "fields": { "body": [ { "group": "body", "type": "MongoID", "optional": false, "field": "accountId", "description": "

ObjectID of the respective account

" }, { "group": "body", "type": "MongoID", "optional": false, "field": "hackerId", "description": "

ObjectID of the respective hacker

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

Travel object

" } ] }, "examples": [ { "title": "Success-Response: ", "content": "{\n \"message\": \"Travel creation successful\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"status\": \"None\",\n \"request\": 50,\n \"offer\": 0\n }\n}", "type": "object" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "string", "optional": false, "field": "message", "description": "

Error message

" }, { "group": "Error 4xx", "type": "object", "optional": false, "field": "data", "description": "

empty

" } ] }, "examples": [ { "title": "Error-Response: ", "content": "{\"message\": \"Error while creating travel\", \"data\": {}}", "type": "object" } ] }, "filename": "routes/api/travel.js", "groupTitle": "Travel", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/travel/" } ] }, { "type": "get", "url": "/travel/email/:email", "title": "get a travel's information", "name": "getTravel", "group": "Travel", "version": "2.0.1", "parameter": { "fields": { "param": [ { "group": "param", "type": "String", "optional": false, "field": "email", "description": "

a travel's unique email

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "String", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "data", "description": "

Travel object

" } ] }, "examples": [ { "title": "Success-Response: ", "content": "{\n \"message\": \"Successfully retrieved travel information\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"status\": \"Valid\",\n \"request\": 100,\n \"offer\": 50\n }\n }", "type": "object" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "String", "optional": false, "field": "message", "description": "

Error message

" }, { "group": "Error 4xx", "type": "Object", "optional": false, "field": "data", "description": "

empty

" } ] }, "examples": [ { "title": "Error-Response: ", "content": "{\"message\": \"Travel not found\", \"data\": {}}", "type": "object" } ] }, "filename": "routes/api/travel.js", "groupTitle": "Travel", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/travel/email/:email" } ] }, { "type": "get", "url": "/travel/:id", "title": "get a traveler's information", "name": "getTravel", "group": "Travel", "version": "2.0.1", "parameter": { "fields": { "param": [ { "group": "param", "type": "String", "optional": false, "field": "id", "description": "

a travel's unique mongoID

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "String", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "data", "description": "

Travel object

" } ] }, "examples": [ { "title": "Success-Response: ", "content": "{\n \"message\": \"Successfully retrieved travel information\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"status\": \"Valid\",\n \"request\": 100,\n \"offer\": 50\n }\n }", "type": "object" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "String", "optional": false, "field": "message", "description": "

Error message

" }, { "group": "Error 4xx", "type": "Object", "optional": false, "field": "data", "description": "

empty

" } ] }, "examples": [ { "title": "Error-Response: ", "content": "{\"message\": \"Travel not found\", \"data\": {}}", "type": "object" } ] }, "filename": "routes/api/travel.js", "groupTitle": "Travel", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/travel/:id" } ] }, { "type": "patch", "url": "/travel/offer/:id", "title": "update a traveler's offer", "name": "patchTravelOffer", "group": "Travel", "version": "2.0.1", "parameter": { "fields": { "body": [ { "group": "body", "type": "number", "optional": true, "field": "offer", "description": "

Amount of money offered for travel

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

Travel object

" } ] }, "examples": [ { "title": "Success-Response:", "content": "{\n \"message\": \"Changed travel information\",\n \"data\": {\n \"offer\": 75\n }\n}", "type": "object" } ] }, "permission": [ { "name": "Administrator" } ], "filename": "routes/api/travel.js", "groupTitle": "Travel", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/travel/offer/:id" } ] }, { "type": "patch", "url": "/travel/status/:id", "title": "update a traveler's status", "name": "patchTravelStatus", "group": "Travel", "version": "2.0.1", "parameter": { "fields": { "body": [ { "group": "body", "type": "string", "optional": true, "field": "status", "description": "

Status of the travel's reimbursement ("None"|"Bus"|"Offered"|"Valid"|"Invalid"|"Claimed")

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

Travel object

" } ] }, "examples": [ { "title": "Success-Response:", "content": "{\n \"message\": \"Changed travel information\",\n \"data\": {\n \"status\": \"Accepted\"\n }\n}", "type": "object" } ] }, "permission": [ { "name": "Administrator" } ], "filename": "routes/api/travel.js", "groupTitle": "Travel", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/travel/status/:id" } ] }, { "type": "get", "url": "/travel/self", "title": "get information about own hacker's travel", "name": "self", "group": "Travel", "version": "2.0.1", "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

Travel object

" } ] }, "examples": [ { "title": "Success-Response: ", "content": "{\n \"message\": \"Travel found by logged in account id\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"status\": \"Claimed\"\n \"request\": 90,\n \"offer\": 80\n } \n }", "type": "object" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "string", "optional": false, "field": "message", "description": "

Error message

" }, { "group": "Error 4xx", "type": "object", "optional": false, "field": "data", "description": "

empty

" } ] }, "examples": [ { "title": "Error-Response: ", "content": "{\"message\": \"Travel not found\", \"data\": {}}", "type": "object" } ] }, "filename": "routes/api/travel.js", "groupTitle": "Travel", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/travel/self" } ] }, { "type": "post", "url": "/volunteer/", "title": "create a new volunteer", "name": "createVolunteer", "group": "Volunteer", "version": "0.0.8", "parameter": { "fields": { "body": [ { "group": "body", "type": "MongoID", "optional": false, "field": "accountId", "description": "

MongoID of the account of the volunteer

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "string", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "object", "optional": false, "field": "data", "description": "

Volunteer object

" } ] }, "examples": [ { "title": "Success-Response: ", "content": "{\n \"message\": \"Volunteer creation successful\", \n \"data\": {...}\n }", "type": "object" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "string", "optional": false, "field": "message", "description": "

Error message

" }, { "group": "Error 4xx", "type": "object", "optional": false, "field": "data", "description": "

empty

" } ] }, "examples": [ { "title": "Error-Response: ", "content": "{\"message\": \"Error while creating volunteer\", \"data\": {}}", "type": "object" } ] }, "filename": "routes/api/volunteer.js", "groupTitle": "Volunteer", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/volunteer/" } ] }, { "type": "get", "url": "/volunteer/:id", "title": "get a volunteer's information", "name": "getVolunteer", "group": "Volunteer", "version": "1.3.0", "parameter": { "fields": { "param": [ { "group": "param", "type": "ObjectId", "optional": false, "field": "id", "description": "

a volunteer's unique mongoID

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "String", "optional": false, "field": "message", "description": "

Success message

" }, { "group": "Success 200", "type": "Object", "optional": false, "field": "data", "description": "

Volunteer object

" } ] }, "examples": [ { "title": "Success-Response: ", "content": "{\n \"message\": \"Successfully retrieved volunteer information\", \n \"data\": {...}\n }", "type": "object" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "String", "optional": false, "field": "message", "description": "

Error message

" }, { "group": "Error 4xx", "type": "Object", "optional": false, "field": "data", "description": "

empty

" } ] }, "examples": [ { "title": "Error-Response: ", "content": "{\"message\": \"Volunteer not found\", \"data\": {}}", "type": "object" } ] }, "filename": "routes/api/volunteer.js", "groupTitle": "Volunteer", "sampleRequest": [ { "url": "https://api.mchacks.ca/api/volunteer/:id" } ] } ] +[ + { + "type": "post", + "url": "/account/", + "title": "create a new account", + "name": "create", + "group": "Account", + "version": "0.0.8", + "parameter": { + "fields": { + "body": [ + { + "group": "body", + "type": "String", + "optional": false, + "field": "firstName", + "description": "

First name of the account creator.

" + }, + { + "group": "body", + "type": "String", + "optional": false, + "field": "lastName", + "description": "

Last name of the account creator.

" + }, + { + "group": "body", + "type": "String", + "optional": false, + "field": "pronoun", + "description": "

the pronoun of the account creator.

" + }, + { + "group": "body", + "type": "String", + "optional": false, + "field": "email", + "description": "

Email of the account.

" + }, + { + "group": "body", + "type": "String", + "optional": false, + "field": "gender", + "description": "

Gender of the account creator.

" + }, + { + "group": "body", + "type": "String[]", + "optional": false, + "field": "dietaryRestrictions", + "description": "

Any dietary restrictions for the user. 'None' if there are no restrictions

" + }, + { + "group": "body", + "type": "String", + "optional": false, + "field": "password", + "description": "

The password of the account.

" + }, + { + "group": "body", + "type": "String", + "optional": false, + "field": "birthDate", + "description": "

a Date parsable string.

" + }, + { + "group": "body", + "type": "Number", + "optional": true, + "field": "phoneNumber", + "description": "

the user's phone number, represented as a string.

" + } + ], + "header": [ + { + "group": "header", + "type": "JWT", + "optional": true, + "field": "token", + "description": "

the user's invite token.

" + } + ] + }, + "examples": [ + { + "title": "Request-Example:", + "content": "{ \n \"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"password\":\"hunter2\",\n \"phoneNumber\":1234567890,\n \"gender\":\"Male\",\n \"birthDate\":\"10/30/1997\"\n}", + "type": "json" + } + ] + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

Account object

" + } + ] + }, + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Account creation successful\", \n \"data\": {\n \"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \t\"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"phoneNumber\":1234567890,\n \t\"gender\":\"Male\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", + "type": "object" + } + ] + }, + "error": { + "fields": { + "Error 4xx": [ + { + "group": "Error 4xx", + "type": "string", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [ + { + "title": "Error-Response: ", + "content": "{\n \"message\": \"Account already exists\", \n \"data\": {\n \"route\": \"/\"\n }\n}", + "type": "object" + } + ] + }, + "filename": "routes/api/account.js", + "groupTitle": "Account", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/account/" + } + ] + }, + { + "type": "get", + "url": "/account/:id", + "title": "gets information from an account with mongoid ':id'", + "name": "getAccount", + "group": "Account", + "version": "0.0.8", + "parameter": { + "fields": { + "param": [ + { + "group": "param", + "type": "ObjectId", + "optional": false, + "field": "id", + "description": "

MongoId of an account

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

Account object

" + } + ] + }, + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Account found by user id\", \n \"data\": {\n \"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"phoneNumber\":1234567890,\n \"gender\":\"Male\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", + "type": "object" + } + ] + }, + "error": { + "fields": { + "Error 4xx": [ + { + "group": "Error 4xx", + "type": "string", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Account not found\", \"data\": {}}", + "type": "object" + } + ] + }, + "filename": "routes/api/account.js", + "groupTitle": "Account", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/account/:id" + } + ] + }, + { + "type": "get", + "url": "/account/invite", + "title": "Get all of the invites.", + "name": "getAllInvites", + "group": "Account", + "version": "0.0.8", + "description": "

Get all of the invites that currently exist in the database.

", + "success": { + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Invite retrieval successful.\", \n \"data\": [{\n \"email\":\"abc@def.com\",\n \"accountType\":\"Hacker\"\n }]\n }", + "type": "object" + } + ] + }, + "filename": "routes/api/account.js", + "groupTitle": "Account", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/account/invite" + } + ] + }, + { + "type": "post", + "url": "/account/invite", + "title": "invites a user to create an account with the specified accountType", + "name": "inviteAccount", + "group": "Account", + "version": "0.0.8", + "description": "

sends link with token to be used with the account/create route

", + "parameter": { + "fields": { + "body": [ + { + "group": "body", + "type": "String", + "optional": true, + "field": "email", + "description": "

email of the account to be created and where to send the link

" + }, + { + "group": "body", + "type": "String", + "optional": true, + "field": "accountType", + "description": "

the type of the account which the user can create, for sponsor this should specify tier as well

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

Account object

" + } + ] + }, + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Successfully invited user\", \n \"data\": {}\n }", + "type": "object" + } + ] + }, + "error": { + "fields": { + "Error 4xx": [ + { + "group": "Error 4xx", + "type": "string", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "object", + "optional": false, + "field": "data", + "description": "

Error object

" + } + ] + }, + "examples": [ + { + "title": "Error-Response:", + "content": "{\n \"message\": \"Invalid Authentication\",\n \"data\": {\n \"route\": \"/invite\"\n }\n }", + "type": "object" + } + ] + }, + "filename": "routes/api/account.js", + "groupTitle": "Account", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/account/invite" + } + ] + }, + { + "type": "get", + "url": "/account/self", + "title": "get information about own account", + "name": "self", + "group": "Account", + "version": "0.0.8", + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

Account object

" + } + ] + }, + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Account found by user email\", \n \"data\": {\n \t\"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \t\"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"phoneNumber\":1234567890,\n \t\"gender\":\"Male\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", + "type": "object" + } + ] + }, + "error": { + "fields": { + "Error 4xx": [ + { + "group": "Error 4xx", + "type": "string", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty object

" + } + ] + }, + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Account not found\", \"data\": {}}", + "type": "object" + } + ] + }, + "filename": "routes/api/account.js", + "groupTitle": "Account", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/account/self" + } + ] + }, + { + "type": "patch", + "url": "/account/:id", + "title": "update an account's information", + "name": "updateOneUser", + "group": "Account", + "version": "0.0.8", + "parameter": { + "fields": { + "body": [ + { + "group": "body", + "type": "String", + "optional": true, + "field": "firstName", + "description": "

First name of the account creator.

" + }, + { + "group": "body", + "type": "String", + "optional": true, + "field": "lastName", + "description": "

Last name of the account creator.

" + }, + { + "group": "body", + "type": "String", + "optional": true, + "field": "pronoun", + "description": "

The pronoun of the account creator.

" + }, + { + "group": "body", + "type": "String", + "optional": true, + "field": "email", + "description": "

Email of the account.

" + }, + { + "group": "body", + "type": "String", + "optional": true, + "field": "gender", + "description": "

Gender of the account creator.

" + }, + { + "group": "body", + "type": "String", + "optional": true, + "field": "birthDate", + "description": "

A Date parsable string.

" + }, + { + "group": "body", + "type": "Number", + "optional": true, + "field": "phoneNumber", + "description": "

The user's phone number, represented as a string.

" + }, + { + "group": "body", + "type": "String[]", + "optional": true, + "field": "dietaryRestrictions", + "description": "

Any dietary restrictions for the user. 'None' if there are no restrictions

" + } + ] + }, + "examples": [ + { + "title": "Request-Example:", + "content": "{ \"gender\": \"Male\" }", + "type": "json" + } + ] + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

Account object

" + } + ] + }, + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Account update successful.\", \n \"data\": {\n \"id\": ObjectId(\"5bff8b9f3274cf001bc71048\"),\n \t\"firstName\": \"Theo\",\n \"lastName\":\"Klein\",\n \"pronoun\":\"he/him\",\n \"email\":\"theo@klein.com\",\n \"phoneNumber\":1234567890,\n \t\"gender\": \"Male\",\n \"birthDate\":Date(\"10/30/1997\")\n }\n }", + "type": "object" + } + ] + }, + "error": { + "fields": { + "Error 4xx": [ + { + "group": "Error 4xx", + "type": "string", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Error while updating account\", \"data\": {}}", + "type": "object" + } + ] + }, + "filename": "routes/api/account.js", + "groupTitle": "Account", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/account/:id" + } + ] + }, + { + "type": "patch", + "url": "/auth/password/change", + "title": "change password for logged in user", + "name": "changePassword", + "group": "Authentication", + "version": "0.0.8", + "parameter": { + "fields": { + "Parameter": [ + { + "group": "Parameter", + "type": "String", + "optional": false, + "field": "oldPassword", + "description": "

The current password of the user

" + }, + { + "group": "Parameter", + "type": "String", + "optional": false, + "field": "newPassword", + "description": "

The new password of the user

" + } + ] + }, + "examples": [ + { + "title": "Request-Example:", + "content": "{\n \"oldPassword\": \"password12345\",\n \"newPassword\": \"password123456\"\n}", + "type": "json" + } + ] + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [ + { + "title": "Success-Response:", + "content": "{\"message\": \"Successfully reset password\", \"data\": {}}", + "type": "json" + } + ] + }, + "permission": [ + { + "name": ": Must be logged in" + } + ], + "filename": "routes/api/auth.js", + "groupTitle": "Authentication", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/auth/password/change" + } + ] + }, + { + "type": "post", + "url": "/auth/confirm/:token", + "title": "confirm account using the JWT in :token", + "name": "confirmAccount", + "group": "Authentication", + "version": "0.0.8", + "parameter": { + "fields": { + "Parameter": [ + { + "group": "Parameter", + "type": "String", + "optional": false, + "field": "JWT", + "description": "

for confirming the account

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [ + { + "title": "Success-Response:", + "content": "{\"message\": \"Successfully confirmed account\", \"data\": {}}", + "type": "json" + } + ] + }, + "error": { + "fields": { + "Error 4xx": [ + { + "group": "Error 4xx", + "type": "string", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [ + { + "title": "Error-Response:", + "content": "{\"message\": \"Invalid token for confirming account, \"data\": {}}", + "type": "object" + } + ] + }, + "filename": "routes/api/auth.js", + "groupTitle": "Authentication", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/auth/confirm/:token" + } + ] + }, + { + "type": "post", + "url": "/auth/password/forgot", + "title": "forgot password route", + "name": "forgotPassword", + "group": "Authentication", + "version": "0.0.8", + "parameter": { + "fields": { + "Parameter": [ + { + "group": "Parameter", + "type": "String", + "optional": false, + "field": "email", + "description": "

the email address of the account

" + } + ] + }, + "examples": [ + { + "title": "Request-Example:", + "content": "{ \"email\": \"myemail@mchacks.ca\" }", + "type": "json" + } + ] + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [ + { + "title": "Success-Response:", + "content": "{\"message\": \"Sent reset email\", \"data\": {}}", + "type": "json" + } + ] + }, + "permission": [ + { + "name": ": public" + } + ], + "filename": "routes/api/auth.js", + "groupTitle": "Authentication", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/auth/password/forgot" + } + ] + }, + { + "type": "get", + "url": "/auth/rolebindings/:id", + "title": "retrieve rolebindings for a user given by their user id :id", + "name": "getRoleBindings", + "group": "Authentication", + "version": "0.0.8", + "parameter": { + "fields": { + "param": [ + { + "group": "param", + "type": "ObjectId", + "optional": false, + "field": "id", + "description": "

MongoId of an account

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

Rolebindings object

" + } + ] + }, + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Successfully retrieved role bindings\",\n \"data\": {\n accountId:\"5beca4ab2e069a34f91697b2\"\n id:\"5beca4ae2e069a34f91698b1\"\n roles: [\n {\n _id:\"5beca4ab2e069a34f91697d9\",\n name:\"hacker\",\n routes: [\n {_id: \"5beca4ae2e069a34f9169852\", requestType: \"POST\", uri: \"/api/auth/login\"},\n {_id: \"5beca4ae2e069a34f9169851\", requestType: \"POST\", uri: \"/api/auth/logout\"},\n {_id: \"5beca4ae2e069a34f9169850\", requestType: \"GET\", uri: \"/api/auth/rolebindings/:self\"},\n {_id: \"5beca4ae2e069a34f916984f\", requestType: \"GET\", uri: \"/api/account/self\"},\n {_id: \"5beca4ae2e069a34f916984e\", requestType: \"GET\", uri: \"/api/account/:self\"},\n {_id: \"5beca4ae2e069a34f916984d\", requestType: \"PATCH\", uri: \"/api/account/:self\"},\n {_id: \"5beca4ae2e069a34f916984c\", requestType: \"POST\", uri: \"/api/hacker/\"},\n {_id: \"5beca4ae2e069a34f916984b\", requestType: \"GET\", uri: \"/api/hacker/:self\"},\n {_id: \"5beca4ae2e069a34f916984a\", requestType: \"GET\", uri: \"/api/hacker/:self/resume\"},\n {_id: \"5beca4ae2e069a34f9169849\", requestType: \"PATCH\", uri: \"/api/hacker/:self\"}\n ]\n }\n ]\n }\n }", + "type": "object" + } + ] + }, + "error": { + "fields": { + "Error 4xx": [ + { + "group": "Error 4xx", + "type": "string", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Role Bindings not found\", \"data\": {}}", + "type": "object" + } + ] + }, + "filename": "routes/api/auth.js", + "groupTitle": "Authentication", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/auth/rolebindings/:id" + } + ] + }, + { + "type": "get", + "url": "/auth/roles", + "title": "get roles", + "name": "getRoles", + "description": "

get all roles that exist in the database

", + "group": "Authentication", + "version": "0.0.8", + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [ + { + "title": "Success-Response:", + "content": "{\"message\": \"Sucessfully retrieved all roles\", \"data\":\n[{name: \"GodStaff\", routes: Array(27), id: \"5bee20ef3ca9dd4754382880\"},\n {name: \"Hacker\", routes: Array(10), id: \"5bee20ef3ca9dd4754382881\"},\n {name: \"Volunteer\", routes: Array(4), id: \"5bee20ef3ca9dd4754382882\"}]", + "type": "json" + } + ] + }, + "filename": "routes/api/auth.js", + "groupTitle": "Authentication", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/auth/roles" + } + ] + }, + { + "type": "post", + "url": "/auth/login", + "title": "login to the service", + "name": "login", + "group": "Authentication", + "version": "0.0.8", + "parameter": { + "fields": { + "Parameter": [ + { + "group": "Parameter", + "type": "string", + "optional": false, + "field": "email", + "description": "

Account email

" + }, + { + "group": "Parameter", + "type": "string", + "optional": false, + "field": "password", + "description": "

Account password

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [ + { + "title": "Success-Response: ", + "content": "{\"message\": \"Successfully logged in\", \"data\": {}}", + "type": "object" + } + ] + }, + "error": { + "fields": { + "Error 4xx": [ + { + "group": "Error 4xx", + "type": "string", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Invalid Authentication\", \"data\": {}}", + "type": "object" + } + ] + }, + "permission": [ + { + "name": ": public" + } + ], + "filename": "routes/api/auth.js", + "groupTitle": "Authentication", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/auth/login" + } + ] + }, + { + "type": "get", + "url": "/auth/logout", + "title": "logout of service", + "name": "logout", + "group": "Authentication", + "version": "0.0.8", + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [ + { + "title": "Success-Response:", + "content": "{\"message\": \"Successfully logged out\", \"data\": {}}", + "type": "object" + } + ] + }, + "permission": [ + { + "name": ": public" + } + ], + "filename": "routes/api/auth.js", + "groupTitle": "Authentication", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/auth/logout" + } + ] + }, + { + "type": "get", + "url": "/auth/confirm/resend", + "title": "resend confirmation token", + "name": "resendConfirmAccount", + "group": "Authentication", + "version": "0.0.8", + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [ + { + "title": "Success-Response:", + "content": "{\"message\": \"Successfully resent confirmation email\", \"data\": {}}", + "type": "json" + } + ] + }, + "error": { + "fields": { + "Error 4xx": [ + { + "group": "Error 4xx", + "type": "string", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [ + { + "title": "Error-Response:", + "content": " HTTP/1.1 422\n{\"message\": \"Account already confirmed\", \"data\": {}}", + "type": "json" + }, + { + "title": "Error-Response:", + "content": " HTTP/1.1 428\n{\"message\": \"Account confirmation token does not exist\", \"data\": {}}", + "type": "json" + } + ] + }, + "filename": "routes/api/auth.js", + "groupTitle": "Authentication", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/auth/confirm/resend" + } + ] + }, + { + "type": "post", + "url": "/auth/password/reset", + "title": "reset password", + "name": "resetPassword", + "group": "Authentication", + "version": "0.0.8", + "parameter": { + "fields": { + "Parameter": [ + { + "group": "Parameter", + "type": "String", + "optional": false, + "field": "password", + "description": "

the password of the account

" + } + ] + }, + "examples": [ + { + "title": "Request-Example:", + "content": "{ \"password\": \"hunter2\" }", + "type": "json" + } + ] + }, + "header": { + "fields": { + "Header": [ + { + "group": "Header", + "type": "String", + "optional": false, + "field": "Authentication", + "description": "

the token that was provided in the reset password email

" + } + ] + }, + "examples": [ + { + "title": "Header-Example:", + "content": "{\n \"X-Reset-Token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c\"\n}", + "type": "json" + } + ] + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [ + { + "title": "Success-Response:", + "content": "{\"message\": \"Successfully reset password\", \"data\": {}}", + "type": "json" + } + ] + }, + "permission": [ + { + "name": ": must have authentication token" + } + ], + "filename": "routes/api/auth.js", + "groupTitle": "Authentication", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/auth/password/reset" + } + ] + }, + { + "type": "patch", + "url": "/hacker/batchAccept/", + "title": "accept array of Hackers", + "name": "acceptHacker", + "group": "Hacker", + "version": "3.0.0", + "parameter": { + "fields": { + "body) {{ids: ObjectId[]}} Array of id(s": [ + { + "group": "body) {{ids: ObjectId[]}} Array of id(s", + "optional": false, + "field": "that", + "description": "

needed to be accepted

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

success_ids array and errors array. Errors array will contain a detailed error for why the batch update for a given ID did not work

" + } + ] + }, + "examples": [ + { + "title": "Success-Response:", + "content": "{\n \"message\": \"Hacker batch update successful.\",\n \"data\": {\n \"success_ids\": [\"id1\", \"id2\"]\n \"errors\": [{status: 404, message: \"ACCOUNT_NOT_FOUND\", account: null, hacker_id: \"id3\"}]\n }\n}", + "type": "object" + } + ] + }, + "permission": [ + { + "name": "Administrator" + } + ], + "filename": "routes/api/hacker.js", + "groupTitle": "Hacker", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/hacker/batchAccept/" + } + ] + }, + { + "type": "patch", + "url": "/hacker/acceptEmail/:email", + "title": "accept a Hacker by email", + "name": "acceptHacker", + "group": "Hacker", + "version": "2.0.0", + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

Hacker object

" + } + ] + }, + "examples": [ + { + "title": "Success-Response:", + "content": "{\n \"message\": \"Changed hacker information\",\n \"data\": {\n \"status\": \"Accepted\"\n }\n}", + "type": "object" + } + ] + }, + "permission": [ + { + "name": "Administrator" + } + ], + "filename": "routes/api/hacker.js", + "groupTitle": "Hacker", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/hacker/acceptEmail/:email" + } + ] + }, + { + "type": "patch", + "url": "/hacker/accept/:id", + "title": "accept a Hacker", + "name": "acceptHacker", + "group": "Hacker", + "version": "2.0.0", + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

Hacker object

" + } + ] + }, + "examples": [ + { + "title": "Success-Response:", + "content": "{\n \"message\": \"Changed hacker information\",\n \"data\": {\n \"status\": \"Accepted\"\n }\n}", + "type": "object" + } + ] + }, + "permission": [ + { + "name": "Administrator" + } + ], + "filename": "routes/api/hacker.js", + "groupTitle": "Hacker", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/hacker/accept/:id" + } + ] + }, + { + "type": "patch", + "url": "/hacker/checkin/:id", + "title": "update a hacker's status to be 'Checked-in'. Note that the Hacker must eitehr be Accepted or Confirmed.", + "name": "checkinHacker", + "group": "Hacker", + "version": "0.0.9", + "parameter": { + "fields": { + "body": [ + { + "group": "body", + "type": "string", + "optional": true, + "field": "status", + "description": "

Check-in status. "Checked-in"

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

Hacker object

" + } + ] + }, + "examples": [ + { + "title": "Success-Response:", + "content": "{\n \"message\": \"Changed hacker information\",\n \"data\": {\n \"status\": \"Checked-in\"\n }\n}", + "type": "object" + } + ] + }, + "permission": [ + { + "name": "Administrator" + }, + { + "name": "Volunteer" + } + ], + "filename": "routes/api/hacker.js", + "groupTitle": "Hacker", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/hacker/checkin/:id" + } + ] + }, + { + "type": "post", + "url": "/hacker/", + "title": "create a new hacker", + "name": "createHacker", + "group": "Hacker", + "version": "0.0.8", + "parameter": { + "fields": { + "body": [ + { + "group": "body", + "type": "MongoID", + "optional": false, + "field": "accountId", + "description": "

ObjectID of the respective account

" + }, + { + "group": "body", + "type": "String", + "optional": false, + "field": "school", + "description": "

Name of the school the hacker goes to

" + }, + { + "group": "body", + "type": "String", + "optional": false, + "field": "gender", + "description": "

Gender of the hacker

" + }, + { + "group": "body", + "type": "Number", + "optional": false, + "field": "travel", + "description": "

Whether the hacker requires a bus for transportation

" + }, + { + "group": "body", + "type": "String[]", + "optional": false, + "field": "ethnicity", + "description": "

the ethnicities of the hacker

" + }, + { + "group": "body", + "type": "String[]", + "optional": false, + "field": "major", + "description": "

the major of the hacker

" + }, + { + "group": "body", + "type": "Number", + "optional": false, + "field": "graduationYear", + "description": "

the graduation year of the hacker

" + }, + { + "group": "body", + "type": "Boolean", + "optional": false, + "field": "codeOfConduct", + "description": "

acceptance of the code of conduct

" + }, + { + "group": "body", + "type": "Json", + "optional": false, + "field": "application", + "description": "

The hacker's application. Resume and jobInterest fields are required.

" + } + ] + }, + "examples": [ + { + "title": "application: ", + "content": "{\n \"application\":{\n \"general\":{\n \"school\": \"McGill University\",\n \"degree\": \"Undergraduate\",\n \"fieldOfStudy\": \"Computer Science\",\n \"graduationYear\": \"2021\",\n \"jobInterest\":\"Internship\",\n \"URL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n },\n \"shortAnswer\": {\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"question1\": \"I love McHacks\",\n \"question2\":\"Pls accept me\",\n \"previousHackathons\": \"5\",\n \"comments\":\"hi!\",\n },\n \"other:\" {\n \"gender\": \"male\",\n \"ethnicity\": \"Asian or Pacific Islander\",\n \"privacyPolicy\": true,\n \"codeOfConduct\": true,\n }\n \"accomodation\": {\n \"travel\": 0\n },\n \"location:\" {\n \"timeZone\": \"GMT-5\",\n \"country\": \"Canada\",\n \"city\": \"Montreal\",\n }\n }\n}", + "type": "Json" + } + ] + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

Hacker object

" + } + ] + }, + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Hacker creation successful\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"application\":{\n \"general\":{\n \"school\": \"McGill University\",\n \"degree\": \"Undergraduate\",\n \"fieldOfStudy\": \"Computer Science\",\n \"graduationYear\": \"2021\",\n \"jobInterest\":\"Internship\",\n \"URL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n },\n \"shortAnswer\": {\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"question1\": \"I love McHacks\",\n \"question2\":\"Pls accept me\",\n \"previousHackathons\": \"5\",\n \"comments\":\"hi!\",\n },\n \"other:\" {\n \"gender\": \"male\",\n \"ethnicity\": \"Asian or Pacific Islander\",\n \"privacyPolicy\": true,\n \"codeOfConduct\": true,\n }\n \"accomodation\": {\n \"travel\": 0\n },\n \"location:\" {\n \"timeZone\": \"GMT-5\",\n \"country\": \"Canada\",\n \"city\": \"Montreal\",\n }\n }\n}", + "type": "object" + } + ] + }, + "error": { + "fields": { + "Error 4xx": [ + { + "group": "Error 4xx", + "type": "string", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Error while creating hacker\", \"data\": {}}", + "type": "object" + } + ] + }, + "filename": "routes/api/hacker.js", + "groupTitle": "Hacker", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/hacker/" + } + ] + }, + { + "type": "get", + "url": "/hacker/:id", + "title": "get a hacker's information", + "name": "getHacker", + "group": "Hacker", + "version": "0.0.8", + "parameter": { + "fields": { + "param": [ + { + "group": "param", + "type": "String", + "optional": false, + "field": "id", + "description": "

a hacker's unique mongoID

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "String", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "Object", + "optional": false, + "field": "data", + "description": "

Hacker object

" + } + ] + }, + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Successfully retrieved hacker information\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"status\": \"Applied\",\n \"application\":{\n \"general\":{\n \"school\": \"McGill University\",\n \"degree\": \"Undergraduate\",\n \"fieldOfStudy\": \"Computer Science\",\n \"graduationYear\": \"2021\",\n \"jobInterest\":\"Internship\",\n \"URL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n },\n \"shortAnswer\": {\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"question1\": \"I love McHacks\",\n \"question2\":\"Pls accept me\",\n \"previousHackathons\": \"5\",\n \"comments\":\"hi!\",\n },\n \"other:\" {\n \"gender\": \"male\",\n \"ethnicity\": \"Asian or Pacific Islander\",\n \"privacyPolicy\": true,\n \"codeOfConduct\": true,\n }\n \"accomodation\": {\n \"travel\": 0\n },\n \"location:\" {\n \"timeZone\": \"GMT-5\",\n \"country\": \"Canada\",\n \"city\": \"Montreal\",\n }\n }\n }\n }", + "type": "object" + } + ] + }, + "error": { + "fields": { + "Error 4xx": [ + { + "group": "Error 4xx", + "type": "String", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "Object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Hacker not found\", \"data\": {}}", + "type": "object" + } + ] + }, + "filename": "routes/api/hacker.js", + "groupTitle": "Hacker", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/hacker/:id" + } + ] + }, + { + "type": "get", + "url": "/hacker/email/:email", + "title": "get a hacker's information", + "name": "getHacker", + "group": "Hacker", + "version": "0.0.8", + "parameter": { + "fields": { + "param": [ + { + "group": "param", + "type": "String", + "optional": false, + "field": "email", + "description": "

a hacker's unique email

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "String", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "Object", + "optional": false, + "field": "data", + "description": "

Hacker object

" + } + ] + }, + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Successfully retrieved hacker information\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"status\": \"Applied\",\n \"application\":{\n \"general\":{\n \"school\": \"McGill University\",\n \"degree\": \"Undergraduate\",\n \"fieldOfStudy\": \"Computer Science\",\n \"graduationYear\": \"2021\",\n \"jobInterest\":\"Internship\",\n \"URL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n },\n \"shortAnswer\": {\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"question1\": \"I love McHacks\",\n \"question2\":\"Pls accept me\",\n \"previousHackathons\": \"5\",\n \"comments\":\"hi!\",\n },\n \"other:\" {\n \"gender\": \"male\",\n \"ethnicity\": \"Asian or Pacific Islander\",\n \"privacyPolicy\": true,\n \"codeOfConduct\": true,\n }\n \"accomodation\": {\n \"travel\": 0\n },\n \"location:\" {\n \"timeZone\": \"GMT-5\",\n \"country\": \"Canada\",\n \"city\": \"Montreal\",\n }\n }\n }\n }", + "type": "object" + } + ] + }, + "error": { + "fields": { + "Error 4xx": [ + { + "group": "Error 4xx", + "type": "String", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "Object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Hacker not found\", \"data\": {}}", + "type": "object" + } + ] + }, + "filename": "routes/api/hacker.js", + "groupTitle": "Hacker", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/hacker/email/:email" + } + ] + }, + { + "type": "get", + "url": "/hacker/resume:id", + "title": "get the resume for a hacker.", + "name": "getHackerResume", + "group": "Hacker", + "version": "0.0.8", + "parameter": { + "fields": { + "param": [ + { + "group": "param", + "type": "ObjectId", + "optional": false, + "field": "id", + "description": "

Hacker id

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "String", + "optional": false, + "field": "message", + "description": "

Success message

" + } + ] + }, + "examples": [ + { + "title": "Success-Response:", + "content": "HTTP/1.1 200 OK\n{\n message: \"Downloaded resume\",\n data: {\n id: \"507f191e810c19729de860ea\",\n resume: [Buffer]\n }\n}", + "type": "json" + } + ] + }, + "error": { + "fields": { + "Error 4xx": [ + { + "group": "Error 4xx", + "type": "String", + "optional": false, + "field": "message", + "description": "

"Resume does not exist"

" + } + ] + }, + "examples": [ + { + "title": "Error-Response:", + "content": "HTTP/1.1 404\n{\n message: \"Resume not found\",\n data: {}\n}", + "type": "json" + } + ] + }, + "permission": [ + { + "name": "Must be logged in, and the account id must be linked to the hacker." + } + ], + "filename": "routes/api/hacker.js", + "groupTitle": "Hacker" + }, + { + "type": "get", + "url": "/hacker/stats", + "title": "Gets the stats of all of the hackers who have applied.", + "name": "getHackerStats", + "group": "Hacker", + "version": "0.0.9", + "parameter": { + "fields": { + "query": [ + { + "group": "query", + "type": "String", + "optional": false, + "field": "model", + "description": "

the model to be searched (Only hacker supported)

" + }, + { + "group": "query", + "type": "Array", + "optional": false, + "field": "q", + "description": "

the query to be executed. For more information on how to format this, please see https://docs.mchacks.ca/architecture/

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

Hacker object

" + } + ] + }, + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Retrieved stats\",\n \"data\": {\n \"stats\" : {\n \"total\": 10,\n \"status\": { \"Applied\": 10 },\n \"school\": { \"McGill University\": 3, \"Harvard University\": 7 },\n degree: { \"Undergraduate\": 10 },\n gender: { \"Male\": 1, \"Female\": 9 },\n travel: { \"true\": 7, \"false\": 3 },\n ethnicity: { \"White\": 10, },\n jobInterest: { \"Internship\": 10 },\n major: { \"Computer Science\": 10 },\n graduationYear: { \"2019\": 10 },\n dietaryRestrictions: { \"None\": 10 },\n shirtSize: { \"M\": 3, \"XL\": 7 },\n age: { \"22\": 10 }\n }\n }\n}", + "type": "object" + } + ] + }, + "filename": "routes/api/hacker.js", + "groupTitle": "Hacker", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/hacker/stats" + } + ] + }, + { + "type": "patch", + "url": "/hacker/:id", + "title": "update a hacker's information.", + "description": "

This route only contains the ability to update a subset of a hacker's information. If you want to update a status, you must have Admin priviledges and use PATCH /hacker/status/:id.

", + "name": "patchHacker", + "group": "Hacker", + "version": "0.0.8", + "parameter": { + "fields": { + "body": [ + { + "group": "body", + "type": "String", + "optional": true, + "field": "school", + "description": "

Name of the school the hacker goes to

" + }, + { + "group": "body", + "type": "String", + "optional": true, + "field": "gender", + "description": "

Gender of the hacker

" + }, + { + "group": "body", + "type": "Number", + "optional": true, + "field": "travel", + "description": "

How much the hacker requires a bus for transportation

" + }, + { + "group": "body", + "type": "String[]", + "optional": true, + "field": "ethnicity", + "description": "

the ethnicities of the hacker

" + }, + { + "group": "body", + "type": "String[]", + "optional": true, + "field": "major", + "description": "

the major of the hacker

" + }, + { + "group": "body", + "type": "Number", + "optional": true, + "field": "graduationYear", + "description": "

the graduation year of the hacker

" + }, + { + "group": "body", + "type": "Json", + "optional": true, + "field": "application", + "description": "

The hacker's application

" + } + ] + }, + "examples": [ + { + "title": "application: ", + "content": "{\n \"application\":{\n \"general\":{\n \"school\": \"McGill University\",\n \"degree\": \"Undergraduate\",\n \"fieldOfStudy\": \"Computer Science\",\n \"graduationYear\": \"2021\",\n \"jobInterest\":\"Internship\",\n \"URL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n },\n \"shortAnswer\": {\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"question1\": \"I love McHacks\",\n \"question2\":\"Pls accept me\",\n \"previousHackathons\": \"5\",\n \"comments\":\"hi!\",\n },\n \"other:\" {\n \"gender\": \"male\",\n \"ethnicity\": \"Asian or Pacific Islander\",\n \"privacyPolicy\": true,\n \"codeOfConduct\": true,\n }\n \"accomodation\": {\n \"travel\": 0\n },\n \"location:\" {\n \"timeZone\": \"GMT-5\",\n \"country\": \"Canada\",\n \"city\": \"Montreal\",\n }\n }\n }", + "type": "Json" + } + ] + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

Hacker object

" + } + ] + }, + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Changed hacker information\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"status\": \"Applied\",\n \"application\":{\n \"general\":{\n \"school\": \"McGill University\",\n \"degree\": \"Undergraduate\",\n \"fieldOfStudy\": \"Computer Science\",\n \"graduationYear\": \"2021\",\n \"jobInterest\":\"Internship\",\n \"URL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n },\n \"shortAnswer\": {\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"question1\": \"I love McHacks\",\n \"question2\":\"Pls accept me\",\n \"previousHackathons\": \"5\",\n \"comments\":\"hi!\",\n },\n \"other:\" {\n \"gender\": \"male\",\n \"ethnicity\": \"Asian or Pacific Islander\",\n \"privacyPolicy\": true,\n \"codeOfConduct\": true,\n }\n \"accomodation\": {\n \"travel\": 0\n },\n \"location:\" {\n \"timeZone\": \"GMT-5\",\n \"country\": \"Canada\",\n \"city\": \"Montreal\",\n }\n }\n }\n}", + "type": "object" + } + ] + }, + "error": { + "fields": { + "Error 4xx": [ + { + "group": "Error 4xx", + "type": "string", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Error while updating hacker\", \"data\": {}}", + "type": "object" + } + ] + }, + "filename": "routes/api/hacker.js", + "groupTitle": "Hacker", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/hacker/:id" + } + ] + }, + { + "type": "patch", + "url": "/hacker/confirmation/:id", + "title": "Allows confirmation of hacker attendence if they are accepted. Also allows change from 'confirmed' to 'withdrawn'.", + "name": "patchHackerConfirmed", + "group": "Hacker", + "version": "0.0.9", + "parameter": { + "fields": { + "body": [ + { + "group": "body", + "type": "string", + "optional": true, + "field": "status", + "description": "

The new status of the hacker. "Accepted", "Confirmed", or "Withdrawn"

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

Hacker object

" + } + ] + }, + "examples": [ + { + "title": "Success-Response:", + "content": "{\n \"message\": \"Changed hacker information\",\n \"data\": {\n \"status\": \"Confirmed\"\n }\n}", + "type": "object" + } + ] + }, + "permission": [ + { + "name": "Administrator" + }, + { + "name": "Hacker" + } + ], + "filename": "routes/api/hacker.js", + "groupTitle": "Hacker", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/hacker/confirmation/:id" + } + ] + }, + { + "type": "patch", + "url": "/hacker/status/:id", + "title": "update a hacker's status", + "name": "patchHackerStatus", + "group": "Hacker", + "version": "0.0.9", + "parameter": { + "fields": { + "body": [ + { + "group": "body", + "type": "string", + "optional": true, + "field": "status", + "description": "

Status of the hacker's application ("None"|"Applied"|"Accepted"|"Declined"|"Waitlisted"|"Confirmed"|"Withdrawn"|"Checked-in")

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

Hacker object

" + } + ] + }, + "examples": [ + { + "title": "Success-Response:", + "content": "{\n \"message\": \"Changed hacker information\",\n \"data\": {\n \"status\": \"Accepted\"\n }\n}", + "type": "object" + } + ] + }, + "permission": [ + { + "name": "Administrator" + } + ], + "filename": "routes/api/hacker.js", + "groupTitle": "Hacker", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/hacker/status/:id" + } + ] + }, + { + "type": "post", + "url": "/hacker/resume/:id", + "title": "upload or update resume for a hacker.", + "name": "postHackerResume", + "group": "Hacker", + "version": "0.0.8", + "description": "

NOTE: This must be sent via multipart/form-data POST request

", + "parameter": { + "fields": { + "param": [ + { + "group": "param", + "type": "ObjectId", + "optional": false, + "field": "id", + "description": "

Hacker id

" + } + ], + "body": [ + { + "group": "body", + "type": "File", + "optional": false, + "field": "resume", + "description": "

The uploaded file.

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "String", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "Object", + "optional": false, + "field": "data", + "description": "

Location in the bucket that the file was stored.

" + } + ] + }, + "examples": [ + { + "title": "Success-Response:", + "content": "HTTP/1.1 200 OK\n{\n message: \"Uploaded resume\",\n data: {\n filename: \"resumes/1535032624768-507f191e810c19729de860ea\"\n }\n}", + "type": "json" + } + ] + }, + "permission": [ + { + "name": "Must be logged in, and the account id must be linked to the hacker." + } + ], + "filename": "routes/api/hacker.js", + "groupTitle": "Hacker", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/hacker/resume/:id" + } + ] + }, + { + "type": "post", + "url": "/hacker/email/dayOf/:id", + "title": "", + "description": "

Sends a hacker the day-of email, along with the HackPass QR code to view their hacker profile (for checkin purposes). Hackers must be either confirmed, or checked in.

", + "name": "postHackerSendDayOfEmail", + "group": "Hacker", + "version": "0.0.9", + "parameter": { + "fields": { + "param": [ + { + "group": "param", + "type": "string", + "optional": true, + "field": "status", + "description": "

The hacker ID

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [ + { + "title": "Success-Response:", + "content": "{\n \"message\": \"Hacker day-of email sent.\",\n \"data\": {}\n}", + "type": "object" + } + ] + }, + "permission": [ + { + "name": "Administrator" + } + ], + "filename": "routes/api/hacker.js", + "groupTitle": "Hacker", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/hacker/email/dayOf/:id" + } + ] + }, + { + "type": "post", + "url": "/hacker/email/weekOf/:id", + "title": "", + "description": "

Sends a hacker the week-of email, along with the HackPass QR code to view their hacker profile (for checkin purposes). Hackers must be either confirmed, or checked in.

", + "name": "postHackerSendWeekOfEmail", + "group": "Hacker", + "version": "0.0.9", + "parameter": { + "fields": { + "param": [ + { + "group": "param", + "type": "string", + "optional": true, + "field": "status", + "description": "

The hacker ID

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [ + { + "title": "Success-Response:", + "content": "{\n \"message\": \"Hacker week-of email sent.\",\n \"data\": {}\n}", + "type": "object" + } + ] + }, + "permission": [ + { + "name": "Administrator" + } + ], + "filename": "routes/api/hacker.js", + "groupTitle": "Hacker", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/hacker/email/weekOf/:id" + } + ] + }, + { + "type": "post", + "url": "/hacker/email/weekOf/:id", + "title": "", + "description": "

Sends a hacker the week-of email, along with the HackPass QR code to view their hacker profile (for checkin purposes). Hackers must be eitherconfirmed, or checked in.

", + "name": "postHackerSendWeekOfEmail", + "group": "Hacker", + "version": "0.0.9", + "parameter": { + "fields": { + "param": [ + { + "group": "param", + "type": "string", + "optional": true, + "field": "status", + "description": "

The hacker ID

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [ + { + "title": "Success-Response:", + "content": "{\n \"message\": \"Hacker week-of email sent.\",\n \"data\": {}\n}", + "type": "object" + } + ] + }, + "permission": [ + { + "name": "Administrator" + } + ], + "filename": "routes/api/hacker.js", + "groupTitle": "Hacker", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/hacker/email/weekOf/:id" + } + ] + }, + { + "type": "get", + "url": "/sponsor/self", + "title": "get information about logged in sponsor", + "name": "self", + "group": "Hacker", + "version": "1.4.1", + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "String", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "Object", + "optional": false, + "field": "data", + "description": "

Sponsor object

" + } + ] + }, + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Successfully retrieved sponsor information\", \n \"data\": {\n \"id\": \"5bff4d736f86be0a41badb91\",\n \"accountId\": \"5bff4d736f86be0a41badb99\",\n \"tier\": 3,\n \"company\": \"companyName\",\n \"contractURL\": \"https://www.contractHere.com\",\n \"nominees\": [\"5bff4d736f86be0a41badb93\",\"5bff4d736f86be0a41badb94\"]\n }\n }", + "type": "object" + } + ] + }, + "error": { + "fields": { + "Error 4xx": [ + { + "group": "Error 4xx", + "type": "String", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "Object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Sponsor not found\", \"data\": {}}", + "type": "object" + } + ] + }, + "permission": [ + { + "name": ": Sponsor" + } + ], + "filename": "routes/api/sponsor.js", + "groupTitle": "Hacker", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/sponsor/self" + } + ] + }, + { + "type": "get", + "url": "/hacker/self", + "title": "get information about own hacker", + "name": "self", + "group": "Hacker", + "version": "0.0.8", + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

Hacker object

" + } + ] + }, + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Hacker found by logged in account id\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"application\":{\n \"URL\":{\n \"resume\":\"resumes/1543458163426-5bff4d736f86be0a41badb91\",\n \"github\":\"https://github.com/abcd\",\n \"dropler\":\"https://dribbble.com/abcd\",\n \"personal\":\"https://www.hi.com/\",\n \"linkedIn\":\"https://linkedin.com/in/abcd\",\n \"other\":\"https://github.com/hackmcgill/hackerAPI/issues/168\"\n },\n \"jobInterest\":\"Internship\",\n \"skills\":[\"Javascript\",\"Typescript\"],\n \"comments\":\"hi!\",\n \"essay\":\"Pls accept me\"\n },\n \"status\":\"Applied\",\n \"ethnicity\":[\"White or Caucasian\",\" Asian or Pacific Islander\"],\n \"accountId\":\"5bff2a35e533b0f6562b4998\",\n \"school\":\"McPherson College\",\n \"gender\":\"Female\",\n \"travel\":0,\n \"major\":[\"Accounting\"],\n \"graduationYear\":2019,\n \"codeOfConduct\":true,\n } \n }", + "type": "object" + } + ] + }, + "error": { + "fields": { + "Error 4xx": [ + { + "group": "Error 4xx", + "type": "string", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Hacker not found\", \"data\": {}}", + "type": "object" + } + ] + }, + "filename": "routes/api/hacker.js", + "groupTitle": "Hacker", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/hacker/self" + } + ] + }, + { + "type": "get", + "url": "/", + "title": "version", + "version": "0.0.8", + "name": "index", + "group": "Index", + "permission": [ + { + "name": "public" + } + ], + "filename": "routes/index.js", + "groupTitle": "Index", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/" + } + ] + }, + { + "type": "post", + "url": "/api/role/", + "title": "create a new role", + "name": "createRole", + "group": "Role", + "version": "1.1.1", + "parameter": { + "fields": { + "body": [ + { + "group": "body", + "type": "String", + "optional": false, + "field": "name", + "description": "

Name of the route

" + }, + { + "group": "body", + "type": "Route[]", + "optional": false, + "field": "routes", + "description": "

The routes that this role gives access to

" + } + ] + }, + "examples": [ + { + "title": "application: ", + "content": "{\n \"name\": \"routename\",\n \"routes\": [\n {\n uri: \"/api/hacker/\"\n requestType: \"POST\"\n }\n ]\n}", + "type": "Json" + } + ] + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

Role object

" + } + ] + }, + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Role creation successful\", \n \"data\": {\n \"name\": \"routename\",\n \"routes\": [\n {\n uri: \"/api/hacker/\"\n requestType: \"POST\"\n }\n ]\n }\n}", + "type": "object" + } + ] + }, + "error": { + "fields": { + "Error 4xx": [ + { + "group": "Error 4xx", + "type": "string", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Error while creating role\", \"data\": {}}", + "type": "object" + } + ] + }, + "filename": "routes/api/role.js", + "groupTitle": "Role", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/api/role/" + } + ] + }, + { + "type": "get", + "url": "/search/", + "title": "provide a specific query for any defined model", + "name": "search", + "group": "Search", + "version": "0.0.8", + "parameter": { + "fields": { + "query": [ + { + "group": "query", + "type": "String", + "optional": false, + "field": "model", + "description": "

the model to be searched

" + }, + { + "group": "query", + "type": "Array", + "optional": false, + "field": "q", + "description": "

the query to be executed. For more information on how to format this, please see https://docs.mchacks.ca/architecture/

" + }, + { + "group": "query", + "type": "String", + "optional": false, + "field": "sort", + "description": "

either "asc" or "desc"

" + }, + { + "group": "query", + "type": "number", + "optional": false, + "field": "page", + "description": "

the page number that you would like

" + }, + { + "group": "query", + "type": "number", + "optional": false, + "field": "limit", + "description": "

the maximum number of results that you would like returned

" + }, + { + "group": "query", + "type": "any", + "optional": false, + "field": "sort_by", + "description": "

any parameter you want to sort the results by

" + }, + { + "group": "query", + "type": "boolean", + "optional": false, + "field": "expand", + "description": "

whether you want to expand sub documents within the results

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "String", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "Object", + "optional": false, + "field": "data", + "description": "

Results

" + } + ] + }, + "examples": [ + { + "title": "Success-Response:", + "content": "{\n \"message\": \"Successfully executed query, returning all results\",\n \"data\": [\n {...}\n ]\n }", + "type": "object" + }, + { + "title": "Success-Response:", + "content": "{\n \"message\": \"No results found.\",\n \"data\": {}\n }", + "type": "object" + } + ] + }, + "error": { + "fields": { + "Error 4xx": [ + { + "group": "Error 4xx", + "type": "String", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "Object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [ + { + "title": "Error-Response:", + "content": "{\"message\": \"Validation failed\", \"data\": {}}", + "type": "object" + } + ] + }, + "filename": "routes/api/search.js", + "groupTitle": "Search", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/search/" + } + ] + }, + { + "type": "get", + "url": "/settings/", + "title": "Get the settings for the current hackathon", + "name": "getSettings", + "group": "Settings", + "version": "1.1.1", + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

Settings Object

" + } + ] + }, + "examples": [ + { + "title": "Success-Response:", + "content": "{\n \"message\": \"Settings creation successful.\",\n \"data\": {\n \"settings\": {\n openTime: \"Wed Feb 06 2019 00:00:00 GMT-0500 (GMT-05:00)\",\n closeTime: \"Sat Feb 01 2020 00:00:00 GMT-0500 (GMT-05:00)\",\n confirmTime: \"Sat Feb 20 2020 00:00:00 GMT-0500 (GMT-05:00)\",\n isRemote: false\n }\n }\n}", + "type": "object" + } + ] + }, + "permission": [ + { + "name": "public" + } + ], + "filename": "routes/api/settings.js", + "groupTitle": "Settings", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/settings/" + } + ] + }, + { + "type": "patch", + "url": "/settings/", + "title": "Patch the settings for the current hackathon", + "name": "patchSettings", + "group": "Settings", + "version": "1.1.1", + "parameter": { + "fields": { + "body": [ + { + "group": "body", + "type": "Date", + "optional": true, + "field": "openTime", + "description": "

The opening time for the hackathon.

" + }, + { + "group": "body", + "type": "Date", + "optional": true, + "field": "closeTime", + "description": "

The closing time for the hackathon.

" + }, + { + "group": "body", + "type": "Date", + "optional": true, + "field": "confirmTime", + "description": "

The deadline for confirmation for the hackathon.

" + }, + { + "group": "body", + "type": "Boolean", + "optional": true, + "field": "isRemote", + "description": "

Whether this hackathon is remote or not.

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

Settings Object

" + } + ] + }, + "examples": [ + { + "title": "Success-Response:", + "content": "{\n \"message\": \"Settings patch successful.\",\n \"data\": {\n \"settings\": {\n openTime: \"Wed Feb 06 2019 00:00:00 GMT-0500 (GMT-05:00)\",\n closeTime: \"Sat Feb 01 2020 00:00:00 GMT-0500 (GMT-05:00)\",\n confirmTime: \"Sat Feb 20 2020 00:00:00 GMT-0500 (GMT-05:00)\",\n isRemote: true\n }\n }\n}", + "type": "object" + } + ] + }, + "permission": [ + { + "name": "Administrators" + } + ], + "filename": "routes/api/settings.js", + "groupTitle": "Settings", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/settings/" + } + ] + }, + { + "type": "post", + "url": "/sponsor/", + "title": "create a new sponsor", + "name": "createSponsor", + "group": "Sponsor", + "version": "0.0.8", + "parameter": { + "fields": { + "body": [ + { + "group": "body", + "type": "MongoID", + "optional": false, + "field": "accountId", + "description": "

ObjectID of the respective account.

" + }, + { + "group": "body", + "type": "Number", + "optional": false, + "field": "tier", + "description": "

Tier of the sponsor, from 0 to 5. 0 is lowest tier, and 5 is the custom tier.

" + }, + { + "group": "body", + "type": "String", + "optional": false, + "field": "company", + "description": "

Name of the company.

" + }, + { + "group": "body", + "type": "String", + "optional": false, + "field": "contractURL", + "description": "

URL link to the contract with the company.

" + }, + { + "group": "body", + "type": "MongoID[]", + "optional": false, + "field": "nominees", + "description": "

Array of accounts that the company wish to nominate as hackers.

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "String", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "Object", + "optional": false, + "field": "data", + "description": "

Sponsor object

" + } + ] + }, + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Sponsor creation successful\", \n \"data\": {...}\n }", + "type": "object" + } + ] + }, + "error": { + "fields": { + "Error 4xx": [ + { + "group": "Error 4xx", + "type": "String", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "Object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Error while creating sponsor\", \"data\": {}}", + "type": "object" + } + ] + }, + "filename": "routes/api/sponsor.js", + "groupTitle": "Sponsor", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/sponsor/" + } + ] + }, + { + "type": "get", + "url": "/sponsor/:id", + "title": "get a sponsor's information", + "name": "getSponsor", + "group": "Sponsor", + "version": "0.0.8", + "parameter": { + "fields": { + "param": [ + { + "group": "param", + "type": "string", + "optional": false, + "field": "id", + "description": "

a sponsor's unique mongoID

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "String", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "Object", + "optional": false, + "field": "data", + "description": "

Sponsor object

" + } + ] + }, + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Successfully retrieved sponsor information\", \n \"data\": {\n \"id\": \"5bff4d736f86be0a41badb91\",\n \"accountId\": \"5bff4d736f86be0a41badb99\",\n \"tier\": 3,\n \"company\": \"companyName\",\n \"contractURL\": \"https://www.contractHere.com\",\n \"nominees\": [\"5bff4d736f86be0a41badb93\",\"5bff4d736f86be0a41badb94\"]\n }\n }", + "type": "object" + } + ] + }, + "error": { + "fields": { + "Error 4xx": [ + { + "group": "Error 4xx", + "type": "String", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "Object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Sponsor not found\", \"data\": {}}", + "type": "object" + } + ] + }, + "filename": "routes/api/sponsor.js", + "groupTitle": "Sponsor", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/sponsor/:id" + } + ] + }, + { + "type": "patch", + "url": "/sponsor/", + "title": "update a sponsor", + "name": "patchSponsor", + "group": "Sponsor", + "version": "1.3.0", + "parameter": { + "fields": { + "param": [ + { + "group": "param", + "type": "ObjectId", + "optional": false, + "field": "id", + "description": "

ObjectID of the sponsor

" + } + ], + "body": [ + { + "group": "body", + "type": "String", + "optional": false, + "field": "company", + "description": "

Name of the company.

" + }, + { + "group": "body", + "type": "String", + "optional": false, + "field": "contractURL", + "description": "

URL link to the contract with the company.

" + }, + { + "group": "body", + "type": "ObjectId[]", + "optional": false, + "field": "nominees", + "description": "

Array of accounts that the company wish to nominate as hackers.

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "String", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "Object", + "optional": false, + "field": "data", + "description": "

Sponsor object

" + } + ] + }, + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Sponsor update successful\", \n \"data\": {...}\n }", + "type": "object" + } + ] + }, + "error": { + "fields": { + "Error 4xx": [ + { + "group": "Error 4xx", + "type": "String", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "Object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Error while updating sponsor\", \"data\": {}}", + "type": "object" + } + ] + }, + "filename": "routes/api/sponsor.js", + "groupTitle": "Sponsor", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/sponsor/" + } + ] + }, + { + "type": "post", + "url": "/team/", + "title": "create a new team consisting of only the logged in user", + "name": "createTeam", + "group": "Team", + "version": "0.0.8", + "parameter": { + "fields": { + "body": [ + { + "group": "body", + "type": "String", + "optional": false, + "field": "name", + "description": "

Name of the team.

" + }, + { + "group": "body", + "type": "String", + "optional": true, + "field": "devpostURL", + "description": "

Devpost link to hack. Once the link is sent, the hack will be considered to be submitted.

" + }, + { + "group": "body", + "type": "String", + "optional": true, + "field": "projectName", + "description": "

Name of the team.

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

Team object

" + } + ] + }, + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Team creation successful\", \n \"data\": {...}\n }", + "type": "object" + } + ] + }, + "error": { + "fields": { + "Error 4xx": [ + { + "group": "Error 4xx", + "type": "string", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Error while creating team\", \"data\": {}}", + "type": "object" + } + ] + }, + "filename": "routes/api/team.js", + "groupTitle": "Team", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/team/" + } + ] + }, + { + "type": "patch", + "url": "/team/leave/", + "title": "Allows a logged in hacker to leave current team", + "name": "deleteSelfFromTeam", + "group": "Team", + "version": "1.1.1", + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

{}

" + } + ] + }, + "examples": [ + { + "title": "Success-Response:", + "content": "{\n \"message\": \"Removal from team successful.\",\n \"data\": {}\n}", + "type": "object" + } + ] + }, + "filename": "routes/api/team.js", + "groupTitle": "Team", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/team/leave/" + } + ] + }, + { + "type": "get", + "url": "/team/:id", + "title": "get a team's information", + "name": "getTeam", + "group": "Team", + "version": "0.0.8", + "parameter": { + "fields": { + "param": [ + { + "group": "param", + "type": "ObjectId", + "optional": false, + "field": "id", + "description": "

MongoId of the team

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "String", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "Object", + "optional": false, + "field": "data", + "description": "

Team object

" + } + ] + }, + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Team retrieval successful\", \n \"data\": { \n \"team\": {\n \"name\":\"foo\",\n \"members\": [\n ObjectId('...')\n ],\n \"devpostURL\": \"www.devpost.com/foo\",\n \"projectName\": \"fooey\"\n },\n \"members\": [\n {\n \"firstName\": \"John\",\n \"lastName\": \"Doe\"\n }\n ],\n }\n }", + "type": "object" + } + ] + }, + "error": { + "fields": { + "Error 4xx": [ + { + "group": "Error 4xx", + "type": "String", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "Object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Team not found\", \"data\": {}}", + "type": "object" + } + ] + }, + "filename": "routes/api/team.js", + "groupTitle": "Team", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/team/:id" + } + ] + }, + { + "type": "patch", + "url": "/team/join/", + "title": "Allows a logged in hacker to join a team by name", + "name": "patchJoinTeam", + "group": "Team", + "version": "1.1.1", + "parameter": { + "fields": { + "body": [ + { + "group": "body", + "type": "string", + "optional": true, + "field": "name", + "description": "

Name of the team to join

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

{}

" + } + ] + }, + "examples": [ + { + "title": "Success-Response:", + "content": "{\n \"message\": \"Team join successful.\",\n \"data\": {}\n}", + "type": "object" + } + ] + }, + "filename": "routes/api/team.js", + "groupTitle": "Team", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/team/join/" + } + ] + }, + { + "type": "patch", + "url": "/team/:hackerId", + "title": "Update a team's information. The team is specified by the hacker belonging to it.", + "name": "patchTeam", + "group": "Team", + "version": "0.0.8", + "description": "

We use hackerId instead of teamId because authorization requires a one-to-one mapping from param id to accountId, but we are not able to have that from teamId to accountId due to multiple members in a team. Instead, we use hackerId, as there is a 1 to 1 link between hackerId to teamId, and a 1 to 1 link between hackerId and accountId

", + "parameter": { + "fields": { + "param": [ + { + "group": "param", + "type": "ObjectId", + "optional": false, + "field": "hackerId", + "description": "

a hacker's unique Id

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "String", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "Object", + "optional": false, + "field": "data", + "description": "

Team object

" + } + ] + }, + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Team update successful.\", \n \"data\": {...}\n }", + "type": "object" + } + ] + }, + "error": { + "fields": { + "Error 4xx": [ + { + "group": "Error 4xx", + "type": "String", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "Object", + "optional": false, + "field": "data", + "description": "

Query input that caused the error.

" + } + ] + }, + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Team not found\", \"data\": {teamId}}", + "type": "object" + } + ] + }, + "filename": "routes/api/team.js", + "groupTitle": "Team", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/team/:hackerId" + } + ] + }, + { + "type": "post", + "url": "/travel/", + "title": "create a new travel", + "name": "createTravel", + "group": "Travel", + "version": "2.0.1", + "parameter": { + "fields": { + "body": [ + { + "group": "body", + "type": "MongoID", + "optional": false, + "field": "accountId", + "description": "

ObjectID of the respective account

" + }, + { + "group": "body", + "type": "MongoID", + "optional": false, + "field": "hackerId", + "description": "

ObjectID of the respective hacker

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

Travel object

" + } + ] + }, + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Travel creation successful\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"status\": \"None\",\n \"request\": 50,\n \"offer\": 0\n }\n}", + "type": "object" + } + ] + }, + "error": { + "fields": { + "Error 4xx": [ + { + "group": "Error 4xx", + "type": "string", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Error while creating travel\", \"data\": {}}", + "type": "object" + } + ] + }, + "filename": "routes/api/travel.js", + "groupTitle": "Travel", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/travel/" + } + ] + }, + { + "type": "get", + "url": "/travel/email/:email", + "title": "get a travel's information", + "name": "getTravel", + "group": "Travel", + "version": "2.0.1", + "parameter": { + "fields": { + "param": [ + { + "group": "param", + "type": "String", + "optional": false, + "field": "email", + "description": "

a travel's unique email

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "String", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "Object", + "optional": false, + "field": "data", + "description": "

Travel object

" + } + ] + }, + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Successfully retrieved travel information\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"status\": \"Valid\",\n \"request\": 100,\n \"offer\": 50\n }\n }", + "type": "object" + } + ] + }, + "error": { + "fields": { + "Error 4xx": [ + { + "group": "Error 4xx", + "type": "String", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "Object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Travel not found\", \"data\": {}}", + "type": "object" + } + ] + }, + "filename": "routes/api/travel.js", + "groupTitle": "Travel", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/travel/email/:email" + } + ] + }, + { + "type": "get", + "url": "/travel/:id", + "title": "get a traveler's information", + "name": "getTravel", + "group": "Travel", + "version": "2.0.1", + "parameter": { + "fields": { + "param": [ + { + "group": "param", + "type": "String", + "optional": false, + "field": "id", + "description": "

a travel's unique mongoID

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "String", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "Object", + "optional": false, + "field": "data", + "description": "

Travel object

" + } + ] + }, + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Successfully retrieved travel information\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"status\": \"Valid\",\n \"request\": 100,\n \"offer\": 50\n }\n }", + "type": "object" + } + ] + }, + "error": { + "fields": { + "Error 4xx": [ + { + "group": "Error 4xx", + "type": "String", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "Object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Travel not found\", \"data\": {}}", + "type": "object" + } + ] + }, + "filename": "routes/api/travel.js", + "groupTitle": "Travel", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/travel/:id" + } + ] + }, + { + "type": "patch", + "url": "/travel/offer/:id", + "title": "update a traveler's offer", + "name": "patchTravelOffer", + "group": "Travel", + "version": "2.0.1", + "parameter": { + "fields": { + "body": [ + { + "group": "body", + "type": "number", + "optional": true, + "field": "offer", + "description": "

Amount of money offered for travel

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

Travel object

" + } + ] + }, + "examples": [ + { + "title": "Success-Response:", + "content": "{\n \"message\": \"Changed travel information\",\n \"data\": {\n \"offer\": 75\n }\n}", + "type": "object" + } + ] + }, + "permission": [ + { + "name": "Administrator" + } + ], + "filename": "routes/api/travel.js", + "groupTitle": "Travel", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/travel/offer/:id" + } + ] + }, + { + "type": "patch", + "url": "/travel/status/:id", + "title": "update a traveler's status", + "name": "patchTravelStatus", + "group": "Travel", + "version": "2.0.1", + "parameter": { + "fields": { + "body": [ + { + "group": "body", + "type": "string", + "optional": true, + "field": "status", + "description": "

Status of the travel's reimbursement ("None"|"Bus"|"Offered"|"Valid"|"Invalid"|"Claimed")

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

Travel object

" + } + ] + }, + "examples": [ + { + "title": "Success-Response:", + "content": "{\n \"message\": \"Changed travel information\",\n \"data\": {\n \"status\": \"Accepted\"\n }\n}", + "type": "object" + } + ] + }, + "permission": [ + { + "name": "Administrator" + } + ], + "filename": "routes/api/travel.js", + "groupTitle": "Travel", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/travel/status/:id" + } + ] + }, + { + "type": "get", + "url": "/travel/self", + "title": "get information about own hacker's travel", + "name": "self", + "group": "Travel", + "version": "2.0.1", + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

Travel object

" + } + ] + }, + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Travel found by logged in account id\", \n \"data\": {\n \"id\":\"5bff4d736f86be0a41badb91\",\n \"status\": \"Claimed\"\n \"request\": 90,\n \"offer\": 80\n } \n }", + "type": "object" + } + ] + }, + "error": { + "fields": { + "Error 4xx": [ + { + "group": "Error 4xx", + "type": "string", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Travel not found\", \"data\": {}}", + "type": "object" + } + ] + }, + "filename": "routes/api/travel.js", + "groupTitle": "Travel", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/travel/self" + } + ] + }, + { + "type": "post", + "url": "/volunteer/", + "title": "create a new volunteer", + "name": "createVolunteer", + "group": "Volunteer", + "version": "0.0.8", + "parameter": { + "fields": { + "body": [ + { + "group": "body", + "type": "MongoID", + "optional": false, + "field": "accountId", + "description": "

MongoID of the account of the volunteer

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "object", + "optional": false, + "field": "data", + "description": "

Volunteer object

" + } + ] + }, + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Volunteer creation successful\", \n \"data\": {...}\n }", + "type": "object" + } + ] + }, + "error": { + "fields": { + "Error 4xx": [ + { + "group": "Error 4xx", + "type": "string", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Error while creating volunteer\", \"data\": {}}", + "type": "object" + } + ] + }, + "filename": "routes/api/volunteer.js", + "groupTitle": "Volunteer", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/volunteer/" + } + ] + }, + { + "type": "get", + "url": "/volunteer/:id", + "title": "get a volunteer's information", + "name": "getVolunteer", + "group": "Volunteer", + "version": "1.3.0", + "parameter": { + "fields": { + "param": [ + { + "group": "param", + "type": "ObjectId", + "optional": false, + "field": "id", + "description": "

a volunteer's unique mongoID

" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "String", + "optional": false, + "field": "message", + "description": "

Success message

" + }, + { + "group": "Success 200", + "type": "Object", + "optional": false, + "field": "data", + "description": "

Volunteer object

" + } + ] + }, + "examples": [ + { + "title": "Success-Response: ", + "content": "{\n \"message\": \"Successfully retrieved volunteer information\", \n \"data\": {...}\n }", + "type": "object" + } + ] + }, + "error": { + "fields": { + "Error 4xx": [ + { + "group": "Error 4xx", + "type": "String", + "optional": false, + "field": "message", + "description": "

Error message

" + }, + { + "group": "Error 4xx", + "type": "Object", + "optional": false, + "field": "data", + "description": "

empty

" + } + ] + }, + "examples": [ + { + "title": "Error-Response: ", + "content": "{\"message\": \"Volunteer not found\", \"data\": {}}", + "type": "object" + } + ] + }, + "filename": "routes/api/volunteer.js", + "groupTitle": "Volunteer", + "sampleRequest": [ + { + "url": "https://api.mchacks.ca/api/volunteer/:id" + } + ] + } +] diff --git a/middlewares/validators/hacker.validator.js b/middlewares/validators/hacker.validator.js index d23737c6..4d9b3b81 100644 --- a/middlewares/validators/hacker.validator.js +++ b/middlewares/validators/hacker.validator.js @@ -126,7 +126,10 @@ module.exports = { 100 ), VALIDATOR.mongoIdValidator("body", "application.team", true), - VALIDATOR.mongoIdValidator("body", "teamId", true) + VALIDATOR.stringValidator("body", "application.location.timeZone", true), + VALIDATOR.stringValidator("body", "application.location.country", true), + VALIDATOR.stringValidator("body", "application.location.city", true), + VALIDATOR.mongoIdValidator("body", "teamId", true), ], updateConfirmationValidator: [ @@ -253,7 +256,10 @@ module.exports = { 0, 100 ), - VALIDATOR.mongoIdValidator("body", "application.team", true) + VALIDATOR.mongoIdValidator("body", "application.team", true), + VALIDATOR.stringValidator("body", "application.location.timeZone", true), + VALIDATOR.stringValidator("body", "application.location.country", true), + VALIDATOR.stringValidator("body", "application.location.city", true), ], updateStatusValidator: [ VALIDATOR.enumValidator( diff --git a/models/hacker.model.js b/models/hacker.model.js index 8d46ba21..678570c1 100644 --- a/models/hacker.model.js +++ b/models/hacker.model.js @@ -131,12 +131,26 @@ const HackerSchema = new mongoose.Schema({ team: { type: mongoose.Schema.Types.ObjectId, ref: "Team" + }, + location: { + timeZone: { + type: String, + default: "" + }, + country: { + type: String, + default: "" + }, + city: { + type: String, + default: "" + } } }, teamId: { type: mongoose.Schema.Types.ObjectId, ref: "Team" - } + }, }); HackerSchema.methods.toJSON = function() { diff --git a/package.json b/package.json index 125efaef..8e8a9e91 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hackerAPI", - "version": "3.1.1", + "version": "3.1.2", "private": true, "scripts": { "start": "DEBUG=hackboard:* NODE_ENV=test nodemon --ignore gcp_creds.json ./bin/www.js", diff --git a/routes/api/hacker.js b/routes/api/hacker.js index c6d73598..7f801e3b 100644 --- a/routes/api/hacker.js +++ b/routes/api/hacker.js @@ -128,6 +128,11 @@ module.exports = { "accomodation": { "travel": 0 }, + "location": { + "timeZone": "GMT-5", + "country": "Canada", + "city": "Montreal" + } } * } @@ -171,6 +176,11 @@ module.exports = { "accomodation": { "travel": 0 }, + "location": { + "timeZone": "GMT-5", + "country": "Canada", + "city": "Montreal" + } } * } @@ -461,6 +471,11 @@ module.exports = { "accomodation": { "travel": 0 }, + "location": { + "timeZone": "GMT-5", + "country": "Canada", + "city": "Montreal" + } } } * @@ -504,6 +519,11 @@ module.exports = { "accomodation": { "travel": 0 }, + "location": { + "timeZone": "GMT-5", + "country": "Canada", + "city": "Montreal" + } } } * } @@ -576,6 +596,11 @@ module.exports = { "accomodation": { "travel": 0 }, + "location": { + "timeZone": "GMT-5", + "country": "Canada", + "city": "Montreal" + } } } } @@ -644,6 +669,11 @@ module.exports = { "accomodation": { "travel": 0 }, + "location": { + "timeZone": "GMT-5", + "country": "Canada", + "city": "Montreal" + } } } }