-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcanvas.http
80 lines (55 loc) · 1.76 KB
/
canvas.http
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
@baseUrl = https://{{canvasHost}}/api/v1
@allEnrollmentStates = &state[]=active&state[]=invited&state[]=creation_pending&state[]=deleted&state[]=rejected&state[]=completed&state[]=inactive
@allEnrollmentTypes = &type[]=StudentEnrollment&type[]=TeacherEnrollment&type[]=ObserverEnrollment&type[]=TaEnrollment
###
# @name getAccount
GET {{baseUrl}}/accounts/{{canvasAccountId}} HTTP/1.1
Authorization: Bearer {{canvasToken}}
###
# @name getUser
@userId = 1234
GET {{baseUrl}}/users/{{userId}}
Authorization: Bearer {{canvasToken}}
###
# @name getEnrollmentsByUser
GET {{baseUrl}}/users/{{userId}}/enrollments
?per_page=1000
{{allEnrollmentStates}}
{{allEnrollmentTypes}}
&sis_section_id[]=ENG3-123
Authorization: Bearer {{canvasToken}}
###
# @name deleteEnrollment
@courseId = 1234
@enrollmentId = 1234567
DELETE {{baseUrl}}/courses/{{courseId}}/enrollments/{{enrollmentId}}
?task=inactivate
Authorization: Bearer {{canvasToken}}
###
# @name getSection
@sectionId = sis_section_id:ENG3-123
GET {{baseUrl}}/sections/{{sectionId}}
Authorization: Bearer {{canvasToken}}
###
# @name getEnrollmentsBySection
GET {{baseUrl}}/sections/{{sectionId}}/enrollments
?per_page=1000
{{allEnrollmentStates}}
{{allEnrollmentTypes}}
Authorization: Bearer {{canvasToken}}
###
# @name getEnrollmentsBySection
GET {{baseUrl}}/sections/{{sectionId}}/enrollments/{{enrollmentId}}
Authorization: Bearer {{canvasToken}}
###
# @name updateEnrollment
POST {{baseUrl}}/sections/{{sectionId}}/enrollments
Authorization: Bearer {{canvasToken}}
Content-Type: application/x-www-form-urlencoded
enrollment[user_id]={{userId}}
&enrollment[type]=StudentEnrollment
&enrollment[enrollment_state]=active
&enrollment[notify]=false
&enrollment[start_at]=null
&enrollment[end_at]=null
}