diff --git a/docs/endpoints/calendar_endpoint.md b/docs/endpoints/calendar_endpoint.md index b525bd8..34704cc 100644 --- a/docs/endpoints/calendar_endpoint.md +++ b/docs/endpoints/calendar_endpoint.md @@ -1,15 +1,14 @@ -## Endpoints +## Calendar Endpoints ### Overview - +This API interacts with the CSH Google calendar to pull the number of events set in the .env file to display in the calendar widget on Jumpstart --- ### Authentication -This API does **not** implement authentication by default. -If you deploy in production, you should secure the API (e.g., with a reverse proxy, network policy, or FastAPI dependencies). +The API we are using does not require authenication. It just needs the Public URL of the calendar. This can be any calendar for testing purposes. --- @@ -21,7 +20,7 @@ If you deploy in production, you should secure the API (e.g., with a reverse pro Example error response: ```json { - "error": "Vault is sealed, cannot store credentials." + "error": "Failed to fetch the Calendar!" } ``` diff --git a/docs/endpoints/wikithoughts.md b/docs/endpoints/wikithoughts.md index 15483c2..fb48abd 100644 --- a/docs/endpoints/wikithoughts.md +++ b/docs/endpoints/wikithoughts.md @@ -1,3 +1,21 @@ +## Wiki Thoughts Endpoints +### Overview + +This is a builtin API from MediaWiki and allows us to pull sections from the Wiki that are formatted in a certain way. See Wiki Thoughts Core for more info. + +### Authentication + +The MediaWiki API requires authentication in the form of a bot user. Credentials can be made [here](https://wiki.csh.rit.edu/wiki/Special:BotPasswords). You will also have to specify a category to pull from the Wiki, which for jumpstart is "Jumpstart Curated". + +### Error Handling + +In the event of an Error, the API will log an error and display default text + +```json +{ + "WARNING": "508 Bot is not authenticated, cancelling fetch of category pages" +} +``` ::: api.endpoints.wikithought \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index 436b931..6163132 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -38,15 +38,15 @@ use_directory_urls: false nav: - Home: index.md - Getting Started: getting-started/getting-started.md + - Core: + - Wikithoughts: core/Wiki-thoughts.md + - Calendar: core/CSH Calendar.md + - Slack: core/Slack.md - Endpoints: - Calendar: endpoints/calendar_endpoint.md - Announcements: endpoints/announcements.md - Slack Bot: endpoints/slack_bot.md - Wiki Thoughts: endpoints/wikithoughts.md - - Core: - - Calendar: core/CSH Calendar.md - - Slack: core/Slack.md - - Wikithoughts: core/Wiki-thoughts.md - Scripts: - Setup: getting-started/setup.md diff --git a/src/api/endpoints.py b/src/api/endpoints.py index 373ebd0..cd7fe80 100644 --- a/src/api/endpoints.py +++ b/src/api/endpoints.py @@ -98,7 +98,9 @@ async def message_actions(payload: str = Form(...)) -> JSONResponse: """ try: + logger.info(f"Received payload: {payload}") form_json: dict = json.loads(payload) + logger.info(f"Parsed form_json: {form_json}") response_url = form_json.get("response_url") if form_json.get("type") != "block_actions":