Skip to content

Commit 3dd6a24

Browse files
committed
feat(api): API specification v2.10
* feat(edu): `POST /v2/organizations/users` now accepts optional `firstname` and `lastname` * update(edu): `GET /v2/organizations/users` now accepts sort options and filters * feat(edu): added `GET /v2/organizations/users/count` to count users matching specified filters * feat(edu): removed deprecated `role` property from `POST /organizations/invitations` (previously renamed to `organizationRole`) * feat(assignments): added `POST/DELETE /v2/classes/{class}/assignments/{assignment}/archive` to archive/unarchive assignments * feat(assignments): returned assignments object from `GET /v2/classes/{class}/assignments/{assignment}` now includes the main type of the assignment: `newScore`, `scoreTemplare` or `sharedWriting`. * feat(edu): users returned by `GET /v2/groups/{group}/users` can now be filtered by the sync source: `googleClassroom`, `microsoftGraph` or `clever`. * feat(scores): scores details returned by `GET /v2/scores/{score}` (and similar) now includes the audio samples list used by our playback. The `instruments` property now includes a normalized list of instruments that is not dependent from the samples used.
1 parent ec5afd7 commit 3dd6a24

File tree

1 file changed

+200
-27
lines changed

1 file changed

+200
-27
lines changed

Diff for: spec/swagger.yaml

+200-27
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ info:
3333
name: Flat
3434
url: https://flat.io/developers/docs/api/
3535
36-
version: 2.9.0
36+
version: 2.10.0
3737
x-logo:
3838
url: https://flat.io/img/logo-flat.svg
3939
servers:
@@ -401,6 +401,7 @@ paths:
401401
post:
402402
tags:
403403
- Score
404+
- Class
404405
summary: Fork a score
405406
description: |
406407
This API call will make a copy of the last revision of the specified score and create a new score. The copy of the score will have a privacy set to `private`.
@@ -1311,6 +1312,7 @@ paths:
13111312
- OAuth2:
13121313
- scores.social
13131314
- scores
1315+
13141316
/scores/{score}/revisions:
13151317
get:
13161318
tags:
@@ -2240,37 +2242,41 @@ paths:
22402242
summary: List the organization users
22412243
operationId: listOrganizationUsers
22422244
parameters:
2243-
- name: role
2245+
- name: sort
22442246
in: query
2245-
description: Filter users by role
2247+
description: The order to sort the user list
22462248
schema:
22472249
type: string
2248-
enum:
2249-
- user
2250-
- teacher
2251-
- admin
2250+
items:
2251+
type: string
2252+
enum:
2253+
- firstname
2254+
- lastname
2255+
- lastActivityDate
2256+
- licenseExpirationDate
2257+
- $ref: '#/components/parameters/sortDirection'
2258+
- $ref: '#/components/parameters/limit'
2259+
- $ref: '#/components/parameters/next'
2260+
- $ref: '#/components/parameters/previous'
2261+
- $ref: '#/components/parameters/role'
2262+
- $ref: '#/components/parameters/searchInputQuery'
2263+
- $ref: '#/components/parameters/groupIds'
2264+
- $ref: '#/components/parameters/noActiveLicense'
2265+
- name: licenseExpirationDate
2266+
in: query
2267+
description: Filter users by license expiration date
2268+
schema:
2269+
type: array
2270+
items:
2271+
type: string
22522272
- name: limit
22532273
in: query
22542274
description: This is the maximum number of objects that may be returned
22552275
schema:
22562276
maximum: 1000
22572277
minimum: 1
22582278
type: integer
2259-
default: 50
2260-
- name: next
2261-
in: query
2262-
description: |
2263-
An opaque string cursor to fetch the next page of data.
2264-
The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data.
2265-
schema:
2266-
type: string
2267-
- name: previous
2268-
in: query
2269-
description: |
2270-
An opaque string cursor to fetch the previous page of data.
2271-
The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data.
2272-
schema:
2273-
type: string
2279+
default: 25
22742280
responses:
22752281
200:
22762282
description: List of users
@@ -2320,6 +2326,37 @@ paths:
23202326
- edu.admin
23212327
- edu.admin.users
23222328
x-codegen-request-body-name: body
2329+
/organizations/users/count:
2330+
get:
2331+
tags:
2332+
- Organization
2333+
summary: Count the organization users using the provided filters
2334+
operationId: countOrgaUsers
2335+
parameters:
2336+
- $ref: '#/components/parameters/role'
2337+
- $ref: '#/components/parameters/searchInputQuery'
2338+
- $ref: '#/components/parameters/groupIds'
2339+
- $ref: '#/components/parameters/noActiveLicense'
2340+
responses:
2341+
200:
2342+
description: Number of users
2343+
content:
2344+
application/json:
2345+
schema:
2346+
type: integer
2347+
items:
2348+
$ref: '#/components/schemas/UserDetailsAdmin'
2349+
default:
2350+
description: Error
2351+
content:
2352+
application/json:
2353+
schema:
2354+
$ref: '#/components/schemas/FlatErrorResponse'
2355+
security:
2356+
- OAuth2:
2357+
- edu.admin
2358+
- edu.admin.users
2359+
- edu.admin.users.readonly
23232360
/organizations/users/{user}:
23242361
put:
23252362
tags:
@@ -2670,7 +2707,7 @@ paths:
26702707
26712708
If the classsroom is synchronized with another application like Google Classroom, some of the meta information will automatically be updated.
26722709
2673-
You can add users to this class using `POST /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.
2710+
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.
26742711
operationId: createClass
26752712
requestBody:
26762713
content:
@@ -3097,6 +3134,79 @@ paths:
30973134
- edu.classes
30983135
- edu.assignments
30993136
x-codegen-request-body-name: body
3137+
/classes/{class}/assignments/{assignment}/archive:
3138+
post:
3139+
tags:
3140+
- Class
3141+
summary: Archive the assignment
3142+
description: |
3143+
Archive the assignment
3144+
operationId: archiveAssignment
3145+
parameters:
3146+
- name: class
3147+
in: path
3148+
description: Unique identifier of the class
3149+
required: true
3150+
schema:
3151+
type: string
3152+
- name: assignment
3153+
in: path
3154+
description: Unique identifier of the assignment
3155+
required: true
3156+
schema:
3157+
type: string
3158+
responses:
3159+
200:
3160+
description: The assignment details
3161+
content:
3162+
application/json:
3163+
schema:
3164+
$ref: '#/components/schemas/Assignment'
3165+
default:
3166+
description: Error
3167+
content:
3168+
application/json:
3169+
schema:
3170+
$ref: '#/components/schemas/FlatErrorResponse'
3171+
security:
3172+
- OAuth2:
3173+
- edu.classes
3174+
delete:
3175+
tags:
3176+
- Class
3177+
summary: Unarchive the assignment.
3178+
description: |
3179+
Mark the assignment as `active`.
3180+
operationId: unarchiveAssignment
3181+
parameters:
3182+
- name: class
3183+
in: path
3184+
description: Unique identifier of the class
3185+
required: true
3186+
schema:
3187+
type: string
3188+
- name: assignment
3189+
in: path
3190+
description: Unique identifier of the assignment
3191+
required: true
3192+
schema:
3193+
type: string
3194+
responses:
3195+
200:
3196+
description: The assignment details
3197+
content:
3198+
application/json:
3199+
schema:
3200+
$ref: '#/components/schemas/Assignment'
3201+
default:
3202+
description: Error
3203+
content:
3204+
application/json:
3205+
schema:
3206+
$ref: '#/components/schemas/FlatErrorResponse'
3207+
security:
3208+
- OAuth2:
3209+
- edu.classes
31003210
/classes/{class}/assignments/{assignment}/submissions:
31013211
get:
31023212
tags:
@@ -3360,6 +3470,13 @@ paths:
33603470
required: true
33613471
schema:
33623472
type: string
3473+
- name: source
3474+
in: query
3475+
description: |
3476+
Filter the users by their source
3477+
schema:
3478+
type: string
3479+
enum: [googleClassroom, microsoftGraph, clever]
33633480
responses:
33643481
200:
33653482
description: The list of users member of the group
@@ -3596,8 +3713,7 @@ components:
35963713
instruments:
35973714
type: array
35983715
description: |
3599-
An array of the instrument identifiers that the user plays.
3600-
This is mainly used to display a list of the instruments in the Flat's UI or instruments icons.
3716+
An array of the instrument identifiers used the different score parts.
36013717
The format of the strings is `{instrument-group}.{instrument-id}`.
36023718
items:
36033719
type: string
@@ -3640,15 +3756,26 @@ components:
36403756
type: object
36413757
properties:
36423758
username:
3759+
maxLength: 30
3760+
minLength: 1
36433761
pattern: ^[A-Za-z0-9\-_.]+$
36443762
type: string
36453763
description: Username of the new account
3764+
firstname:
3765+
maxLength: 60
3766+
type: string
3767+
description: First name of the user
3768+
lastname:
3769+
maxLength: 60
3770+
type: string
3771+
description: Last name of the user
36463772
email:
36473773
type: string
36483774
description: Email of the new account
36493775
format: email
36503776
password:
36513777
minLength: 6
3778+
maxLength: 1000
36523779
type: string
36533780
description: Password of the new account
36543781
format: password
@@ -3660,6 +3787,7 @@ components:
36603787
properties:
36613788
password:
36623789
minLength: 6
3790+
maxLength: 1000
36633791
type: string
36643792
description: Password of the new account
36653793
format: password
@@ -3956,6 +4084,13 @@ components:
39564084
An array of the instrument identifiers used in the last version of the score. This is mainly used to display a list of the instruments in the Flat's UI or instruments icons. The format of the strings is `{instrument-group}.{instrument-id}`.
39574085
items:
39584086
type: string
4087+
samples:
4088+
type: array
4089+
description: |
4090+
An array of the audio samples identifiers used the different score parts.
4091+
The format of the strings is `{instrument-group}.{sample-id}`.
4092+
items:
4093+
type: string
39594094
googleDriveFileId:
39604095
type: string
39614096
description: |
@@ -4308,6 +4443,7 @@ components:
43084443
properties:
43094444
collection:
43104445
type: string
4446+
default: root
43114447
description: |
43124448
Unique identifier of a collection where the score will be copied.
43134449
If no collection identifier is provided, the score will be stored in the `root` directory.
@@ -4778,8 +4914,6 @@ components:
47784914
description: The email address you want to send the invitation to
47794915
organizationRole:
47804916
$ref: '#/components/schemas/OrganizationRoles'
4781-
role:
4782-
$ref: '#/components/schemas/OrganizationRoles'
47834917
description: The parameters to create an organization invitation
47844918
example:
47854919
@@ -5164,6 +5298,13 @@ components:
51645298
- draft
51655299
- active
51665300
- archived
5301+
type:
5302+
type: string
5303+
description: Type of the assignment, determined by the attachments
5304+
enum:
5305+
- newScore
5306+
- scoreTemplate
5307+
- sharedWriting
51675308
title:
51685309
type: string
51695310
description: Title of the assignment
@@ -5669,3 +5810,35 @@ components:
56695810
required: true
56705811
schema:
56715812
type: string
5813+
role:
5814+
name: role
5815+
in: query
5816+
description: Filter users by role
5817+
schema:
5818+
type: array
5819+
items:
5820+
type: string
5821+
enum:
5822+
- user
5823+
- teacher
5824+
- admin
5825+
searchInputQuery:
5826+
name: q
5827+
in: query
5828+
description: The query to search
5829+
schema:
5830+
type: string
5831+
groupIds:
5832+
name: group
5833+
in: query
5834+
description: Filter users by group
5835+
schema:
5836+
type: array
5837+
items:
5838+
type: string
5839+
noActiveLicense:
5840+
name: noActiveLicense
5841+
in: query
5842+
description: Filter users who don't have an active license
5843+
schema:
5844+
type: boolean

0 commit comments

Comments
 (0)