-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.http
More file actions
116 lines (86 loc) · 3.23 KB
/
test.http
File metadata and controls
116 lines (86 loc) · 3.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
// THIS FILE TESTS THE API ENDPOINTS (USES THE VSCODE EXTENSION "REST CLIENT" TO TEST THE API)
// UPDATE THE API KEYS TO THE ONES GENERATED BY THE API (API-KEY IN .ENV FILE)
@baseUrl = http://localhost:8080
@apiKey = {{$dotenv API_KEY}}
### ============================================
### HEALTH CHECK (No Auth Required)
### ============================================
### Health Check
GET {{baseUrl}}/health
### ============================================
### ADMIN ENDPOINTS (Admin Key Required)
### ============================================
### Create API Key
POST {{baseUrl}}/admin/apikeys
X-API-Key: {{apiKey}}
Content-Type: application/json
{
"rate_limit": 100,
"window_seconds": 60,
"is_admin": false,
"expires_at": "2025-12-31T23:59:59Z"
}
### Get API Key Information
GET {{baseUrl}}/admin/apikeys/{{apiKey}}
X-API-Key: {{apiKey}}
### ============================================
### COURSE ENDPOINTS
### ============================================
### Get All Courses by Term (Fall 2024)
GET {{baseUrl}}/api/v1/courses/24f
X-API-Key: {{apiKey}}
### Get All Courses by Term (Spring 2025)
GET {{baseUrl}}/api/v1/courses/25s
X-API-Key: {{apiKey}}
### Get Courses by Term with Prefix Filter (CS)
GET {{baseUrl}}/api/v1/courses/24f?prefix=cs
X-API-Key: {{apiKey}}
### Get Courses by Term with Prefix and Number Filter (CS 1337)
GET {{baseUrl}}/api/v1/courses/24f?prefix=cs&number=1337
X-API-Key: {{apiKey}}
### Get Courses by Prefix (CS)
GET {{baseUrl}}/api/v1/courses/24f/prefix/cs
X-API-Key: {{apiKey}}
### Get Courses by Prefix (MATH)
GET {{baseUrl}}/api/v1/courses/24f/prefix/math
X-API-Key: {{apiKey}}
### Get Courses by Prefix and Number (CS 1337)
GET {{baseUrl}}/api/v1/courses/24f/prefix/cs/number/1337
X-API-Key: {{apiKey}}
### Get Courses by Prefix and Number (MATH 2413)
GET {{baseUrl}}/api/v1/courses/24f/prefix/math/number/2413
X-API-Key: {{apiKey}}
### Search Courses by Query (Computer Science)
GET {{baseUrl}}/api/v1/courses/24f/search?q=Computer Science
X-API-Key: {{apiKey}}
### Search Courses by Query (Data Structures)
GET {{baseUrl}}/api/v1/courses/24f/search?q=Data Structures
X-API-Key: {{apiKey}}
### ============================================
### PROFESSOR ENDPOINTS
### ============================================
### Get Professor by Name (Anani Komla Adabrah)
GET {{baseUrl}}/api/v1/professors/name/anani komla adabrah
X-API-Key: {{apiKey}}
### Get Professor by ID (example - update with actual ID)
GET {{baseUrl}}/api/v1/professors/id/aaa130530
X-API-Key: {{apiKey}}
### ============================================
### GRADE ENDPOINTS
### ============================================
### Get Grades by Professor ID (update ID as needed)
GET {{baseUrl}}/api/v1/grades/prof/id/ewb160130
X-API-Key: {{apiKey}}
### Get Grades by Professor Name (update name as needed)
GET {{baseUrl}}/api/v1/grades/prof/name/eric becker
X-API-Key: {{apiKey}}
### Get Grades by Prefix (update prefix as needed)
GET {{baseUrl}}/api/v1/grades/prefix/cs
X-API-Key: {{apiKey}}
### Get Grades by Prefix and Number (update values as needed)
GET {{baseUrl}}/api/v1/grades/prefix/cs/number/1337
X-API-Key: {{apiKey}}
### Get Grades by Prefix and Term (update values as needed)
GET {{baseUrl}}/api/v1/grades/prefix/cs/term/24f
X-API-Key: {{apiKey}}
###