{ "item": [ { "id": "19e5656c-08ba-42bb-baac-61bbe17e8cbb", "name": "[Accounts] User", "description": { "content": "\nThese routes allow interaction with the User object of a Penn Labs Accounts user.\nWe do not document `/accounts/...` authentication routes here, as they are described\nby the [Authentication](#section/Authentication) section, and the\n[Penn Labs Account Engine](https://www.notion.so/pennlabs/The-Accounts-Engine-726ccf8875e244f4b8dbf8a8f2c97a87?pvs=4)\nNotion page.\n", "type": "text/plain" }, "item": [ { "id": "a41f859b-d523-49d2-8c54-36cb57449752", "name": "Retrieve User", "request": { "name": "Retrieve User", "description": { "content": "(GET `/accounts/me/`)\n\nThis view exposes the Penn Labs Accounts User object.\n\nUser authentication required.", "type": "text/plain" }, "url": { "path": [ "accounts", "me", "" ], "host": [ "{{baseUrl}}" ], "query": [], "variable": [] }, "header": [ { "key": "Accept", "value": "application/json" } ], "method": "GET", "auth": null }, "response": [ { "id": "6684ae50-c3a4-470a-b178-8b50e1b1f987", "originalRequest": { "url": { "path": [ "accounts", "me", "" ], "host": [ "{{baseUrl}}" ], "query": [], "variable": [] }, "header": [ { "key": "Accept", "value": "application/json" } ], "method": "GET", "body": {} }, "status": "OK", "code": 200, "header": [ { "key": "Content-Type", "value": "application/json" } ], "body": "{\n \"username\": \"string\",\n \"first_name\": \"string\",\n \"last_name\": \"string\",\n \"profile\": {\n \"email\": \"dSfifYlkpN@jxlrH.fn\",\n \"phone\": \"string\",\n \"push_notifications\": false\n }\n}", "cookie": [], "_postman_previewlanguage": "json" }, { "id": "361ffaf0-8132-4953-b809-1f53a01689ee", "name": "Access denied (missing or improper authentication).", "originalRequest": { "url": { "path": [ "accounts", "me", "" ], "host": [ "{{baseUrl}}" ], "query": [], "variable": [] }, "method": "GET", "body": {} }, "status": "Forbidden", "code": 403, "header": [ { "key": "Content-Type", "value": "text/plain" } ], "body": "", "cookie": [], "_postman_previewlanguage": "text" } ], "event": [], "protocolProfileBehavior": { "disableBodyPruning": true } }, { "id": "911aa926-622c-4ae4-bb62-6ceec4a510d3", "name": "Update User", "request": { "name": "Update User", "description": { "content": "(PUT `/accounts/me/`)\n\nThis view exposes the Penn Labs Accounts User object.\n\nUser authentication required.", "type": "text/plain" }, "url": { "path": [ "accounts", "me", "" ], "host": [ "{{baseUrl}}" ], "query": [], "variable": [] }, "header": [ { "key": "Content-Type", "value": "application/json" }, { "key": "Accept", "value": "application/json" } ], "method": "PUT", "auth": null, "body": { "mode": "raw", "raw": "{\n \"first_name\": \"\",\n \"last_name\": \"\",\n \"profile\": {\n \"email\": \"\",\n \"phone\": \"\",\n \"push_notifications\": \"\"\n }\n}", "options": { "raw": { "language": "json" } } } }, "response": [ { "id": "10717845-16d1-45c6-95ff-c11fd8bdeddd", "originalRequest": { "url": { "path": [ "accounts", "me", "" ], "host": [ "{{baseUrl}}" ], "query": [], "variable": [] }, "header": [ { "key": "Accept", "value": "application/json" } ], "method": "PUT", "body": { "mode": "raw", "raw": "{\n \"first_name\": \"\",\n \"last_name\": \"\",\n \"profile\": {\n \"email\": \"\",\n \"phone\": \"\",\n \"push_notifications\": \"\"\n }\n}", "options": { "raw": { "language": "json" } } } }, "status": "OK", "code": 200, "header": [ { "key": "Content-Type", "value": "application/json" } ], "body": "{\n \"username\": \"string\",\n \"first_name\": \"string\",\n \"last_name\": \"string\",\n \"profile\": {\n \"email\": \"dSfifYlkpN@jxlrH.fn\",\n \"phone\": \"string\",\n \"push_notifications\": false\n }\n}", "cookie": [], "_postman_previewlanguage": "json" }, { "id": "ea252cbd-f61b-4c61-aca1-6cf1b84b568d", "name": "Access denied (missing or improper authentication).", "originalRequest": { "url": { "path": [ "accounts", "me", "" ], "host": [ "{{baseUrl}}" ], "query": [], "variable": [] }, "method": "PUT", "body": { "mode": "raw", "raw": "{\n \"first_name\": \"\",\n \"last_name\": \"\",\n \"profile\": {\n \"email\": \"\",\n \"phone\": \"\",\n \"push_notifications\": \"\"\n }\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 } }, { "id": "02afdac0-f268-4583-a63a-09a3b75590f4", "name": "Partial Update User", "request": { "name": "Partial Update User", "description": { "content": "(PATCH `/accounts/me/`)\n\nThis view exposes the Penn Labs Accounts User object.\n\nUser authentication required.", "type": "text/plain" }, "url": { "path": [ "accounts", "me", "" ], "host": [ "{{baseUrl}}" ], "query": [], "variable": [] }, "header": [ { "key": "Content-Type", "value": "application/json" }, { "key": "Accept", "value": "application/json" } ], "method": "PATCH", "auth": null, "body": { "mode": "raw", "raw": "{\n \"first_name\": \"\",\n \"last_name\": \"\",\n \"profile\": {\n \"email\": \"\",\n \"phone\": \"\",\n \"push_notifications\": \"\"\n }\n}", "options": { "raw": { "language": "json" } } } }, "response": [ { "id": "f8ca60d3-aed1-450e-9ca7-def11e8195f7", "originalRequest": { "url": { "path": [ "accounts", "me", "" ], "host": [ "{{baseUrl}}" ], "query": [], "variable": [] }, "header": [ { "key": "Accept", "value": "application/json" } ], "method": "PATCH", "body": { "mode": "raw", "raw": "{\n \"first_name\": \"\",\n \"last_name\": \"\",\n \"profile\": {\n \"email\": \"\",\n \"phone\": \"\",\n \"push_notifications\": \"\"\n }\n}", "options": { "raw": { "language": "json" } } } }, "status": "OK", "code": 200, "header": [ { "key": "Content-Type", "value": "application/json" } ], "body": "{\n \"username\": \"string\",\n \"first_name\": \"string\",\n \"last_name\": \"string\",\n \"profile\": {\n \"email\": \"dSfifYlkpN@jxlrH.fn\",\n \"phone\": \"string\",\n \"push_notifications\": false\n }\n}", "cookie": [], "_postman_previewlanguage": "json" }, { "id": "c24d812c-b52a-468c-bc04-b9aa9e53635e", "name": "Access denied (missing or improper authentication).", "originalRequest": { "url": { "path": [ "accounts", "me", "" ], "host": [ "{{baseUrl}}" ], "query": [], "variable": [] }, "method": "PATCH", "body": { "mode": "raw", "raw": "{\n \"first_name\": \"\",\n \"last_name\": \"\",\n \"profile\": {\n \"email\": \"\",\n \"phone\": \"\",\n \"push_notifications\": \"\"\n }\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": "98e74c7b-a573-4068-b8d7-887e3814f317", "name": "Penn Courses API Documentation [Accounts] User [Accounts] User [Accounts] User 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" } } }