{ "item": [ { "id": "0c9cc69b-2459-4a81-a04d-9d996b0bc3c1", "name": "[PCP] Course Recommendations", "description": { "content": "", "type": "text/plain" }, "item": [ { "id": "1da49206-51b0-4069-b63e-59a04584db1c", "name": "Create Course Recommendations", "request": { "name": "Create Course Recommendations", "description": { "content": "(POST `/api/plan/recommendations/`)\n\nThis route will optionally take in current and past courses. In order to\nmake recommendations solely on the user's courses in past and current PCP schedules, simply\nomit both the curr_courses and past_courses fields in your request.\nOtherwise, in order to specify past and current courses,\ninclude a \"curr-courses\" and/or \"past_courses\" attribute in the request that should each contain\nan array of string course full codes of the form DEPT-XXX (e.g. CIS-120).\nIf successful, this route will return a list of recommended courses, with the same schema\nas the List Courses route, starting with the most relevant course. The number of\nrecommended courses returned can be specified using the n_recommendations attribute in the\nrequest body, but if this attribute is omitted, the default will be 5.\nIf n_recommendations is not an integer, or is <=0, a 400 will be returned.\nIf curr_courses contains repeated courses or invalid courses or non-current courses, a\n400 will be returned.\nIf past_courses contains repeated courses or invalid courses, a 400 will be returned.\nIf curr_courses and past_courses contain overlapping courses, a 400 will be returned.\n\nUser authentication required.", "type": "text/plain" }, "url": { "path": [ "api", "plan", "recommendations", "" ], "host": [ "{{baseUrl}}" ], "query": [], "variable": [] }, "header": [ { "key": "Content-Type", "value": "application/json" }, { "key": "Accept", "value": "application/json" } ], "method": "POST", "auth": null, "body": { "mode": "raw", "raw": "{\n \"curr_courses\": [\n \"\",\n \"\"\n ],\n \"past_courses\": [\n \"\",\n \"\"\n ],\n \"n_recommendations\": \"\"\n}", "options": { "raw": { "language": "json" } } } }, "response": [ { "id": "db4b996d-85ea-40ba-be0e-57eb42ca159f", "name": "Response returned successfully.", "originalRequest": { "url": { "path": [ "api", "plan", "recommendations", "" ], "host": [ "{{baseUrl}}" ], "query": [], "variable": [] }, "header": [ { "key": "Accept", "value": "application/json" } ], "method": "POST", "body": { "mode": "raw", "raw": "{\n \"curr_courses\": [\n \"\",\n \"\"\n ],\n \"past_courses\": [\n \"\",\n \"\"\n ],\n \"n_recommendations\": \"\"\n}", "options": { "raw": { "language": "json" } } } }, "status": "OK", "code": 200, "header": [ { "key": "Content-Type", "value": "application/json" } ], "body": "[\n {\n \"id\": \"string\",\n \"title\": \"string\",\n \"description\": \"string\",\n \"semester\": \"string\",\n \"num_sections\": 5422,\n \"course_quality\": 14.318,\n \"instructor_quality\": 13.206,\n \"difficulty\": 17.271,\n \"work_required\": 17.181,\n \"recommendation_score\": 7.9110000000000005,\n \"credits\": 63\n },\n {\n \"id\": \"string\",\n \"title\": \"string\",\n \"description\": \"string\",\n \"semester\": \"string\",\n \"num_sections\": 4509,\n \"course_quality\": 5.398,\n \"instructor_quality\": 2.045,\n \"difficulty\": 17.703,\n \"work_required\": 5.125,\n \"recommendation_score\": 5.688,\n \"credits\": 179.42000000000002\n }\n]", "cookie": [], "_postman_previewlanguage": "json" }, { "id": "7a71c730-dad0-4bed-aa3d-6ec6fb957f98", "name": "Invalid curr_courses, past_courses, or n_recommendations (see response).", "originalRequest": { "url": { "path": [ "api", "plan", "recommendations", "" ], "host": [ "{{baseUrl}}" ], "query": [], "variable": [] }, "method": "POST", "body": { "mode": "raw", "raw": "{\n \"curr_courses\": [\n \"\",\n \"\"\n ],\n \"past_courses\": [\n \"\",\n \"\"\n ],\n \"n_recommendations\": \"\"\n}", "options": { "raw": { "language": "json" } } } }, "status": "Bad Request", "code": 400, "header": [ { "key": "Content-Type", "value": "text/plain" } ], "body": "", "cookie": [], "_postman_previewlanguage": "text" }, { "id": "285a1e4e-0f47-47f2-b874-11510199ae41", "name": "Access denied (missing or improper authentication).", "originalRequest": { "url": { "path": [ "api", "plan", "recommendations", "" ], "host": [ "{{baseUrl}}" ], "query": [], "variable": [] }, "method": "POST", "body": { "mode": "raw", "raw": "{\n \"curr_courses\": [\n \"\",\n \"\"\n ],\n \"past_courses\": [\n \"\",\n \"\"\n ],\n \"n_recommendations\": \"\"\n}", "options": { "raw": { "language": "json" } } } }, "status": "Forbidden", "code": 403, "header": [ { "key": "Content-Type", "value": "text/plain" } ], "body": "", "cookie": [], "_postman_previewlanguage": "text" } ], "event": [], "protocolProfileBehavior": { "disableBodyPruning": true } } ], "event": [] } ], "event": [], "variable": [ { "type": "string", "value": "https://penncoursereview.com", "key": "baseUrl" } ], "info": { "_postman_id": "086b7191-8984-4b81-ab13-d6c4c6dcf502", "name": "Penn Courses API Documentation [Accounts] User [Accounts] User [PCP] Course Recommendations API", "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", "description": { "content": "\n# Introduction\nPenn Courses ([GitHub](https://github.com/pennlabs/penn-courses)) is the umbrella\ncategorization for [Penn Labs](https://pennlabs.org/)\nproducts designed to help students navigate the course registration process. It currently\nincludes three products, each with their own API documented on this page:\nPenn Course Alert, Penn Course Plan, and Penn Course Review.\n\nSee `Penn Labs Notion > Penn Courses` for more details on each of our (currently) three apps.\n\nFor instructions on how to maintain this documentation while writing code,\nsee the comments in `backend/PennCourses/docs_settings.py` (it is easy, and will be helpful\nfor maintaining Labs knowledge in spite of our high member turnover rate).\n\nSee our [GitHub](https://github.com/pennlabs/penn-courses) repo for instructions on\ninstallation, running in development, and loading in course data for development. Visit\nthe `/admin/doc/` route ([link](/admin/doc/)) for the backend documentation generated by Django\n(admin account required, which can be made by running\n`python manage.py createsuperuser` in terminal/CLI).\n\n# Unified Penn Courses\nBy virtue of the fact that all Penn Courses products deal with, well, courses,\nit would make sense for all three products to share the same backend.\n\nWe realized the necessity of a unified backend when attempting to design a new Django backend\nfor Penn Course Plan. We like to live by the philosophy of keeping it\n[DRY](https://en.wikipedia.org/wiki/Don't_repeat_yourself), and\nPCA and PCP's data models both need to reference course and\nsection information. We could have simply copied over code (a bad idea)\nor created a shared reusable Django app (a better idea) for course data,\nbut each app would still need to download copies of the same data.\nAdditionally, this will help us build integrations between our Courses products.\n\n# Authentication\nPCx user authentication is handled by platform's Penn Labs Accounts Engine.\nSee [Penn Labs Notion > Platform > The Accounts Engine](https://www.notion.so/pennlabs/The-Accounts-Engine-726ccf8875e244f4b8dbf8a8f2c97a87?pvs=4)\nfor extensive documentation and links to repositories for this system. When tags or routes\nare described as requiring user authentication, they are referring to this system.\n\nI highly recommend the [official video course on OAuth2](https://oauth.net/2/) (by Aaron Parecki),\nthen the Platform Notion docs on the \"Accounts Engine\" for anyone who wants to understand\nLabs authentication better. Platform is our OAuth2 \"Authorization Server\",\nand Django Labs Accounts is an OAuth2 client run by our Django backends (Clubs, Penn Courses, etc),\nexposing client-facing authentication routes like `penncourseplan.com/accounts/login`.\nThere's also this Wikipedia page explaining [Shibboleth](https://en.wikipedia.org/wiki/Shibboleth_(software))\n(which is used by Penn for authentication, and by the Platform authorization server).\n\nSee the Django docs for more on Django's features for\n[User Authentication](https://docs.djangoproject.com/en/3.0/topics/auth/),\nwhich are used by PCX apps, as part of Platform's accounts system.\n\n\nContact Support:\n Email: contact@pennlabs.org", "type": "text/plain" } } }