|
1 | 1 | ---
|
2 | 2 | title: Calendar
|
| 3 | +full: true |
| 4 | +_openapi: |
| 5 | + toc: |
| 6 | + - depth: 2 |
| 7 | + title: Retrieve term calendar |
| 8 | + url: "#retrieve-term-calendar" |
| 9 | + - depth: 2 |
| 10 | + title: List all calendars |
| 11 | + url: "#list-all-calendars" |
| 12 | + - depth: 2 |
| 13 | + title: Retrieve current week |
| 14 | + url: "#retrieve-current-week" |
| 15 | + structuredData: |
| 16 | + headings: |
| 17 | + - content: Retrieve term calendar |
| 18 | + id: retrieve-term-calendar |
| 19 | + - content: List all calendars |
| 20 | + id: list-all-calendars |
| 21 | + - content: Retrieve current week |
| 22 | + id: retrieve-current-week |
| 23 | + contents: |
| 24 | + - content: Retrieves key dates for the provided term. |
| 25 | + heading: retrieve-term-calendar |
| 26 | + - content: Retrieves all data for all terms that are currently available. |
| 27 | + heading: list-all-calendars |
| 28 | + - content: >- |
| 29 | + Retrieves week data for the provided date, or today if one is not |
| 30 | + provided. |
| 31 | + heading: retrieve-current-week |
3 | 32 | ---
|
4 | 33 |
|
5 |
| -import { Tabs, Tab } from "fumadocs-ui/components/tabs"; |
6 |
| - |
7 |
| -The calendar endpoint allows users to fetch important dates for the given quarter, such as when instruction begins and ends, and when final exams begin and end. |
8 |
| - |
9 |
| -## Query parameters |
10 |
| - |
11 |
| -#### `year` string <span style={{ color: "#ff86b4" }}>Required</span> |
12 |
| - |
13 |
| -The year to query. |
14 |
| - |
15 |
| -#### `quarter` Fall | Winter | Spring | Summer1 | Summer10wk | Summer2 <span style={{ color: "#ff86b4" }}>Required</span> |
16 |
| - |
17 |
| -The quarter to query. Case-sensitive. |
18 |
| - |
19 |
| -<Tabs items={["cURL"]}> |
20 |
| - <Tab value="cURL"> |
21 |
| - ```bash curl |
22 |
| - "https://api-next.peterportal.org/v1/rest/calendar?year=2023&quarter=Spring" |
23 |
| - ``` |
24 |
| - </Tab> |
25 |
| -</Tabs> |
26 |
| - |
27 |
| -### Response |
28 |
| - |
29 |
| -<Tabs items={['Example response', "Payload schema"]}> |
30 |
| - <Tab value='Example response'> |
31 |
| - ```json |
32 |
| - { |
33 |
| - "instructionStart": "2023-04-03T00:00:00.000Z", |
34 |
| - "instructionEnd": "2023-06-09T00:00:00.000Z", |
35 |
| - "finalsStart": "2023-06-10T00:00:00.000Z", |
36 |
| - "finalsEnd": "2023-06-15T00:00:00.000Z" |
37 |
| - } |
38 |
| - ``` |
39 |
| - </Tab> |
40 |
| - <Tab value='Payload schema'> |
41 |
| - ```typescript |
42 |
| - // https://github.com/icssc/peterportal-api-next/blob/main/packages/peterportal-api-next-types/types/calendar.ts |
43 |
| - type QuarterDates = { |
44 |
| - instructionStart: string; |
45 |
| - instructionEnd: string; |
46 |
| - finalsStart: string; |
47 |
| - finalsEnd: string; |
48 |
| - }; |
49 |
| - ``` |
50 |
| - </Tab> |
51 |
| -</Tabs> |
| 34 | +<APIPage |
| 35 | + document={"https://anteaterapi.com/openapi.json"} |
| 36 | + operations={[ |
| 37 | + { method: "get", path: "/v2/rest/calendar" }, |
| 38 | + { method: "get", path: "/v2/rest/calendar/all" }, |
| 39 | + { method: "get", path: "/v2/rest/week" }, |
| 40 | + ]} |
| 41 | + hasHead={true} |
| 42 | +/> |
0 commit comments