-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCanvas_API_Postman_Collection.json
More file actions
258 lines (258 loc) · 7.55 KB
/
Canvas_API_Postman_Collection.json
File metadata and controls
258 lines (258 loc) · 7.55 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
{
"info": {
"_postman_id": "canvas-api-collection-001",
"name": "Canvas LMS API - BookAPI",
"description": "Collection for testing Canvas LMS integration endpoints",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "Get All Courses",
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "http://localhost:3000/courses",
"protocol": "http",
"host": [
"localhost"
],
"port": "3000",
"path": [
"courses"
]
},
"description": "Fetches all active courses from your Canvas account. Returns course details including ID, name, course code, and enrollment information."
},
"response": [
{
"name": "Success Response Example",
"originalRequest": {
"method": "GET",
"header": [],
"url": {
"raw": "http://localhost:3000/courses",
"protocol": "http",
"host": [
"localhost"
],
"port": "3000",
"path": [
"courses"
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"cookie": [],
"body": "{\n \"success\": true,\n \"count\": 3,\n \"data\": [\n {\n \"id\": 12345,\n \"name\": \"Introduction to Computer Science\",\n \"course_code\": \"CS101\",\n \"enrollment_term_id\": 1,\n \"workflow_state\": \"available\",\n \"start_at\": \"2025-01-15T00:00:00Z\",\n \"end_at\": \"2025-05-15T23:59:59Z\"\n },\n {\n \"id\": 12346,\n \"name\": \"Data Structures\",\n \"course_code\": \"CS201\",\n \"enrollment_term_id\": 1,\n \"workflow_state\": \"available\",\n \"start_at\": \"2025-01-15T00:00:00Z\",\n \"end_at\": \"2025-05-15T23:59:59Z\"\n },\n {\n \"id\": 12347,\n \"name\": \"Web Development\",\n \"course_code\": \"WEB301\",\n \"enrollment_term_id\": 1,\n \"workflow_state\": \"available\",\n \"start_at\": \"2025-01-15T00:00:00Z\",\n \"end_at\": \"2025-05-15T23:59:59Z\"\n }\n ]\n}"
}
]
},
{
"name": "Get Grades for Course",
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "http://localhost:3000/grades/:courseId",
"protocol": "http",
"host": [
"localhost"
],
"port": "3000",
"path": [
"grades",
":courseId"
],
"variable": [
{
"key": "courseId",
"value": "12345",
"description": "The Canvas course ID (get this from /courses endpoint)"
}
]
},
"description": "Fetches grades for all students enrolled in a specific course. Replace :courseId with an actual course ID from your Canvas account."
},
"response": [
{
"name": "Success Response Example",
"originalRequest": {
"method": "GET",
"header": [],
"url": {
"raw": "http://localhost:3000/grades/12345",
"protocol": "http",
"host": [
"localhost"
],
"port": "3000",
"path": [
"grades",
"12345"
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"cookie": [],
"body": "{\n \"success\": true,\n \"course_id\": \"12345\",\n \"count\": 2,\n \"data\": [\n {\n \"user_id\": 67890,\n \"user_name\": \"John Doe\",\n \"course_id\": 12345,\n \"current_grade\": \"A\",\n \"current_score\": 95.5,\n \"final_grade\": \"A\",\n \"final_score\": 95.5,\n \"enrollment_state\": \"active\"\n },\n {\n \"user_id\": 67891,\n \"user_name\": \"Jane Smith\",\n \"course_id\": 12345,\n \"current_grade\": \"B+\",\n \"current_score\": 87.3,\n \"final_grade\": \"B+\",\n \"final_score\": 87.3,\n \"enrollment_state\": \"active\"\n }\n ]\n}"
},
{
"name": "Error - Missing Course ID",
"originalRequest": {
"method": "GET",
"header": [],
"url": {
"raw": "http://localhost:3000/grades/",
"protocol": "http",
"host": [
"localhost"
],
"port": "3000",
"path": [
"grades",
""
]
}
},
"status": "Bad Request",
"code": 400,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"cookie": [],
"body": "{\n \"success\": false,\n \"error\": \"Course ID is required\"\n}"
}
]
},
{
"name": "Get Grades - Example with Different Course",
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "http://localhost:3000/grades/:courseId",
"protocol": "http",
"host": [
"localhost"
],
"port": "3000",
"path": [
"grades",
":courseId"
],
"variable": [
{
"key": "courseId",
"value": "67890",
"description": "Another example course ID"
}
]
},
"description": "Another example showing how to get grades for a different course. Simply change the courseId parameter."
},
"response": []
},
{
"name": "Ask AI",
"request": {
"method": "POST",
"header": [
{ "key": "Content-Type", "value": "application/json" }
],
"body": {
"mode": "raw",
"raw": "{\n \"prompt\": \"Say hello from AI, and continue with a helpful greeting to the user explaining what you can do.\",\n \"max_tokens\": 256,\n \"temperature\": 0.2\n}"
},
"url": {
"raw": "{{baseUrl}}/ai/ask",
"host": [
"{{baseUrl}}"
],
"path": [
"ai",
"ask"
]
},
"description": "Send a prompt to the AI model and receive a text response. Requires @langchain/openai and OPENAI_API_KEY in backend/.env."
},
"response": [
{
"name": "Success Response Example",
"originalRequest": {
"method": "POST",
"header": [ { "key": "Content-Type", "value": "application/json" } ],
"body": { "mode": "raw", "raw": "{\n \"prompt\": \"Say hello from AI\"\n}" },
"url": { "raw": "{{baseUrl}}/ai/ask" }
},
"status": "OK",
"code": 200,
"header": [ { "key": "Content-Type", "value": "application/json" } ],
"cookie": [],
"body": "{\n \"success\": true,\n \"text\": \"Hello from AI!\"\n}"
},
{
"name": "Error - Missing Prompt",
"originalRequest": {
"method": "POST",
"header": [ { "key": "Content-Type", "value": "application/json" } ],
"body": { "mode": "raw", "raw": "{}" },
"url": { "raw": "{{baseUrl}}/ai/ask" }
},
"status": "Bad Request",
"code": 400,
"header": [ { "key": "Content-Type", "value": "application/json" } ],
"cookie": [],
"body": "{\n \"success\": false,\n \"error\": \"Missing prompt\"\n}"
}
]
}
],
"event": [
{
"listen": "prerequest",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
},
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
}
],
"variable": [
{
"key": "baseUrl",
"value": "http://localhost:3000",
"type": "string"
}
]
}