-
-
Notifications
You must be signed in to change notification settings - Fork 590
/
Copy pathopenapi.yaml
6116 lines (6074 loc) · 208 KB
/
openapi.yaml
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
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.0.2
servers:
- url: https://api.flat.io/v2
info:
contact:
email: developers@flat.io
name: Flat
url: https://flat.io/developers/docs/api/
description: |
The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following:
* Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files
* Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI)
* Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments.
The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body.
The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/).
This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/).
You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference).
Getting Started and learn more:
* [API Overview and introduction](https://flat.io/developers/docs/api/)
* [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html)
* [SDKs](https://flat.io/developers/docs/api/sdks.html)
* [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html)
* [Changelog](https://flat.io/developers/docs/api/changelog.html)
termsOfService: https://flat.io/legal
title: Flat API
version: 2.13.0
x-apisguru-categories:
- media
- collaboration
x-logo:
url: https://flat.io/img/logo-flat.svg
x-origin:
- format: openapi
url: https://raw.githubusercontent.com/FlatIO/api-reference/master/spec/swagger.yaml
version: "3.0"
x-providerName: flat.io
tags:
- description: |
These API endpoints are related to the Flat account you are currently using. When using an OAuth2 access token, you can use [`GET /me`](#operation/getAuthenticatedUser) to get information about the account.
name: Account
x-displayName: Flat Account
- description: |
Sheet music is the main API object type available for all Flat account.
Here is a typical lifecycle for a music score document on Flat:
- An end user can **create a music score** or **import a document** using our [web interface](https://flat.io) or a third-party website/app (e.g. Google Drive) using this API (see [`POST /v2/scores`](#operation/createScore). The creation and import of music scores can be done with this single API endpoint. This one currently supports the [MusicXML](http://www.musicxml.com/) (compressed or not) and [MIDI](https://www.midi.org/specifications).
- **List scores**:
- The **owned scores** can be listed using the [collections API methods](#tag/Collection), especially [`GET /collections/{collection}/scores`](#operation/listCollectionScores).
- The scores from a public account can be listed with [`GET /users/{user}/scores`](#operation/getUserScores).
- Scores shared with a specific group can be listed with [`GET /groups/{group}/scores`](#operation/getGroupScores).
- The metadata of a single score can be retrieved with [`GET /scores/{score}`](#operation/getScore).
- Scores on Flat have **one or multiple revisions**: creating a new score will create a first revision. These **revisions can be listed** using [`GET /scores/{score}/revisions`](#operation/getScoreRevisions) and a specific **revision data can be downloaded** with [`GET /scores/{score}/revisions/{revision}/{format}`](#operation/getScoreRevisionData). New revisions can be created using our [sheet music editor](https://flat.io) or using [`POST /scores/{score}/revisions`](#operation/createScoreRevision) (this endpoint has similar parameters than during the score creation). The last revision of a document may not directly reflect the really last version of a music score: recent modifications can be made offline or not yet consolidated into a new revision. In average, a new revision is created every 100 modifications made with our editor.
- Scores can be **shared publicly** by changing the privacy option with [`POST /scores/{score}`](#operation/editScore), or **individually shared** using the different collaborators API endpoints (see [`POST /scores/{score}/collaborators`](#operation/addScoreCollaborator)).
name: Score
x-displayName: Music scores
- description: |
Collections let you organize your content in a Flat account. They work like a regular _folder_ with some specificities:
- Our design goal here is to create a system similar to a _book_ or a _playlist of songs_.
- Collections can't have children collections (except the `trash` and `sharedWithMe` that are special collections).
- Any score can be added to one or multiple collections. For example, you can have a single private score in two or more collections, or add any public or shared scores to one of your collections.
All the collections don't have the same capabilities. Capabilities depend on the `type` of collection and the `rights` you have on a collection. They are available when [listing the collection](#operation/listCollections) or [retrieving the collection details](#operation/getCollection).
At this time, only `private` privacy mode is widely available. Privacy modes `public`, `organizationPublic` and `privateLink`, and 1:1 sharing will be available in an upcoming update later this year.
name: Collection
x-displayName: Collections of music scores
- description: Flat users
name: User
- description: Flat for Education organizations
name: Organization
- description: Flat for Education classes
name: Class
- description: Flat Groups
name: Group
paths:
/classes:
get:
operationId: listClasses
parameters:
- description: Filter the classes by state
in: query
name: state
schema:
default: active
enum:
- active
- inactive
- archived
type: string
responses:
"200":
content:
application/json:
schema:
items:
$ref: "#/components/schemas/ClassDetails"
type: array
description: The list of classes
default:
content:
application/json:
schema:
$ref: "#/components/schemas/FlatErrorResponse"
description: Error
security:
- OAuth2:
- edu.classes
- edu.classes.readonly
summary: List the classes available for the current user
tags:
- Class
post:
description: |
Classrooms on Flat allow you to create activities with assignments and post content to a specific group.
When creating a class, Flat automatically creates two groups: one for the teachers of the course, one for the students. The creator of this class is automatically added to the teachers group.
If the classsroom is synchronized with another application like Google Classroom, some of the meta information will automatically be updated.
You can add users to this class using `PUT /classes/{class}/users/{user}`, they will automatically added to the group based on their role on Flat. Users can also enroll themselves to this class using `POST /classes/enroll/{enrollmentCode}` and the `enrollmentCode` returned in the `ClassDetails` response.
operationId: createClass
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/ClassCreation"
required: true
responses:
"200":
content:
application/json:
schema:
$ref: "#/components/schemas/ClassDetails"
description: The new class details
"402":
content:
application/json:
schema:
$ref: "#/components/schemas/FlatErrorResponse"
description: Account overquota
default:
content:
application/json:
schema:
$ref: "#/components/schemas/FlatErrorResponse"
description: Error
security:
- OAuth2:
- edu.classes
summary: Create a new class
tags:
- Class
x-codegen-request-body-name: body
"/classes/enroll/{enrollmentCode}":
parameters:
- description: |
The enrollment code, available to the teacher in `ClassDetails`
in: path
name: enrollmentCode
required: true
schema:
type: string
post:
description: |
Use this method to join a class using an enrollment code given one of the teacher of this class. This code is also available in the `ClassDetails` returned to the teachers when creating the class or listing / fetching a specific class.
Flat will automatically add the user to the corresponding class group based on this role in the organization.
operationId: enrollClass
responses:
"200":
content:
application/json:
schema:
$ref: "#/components/schemas/ClassDetails"
description: The new class details
default:
content:
application/json:
schema:
$ref: "#/components/schemas/FlatErrorResponse"
description: Error
security:
- OAuth2:
- edu.classes
summary: Join a class
tags:
- Class
"/classes/{class}":
get:
operationId: getClass
responses:
"200":
content:
application/json:
schema:
$ref: "#/components/schemas/ClassDetails"
description: The new class details
default:
content:
application/json:
schema:
$ref: "#/components/schemas/FlatErrorResponse"
description: Error
security:
- OAuth2:
- edu.classes
- edu.classes.readonly
summary: Get the details of a single class
tags:
- Class
parameters:
- $ref: "#/components/parameters/class"
put:
description: |
Update the meta information of the class
operationId: updateClass
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/ClassUpdate"
description: Details of the Class
required: false
responses:
"200":
content:
application/json:
schema:
$ref: "#/components/schemas/ClassDetails"
description: The new class details
default:
content:
application/json:
schema:
$ref: "#/components/schemas/FlatErrorResponse"
description: Error
security:
- OAuth2:
- edu.classes
summary: Update the class
tags:
- Class
x-codegen-request-body-name: body
"/classes/{class}/activate":
parameters:
- $ref: "#/components/parameters/class"
post:
description: |
Mark the class as `active`. This is mainly used for classes synchronized from Clever that are initially with an `inactive` state and hidden in the UI.
operationId: activateClass
responses:
"200":
content:
application/json:
schema:
$ref: "#/components/schemas/ClassDetails"
description: The class details
default:
content:
application/json:
schema:
$ref: "#/components/schemas/FlatErrorResponse"
description: Error
security:
- OAuth2:
- edu.classes
summary: Activate the class
tags:
- Class
"/classes/{class}/archive":
delete:
description: |
Mark the class as `active`. When this course is synchronized with another app, like Google Classroom, this state will be automatically be updated.
operationId: unarchiveClass
responses:
"200":
content:
application/json:
schema:
$ref: "#/components/schemas/ClassDetails"
description: The class details
default:
content:
application/json:
schema:
$ref: "#/components/schemas/FlatErrorResponse"
description: Error
security:
- OAuth2:
- edu.classes
summary: Unarchive the class
tags:
- Class
parameters:
- $ref: "#/components/parameters/class"
post:
description: |
Mark the class as `archived`. When this course is synchronized with another app, like Google Classroom, this state will be automatically be updated.
operationId: archiveClass
responses:
"200":
content:
application/json:
schema:
$ref: "#/components/schemas/ClassDetails"
description: The class details
default:
content:
application/json:
schema:
$ref: "#/components/schemas/FlatErrorResponse"
description: Error
security:
- OAuth2:
- edu.classes
summary: Archive the class
tags:
- Class
"/classes/{class}/assignments":
get:
operationId: listAssignments
responses:
"200":
content:
application/json:
schema:
items:
$ref: "#/components/schemas/Assignment"
type: array
description: List of assignments for the class
default:
content:
application/json:
schema:
$ref: "#/components/schemas/FlatErrorResponse"
description: Error
security:
- OAuth2:
- edu.classes
- edu.classes.readonly
- edu.assignments
- edu.assignments.readonly
summary: Assignments listing
tags:
- Class
parameters:
- $ref: "#/components/parameters/class"
post:
description: |
Use this method as a teacher to create and post a new assignment to a class.
If the class is synchronized with Google Classroom, the assignment will be automatically posted to your Classroom course.
operationId: createAssignment
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/AssignmentCreation"
required: false
responses:
"200":
content:
application/json:
schema:
$ref: "#/components/schemas/Assignment"
description: The assignment has been created
default:
content:
application/json:
schema:
$ref: "#/components/schemas/FlatErrorResponse"
description: Error
security:
- OAuth2:
- edu.classes
- edu.assignments
summary: Assignment creation
tags:
- Class
x-codegen-request-body-name: body
"/classes/{class}/assignments/{assignment}/archive":
delete:
description: |
Mark the assignment as `active`.
operationId: unarchiveAssignment
responses:
"200":
content:
application/json:
schema:
$ref: "#/components/schemas/Assignment"
description: The assignment details
default:
content:
application/json:
schema:
$ref: "#/components/schemas/FlatErrorResponse"
description: Error
security:
- OAuth2:
- edu.classes
- edu.assignments
summary: Unarchive the assignment.
tags:
- Class
parameters:
- $ref: "#/components/parameters/class"
- $ref: "#/components/parameters/assignment"
post:
description: |
Archive the assignment
operationId: archiveAssignment
responses:
"200":
content:
application/json:
schema:
$ref: "#/components/schemas/Assignment"
description: The assignment details
default:
content:
application/json:
schema:
$ref: "#/components/schemas/FlatErrorResponse"
description: Error
security:
- OAuth2:
- edu.classes
- edu.assignments
summary: Archive the assignment
tags:
- Class
"/classes/{class}/assignments/{assignment}/copy":
parameters:
- $ref: "#/components/parameters/class"
- $ref: "#/components/parameters/assignment"
post:
description: |
Copy an assignment to a specified class.
If the original assignment has a due date in the past, this new assingment will be created without a due date.
If the new class is synchronized with an external app (e.g. Google Classroom), the copied assignment will also be posted on the external app.
operationId: copyAssignment
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/AssignmentCopy"
required: true
responses:
"200":
content:
application/json:
schema:
$ref: "#/components/schemas/Assignment"
description: The new created assingment
default:
content:
application/json:
schema:
$ref: "#/components/schemas/FlatErrorResponse"
description: Error
security:
- OAuth2:
- edu.classes
- edu.assignments
summary: Copy an assignment
tags:
- Class
x-codegen-request-body-name: body
"/classes/{class}/assignments/{assignment}/submissions":
get:
operationId: getSubmissions
responses:
"200":
content:
application/json:
schema:
items:
$ref: "#/components/schemas/AssignmentSubmission"
type: array
description: The submissions
default:
content:
application/json:
schema:
$ref: "#/components/schemas/FlatErrorResponse"
description: Error
security:
- OAuth2:
- edu.classes
- edu.classes.readonly
- edu.assignments
- edu.assignments.readonly
summary: List the students' submissions
tags:
- Class
parameters:
- $ref: "#/components/parameters/class"
- $ref: "#/components/parameters/assignment"
put:
description: |
Use this method as a student to create, update and submit a submission related to an assignment.
Students can only set `attachments` and `submit`.
Teachers can use `PUT /classes/{class}/assignments/{assignment}/submissions/{submission}` to update a submission by id.
operationId: createSubmission
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/AssignmentSubmissionUpdate"
required: true
responses:
"200":
content:
application/json:
schema:
$ref: "#/components/schemas/AssignmentSubmission"
description: The submission
default:
content:
application/json:
schema:
$ref: "#/components/schemas/FlatErrorResponse"
description: Error
security:
- OAuth2:
- edu.classes
- edu.assignments
summary: Create or edit a submission
tags:
- Class
x-codegen-request-body-name: body
"/classes/{class}/assignments/{assignment}/submissions/csv":
get:
description: Export list of submissions grades to a CSV file
operationId: exportSubmissionsReviewsAsCsv
responses:
"200":
content:
text/csv:
schema:
format: binary
type: string
description: List of submissions
default:
content:
text/csv:
schema:
$ref: "#/components/schemas/FlatErrorResponse"
description: Error
security:
- OAuth2:
- edu.classes
- edu.classes.readonly
- edu.assignments
- edu.assignments.readonly
summary: CSV Grades exports
tags:
- Class
parameters:
- $ref: "#/components/parameters/class"
- $ref: "#/components/parameters/assignment"
"/classes/{class}/assignments/{assignment}/submissions/excel":
get:
description: Export list of submissions grades to an Excel file
operationId: exportSubmissionsReviewsAsExcel
responses:
"200":
content:
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet:
schema:
format: binary
type: string
description: List of submissions
default:
content:
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet:
schema:
$ref: "#/components/schemas/FlatErrorResponse"
description: Error
security:
- OAuth2:
- edu.classes
- edu.classes.readonly
- edu.assignments
- edu.assignments.readonly
summary: Excel Grades exports
tags:
- Class
parameters:
- $ref: "#/components/parameters/class"
- $ref: "#/components/parameters/assignment"
"/classes/{class}/assignments/{assignment}/submissions/{submission}":
delete:
description: |
Use this method as a teacher to delete a submission and allow student to start over the assignment
operationId: deleteSubmission
parameters:
- $ref: "#/components/parameters/class"
- $ref: "#/components/parameters/assignment"
- $ref: "#/components/parameters/submission"
responses:
"204":
description: The submission has been deleted
default:
content:
application/json:
schema:
$ref: "#/components/schemas/FlatErrorResponse"
description: Error
security:
- OAuth2:
- edu.classes
- edu.assignments
summary: Delete a submission
tags:
- Class
x-codegen-request-body-name: body
get:
operationId: getSubmission
responses:
"200":
content:
application/json:
schema:
$ref: "#/components/schemas/AssignmentSubmission"
description: A submission
default:
content:
application/json:
schema:
$ref: "#/components/schemas/FlatErrorResponse"
description: Error
security:
- OAuth2:
- edu.classes
- edu.classes.readonly
- edu.assignments
- edu.assignments.readonly
summary: Get a student submission
tags:
- Class
parameters:
- $ref: "#/components/parameters/class"
- $ref: "#/components/parameters/assignment"
- $ref: "#/components/parameters/submission"
put:
description: |
Use this method as a teacher to update the different submission and give feedback.
Teachers can only set `return`, `draftGrade` and `grade`
operationId: editSubmission
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/AssignmentSubmissionUpdate"
required: true
responses:
"200":
content:
application/json:
schema:
$ref: "#/components/schemas/AssignmentSubmission"
description: The submission
default:
content:
application/json:
schema:
$ref: "#/components/schemas/FlatErrorResponse"
description: Error
security:
- OAuth2:
- edu.classes
- edu.assignments
summary: Edit a submission
tags:
- Class
x-codegen-request-body-name: body
"/classes/{class}/assignments/{assignment}/submissions/{submission}/comments":
get:
operationId: getSubmissionComments
responses:
"200":
content:
application/json:
schema:
items:
$ref: "#/components/schemas/AssignmentSubmissionComment"
type: array
description: The comments of the score
"403":
content:
application/json:
schema:
$ref: "#/components/schemas/FlatErrorResponse"
description: Not granted to access to this submission
"404":
content:
application/json:
schema:
$ref: "#/components/schemas/FlatErrorResponse"
description: Submission not found
default:
content:
application/json:
schema:
$ref: "#/components/schemas/FlatErrorResponse"
description: Error
security:
- OAuth2:
- edu.assignments
- edu.assignments.readonly
summary: List the feedback comments of a submission
tags:
- Class
parameters:
- $ref: "#/components/parameters/class"
- $ref: "#/components/parameters/assignment"
- $ref: "#/components/parameters/submission"
post:
operationId: postSubmissionComment
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/AssignmentSubmissionCommentCreation"
required: true
responses:
"200":
content:
application/json:
schema:
$ref: "#/components/schemas/AssignmentSubmissionComment"
description: The comment
"403":
content:
application/json:
schema:
$ref: "#/components/schemas/FlatErrorResponse"
description: Not granted to access to this submission
"404":
content:
application/json:
schema:
$ref: "#/components/schemas/FlatErrorResponse"
description: Submission not found
default:
content:
application/json:
schema:
$ref: "#/components/schemas/FlatErrorResponse"
description: Error
security:
- OAuth2:
- edu.assignments
summary: Add a feedback comment to a submission
tags:
- Class
"/classes/{class}/assignments/{assignment}/submissions/{submission}/comments/{comment}":
delete:
operationId: deleteSubmissionComment
responses:
"204":
description: The comment has been deleted
default:
content:
application/json:
schema:
$ref: "#/components/schemas/FlatErrorResponse"
description: Error
security:
- OAuth2:
- edu.assignments
summary: Delete a feedback comment to a submission
tags:
- Class
parameters:
- $ref: "#/components/parameters/class"
- $ref: "#/components/parameters/assignment"
- $ref: "#/components/parameters/submission"
- $ref: "#/components/parameters/comment"
put:
operationId: updateSubmissionComment
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/AssignmentSubmissionCommentCreation"
required: true
responses:
"200":
content:
application/json:
schema:
$ref: "#/components/schemas/AssignmentSubmissionComment"
description: The comment
"403":
content:
application/json:
schema:
$ref: "#/components/schemas/FlatErrorResponse"
description: Not granted to access to this submission
"404":
content:
application/json:
schema:
$ref: "#/components/schemas/FlatErrorResponse"
description: Submission not found
default:
content:
application/json:
schema:
$ref: "#/components/schemas/FlatErrorResponse"
description: Error
security:
- OAuth2:
- edu.assignments
summary: Update a feedback comment to a submission
tags:
- Class
"/classes/{class}/assignments/{assignment}/submissions/{submission}/history":
get:
description: |
For teachers only. Returns a detailed history of the submission. This currently includes state and grade histories.
operationId: getSubmissionHistory
responses:
"200":
content:
application/json:
schema:
items:
$ref: "#/components/schemas/AssignmentSubmissionHistory"
type: array
description: The history of the submission
"403":
content:
application/json:
schema:
$ref: "#/components/schemas/FlatErrorResponse"
description: Not granted to access to this submission
"404":
content:
application/json:
schema:
$ref: "#/components/schemas/FlatErrorResponse"
description: Submission not found
default:
content:
application/json:
schema:
$ref: "#/components/schemas/FlatErrorResponse"
description: Error
security:
- OAuth2:
- edu.assignments
- edu.assignments.readonly
summary: Get the history of the submission
tags:
- Class
parameters:
- $ref: "#/components/parameters/class"
- $ref: "#/components/parameters/assignment"
- $ref: "#/components/parameters/submission"
"/classes/{class}/students/{user}/submissions":
get:
description: |
Use this method as a teacher to list all the assignment submissions sent by a student of the class
operationId: listClassStudentSubmissions
responses:
"200":
content:
application/json:
schema:
items:
$ref: "#/components/schemas/AssignmentSubmission"
type: array
description: The list of submissions
default:
content:
application/json:
schema:
$ref: "#/components/schemas/FlatErrorResponse"
description: Error
security:
- OAuth2:
- edu.classes
- edu.classes.readonly
- edu.assignments
- edu.assignments.readonly
summary: List the submissions for a student
tags:
- Class
parameters:
- $ref: "#/components/parameters/class"
- description: Unique identifier of the user
in: path
name: user
required: true
schema:
type: string
"/classes/{class}/users/{user}":
delete:
description: |
This method can be used by a teacher to remove a user from the class, or by a student to leave the classroom.
Warning: Removing a user from the class will remove the associated resources, including the submissions and feedback related to these submissions.
operationId: deleteClassUser
responses:
"204":
description: The user has been removed from the class
default:
content:
application/json:
schema:
$ref: "#/components/schemas/FlatErrorResponse"
description: Error
security:
- OAuth2:
- edu.classes
summary: Remove a user from the class
tags:
- Class
parameters:
- $ref: "#/components/parameters/class"
- description: Unique identifier of the user
in: path
name: user
required: true
schema:
type: string
put:
description: |
This method can be used by a teacher of the class to enroll another Flat user into the class.
Only users that are part of your Organization can be enrolled in a class of this same Organization.
When enrolling a user in the class, Flat will automatically add this user to the corresponding Class group, based on this role in the Organization.
operationId: addClassUser
responses:
"204":
description: The user has been added to the class
default:
content:
application/json:
schema:
$ref: "#/components/schemas/FlatErrorResponse"
description: Error
security:
- OAuth2:
- edu.classes
summary: Add a user to the class
tags:
- Class
/collections:
get:
description: |
Use this method to list the user's collections contained in `parent` (by default in the `root` collection).
If no sort option is provided, the collections are sorted by `creationDate` `desc`.
Note that this method will not include the `parent` collection in the listing.
For example, if you need the details of the `root` collection, you can use `GET /v2/collections/root`.
operationId: listCollections
parameters:
- description: |
List the collection contained in this `parent` collection.
This option doesn't provide a complete multi-level collection support.
When sharing a collection with someone, this one will have as `parent` `sharedWithMe`.
in: query
name: parent
schema:
default: root
type: string
- description: Sort
in: query
name: sort
schema:
enum:
- creationDate
- title
type: string
- description: Sort direction
in: query
name: direction
schema:
enum:
- asc
- desc
type: string
- description: This is the maximum number of objects that may be returned
in: query
name: limit
schema:
default: 25