Skip to content

Commit fc87bd9

Browse files
committed
feat(api): API specification v2.14.0
* feat(scores): `POST /v2/scores` has a new score builder to easily create blank scores without the need of importing a MusicXML file. Provide a list of instruments to use, and optionally customize the time signature, key signature, enable TABs, Chord grids as well as the page layout. * feat(edu): `POST /v2/organizations/users` has support for roles. * feat(edu): added new `shuffleExercises` option for worksheets. * feat(edu): added new `exercisesIds` in students submissions.
1 parent 9ab2c6f commit fc87bd9

File tree

1 file changed

+188
-27
lines changed

1 file changed

+188
-27
lines changed

spec/swagger.yaml

+188-27
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ info:
3333
name: Flat
3434
url: https://flat.io/developers/docs/api/
3535
36-
version: 2.13.0
36+
version: 2.14.0
3737
x-logo:
38-
url: https://flat.io/img/logo-flat.svg
38+
url: https://prod.flat-cdn.com/img/logo-flat.svg
3939
servers:
4040
- url: https://api.flat.io/v2
4141
tags:
@@ -114,7 +114,11 @@ paths:
114114
- Score
115115
summary: Create a new score
116116
description: |
117-
Use this API method to **create a new music score in the current User account**. You will need a MusicXML 3 (`vnd.recordare.musicxml` or `vnd.recordare.musicxml+xml`), a MIDI (`audio/midi`), Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar, or MuseScore file to create the new Flat document.
117+
Use this API method to **create a new music score in the current User account**. This API endpoints provides 3 ways to create scores:
118+
119+
* `ScoreCreationBuilderData` : Create a blank score by providing the list of instruments to use. You can optionally customize the initial key signature, time signature, enable TABs, Chord grids, as well as the page layout.
120+
* `ScoreCreationFileImport`: Import an existing MusicXML 3 file (`vnd.recordare.musicxml` or `vnd.recordare.musicxml+xml`), a MIDI file (`audio/midi`), Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar, or MuseScore file to create the new Flat document.
121+
* `ScoreCreationGoogleDriveImport`: Import an existing Google Drive file from the connected Google Drive account.
118122
119123
This API call will automatically create the first revision of the document, the score can be modified by the using our web application or by uploading a new revision of this file (`POST /v2/scores/{score}/revisions/{revision}`).
120124
@@ -128,7 +132,10 @@ paths:
128132
content:
129133
application/json:
130134
schema:
131-
$ref: '#/components/schemas/ScoreCreation'
135+
oneOf:
136+
- $ref: '#/components/schemas/ScoreCreationBuilderData'
137+
- $ref: '#/components/schemas/ScoreCreationFileImport'
138+
- $ref: '#/components/schemas/ScoreCreationGoogleDriveImport'
132139
required: true
133140
responses:
134141
200:
@@ -3762,6 +3769,14 @@ components:
37623769
format: password
37633770
locale:
37643771
$ref: '#/components/schemas/FlatLocales'
3772+
role:
3773+
description: Role of the new account
3774+
type: string
3775+
default: user
3776+
enum:
3777+
- user
3778+
- teacher
3779+
- admin
37653780
description: User creation
37663781
UserAdminUpdate:
37673782
type: object
@@ -4402,7 +4417,7 @@ components:
44024417
If the score is a file on Google Drive, this field property must contain its identifier. To use this method, the Drive file must be public or the Flat Drive App must have access to the file.
44034418
example:
44044419
googleDrive: 0B-0000000000000001
4405-
ScoreCreation:
4420+
ScoreCreationCommon:
44064421
required:
44074422
- privacy
44084423
type: object
@@ -4416,24 +4431,8 @@ components:
44164431
- Use the title contained in the file (e.g. [`movement-title`](https://usermanuals.musicxml.com/MusicXML/Content/EL-MusicXML-movement-title.htm) or [`credit-words`](https://usermanuals.musicxml.com/MusicXML/Content/EL-MusicXML-credit-words.htm) for [MusicXML](http://www.musicxml.com/) files).
44174432
- Use the name of the file for files from a specified `source` (e.g. Google Drive) or the one in the `filename` property
44184433
- Set a default title (e.g. "New Music Score")
4419-
filename:
4420-
type: string
4421-
description: If this is an imported file, its filename
44224434
privacy:
44234435
$ref: '#/components/schemas/ScorePrivacy'
4424-
data:
4425-
type: string
4426-
description: |
4427-
The data of the score file. It must be a MusicXML 3 file (`vnd.recordare.musicxml` or `vnd.recordare.musicxml+xml`), a MIDI file (`audio/midi`) or a Flat.json (aka Adagio.json) file.
4428-
Binary payloads (`vnd.recordare.musicxml` and `audio/midi`) can be encoded in Base64, in this case the `dataEncoding` property must match the encoding used for the API request.
4429-
example: <score-partwise version="3.0"></score-partwise>
4430-
dataEncoding:
4431-
type: string
4432-
description: The optional encoding of the score data. This property must match the encoding used for the `data` property.
4433-
enum:
4434-
- base64
4435-
source:
4436-
$ref: '#/components/schemas/ScoreSource'
44374436
collection:
44384437
type: string
44394438
description: |
@@ -4443,12 +4442,159 @@ components:
44434442
type: string
44444443
description: |
44454444
If the user uses Google Drive and this properties is specified, the file will be created in this directory. The currently user creating the file must be granted to write in this directory.
4446-
description: A new created score
4447-
example:
4448-
title: My new score
4449-
privacy: private
4450-
data: <score-partwise version="3.0"></score-partwise>
4451-
googleDriveFolder: 0B-0000000000000000
4445+
ScoreCreationFileImport:
4446+
allOf:
4447+
- $ref: '#/components/schemas/ScoreCreationCommon'
4448+
- type: object
4449+
required:
4450+
- data
4451+
properties:
4452+
filename:
4453+
type: string
4454+
description: If this is an imported file, its filename
4455+
data:
4456+
type: string
4457+
description: |
4458+
The data of the score file. It must be a MusicXML 3 file (`vnd.recordare.musicxml` or `vnd.recordare.musicxml+xml`), a MIDI file (`audio/midi`) or a Flat.json (aka Adagio.json) file.
4459+
Binary payloads (`vnd.recordare.musicxml` and `audio/midi`) can be encoded in Base64, in this case the `dataEncoding` property must match the encoding used for the API request.
4460+
dataEncoding:
4461+
type: string
4462+
description: The optional encoding of the score data. This property must match the encoding used for the `data` property.
4463+
enum:
4464+
- base64
4465+
description: A newly created score from an imported file
4466+
example:
4467+
title: My new score
4468+
privacy: private
4469+
data: <score-partwise version="3.0">...[Your actual file will be provided in this property]...</score-partwise>
4470+
ScoreCreationGoogleDriveImport:
4471+
allOf:
4472+
- $ref: '#/components/schemas/ScoreCreationCommon'
4473+
- type: object
4474+
required:
4475+
- source
4476+
properties:
4477+
source:
4478+
$ref: '#/components/schemas/ScoreSource'
4479+
description: A newly created score from a file from Google Drive
4480+
example:
4481+
title: My new score
4482+
privacy: private
4483+
source:
4484+
googleDrive: 0B-0000000000000001
4485+
privacy: private
4486+
ScoreCreationBuilderData:
4487+
allOf:
4488+
- $ref: '#/components/schemas/ScoreCreationCommon'
4489+
- type: object
4490+
required:
4491+
- title
4492+
- builderData
4493+
properties:
4494+
builderData:
4495+
type: object
4496+
required:
4497+
- scoreData
4498+
properties:
4499+
scoreData:
4500+
required:
4501+
- instruments
4502+
type: object
4503+
properties:
4504+
useTabStaff:
4505+
type: boolean
4506+
description: true if the TAB staff is displayed with fretted instruments
4507+
useChordGrid:
4508+
type: boolean
4509+
description: true if the chord grid must be displayed with fretted instruments
4510+
fifths:
4511+
type: number
4512+
description: The key signature of the score (expressed between -7 and 7). Major C is used when the value is not provided.
4513+
nbBeats:
4514+
type: number
4515+
description: The number of beats in the measure
4516+
beatType:
4517+
type: number
4518+
description: The duration of a beat in the measure
4519+
instruments:
4520+
type: array
4521+
description: |
4522+
The list of instruments to add to the score.
4523+
See https://prod.flat-cdn.com/fixtures/instruments_en.json for the possible values for `group` and `instrument`.
4524+
items:
4525+
required:
4526+
- group
4527+
- instrument
4528+
type: object
4529+
properties:
4530+
group:
4531+
type: string
4532+
description: The of the instrument group (e.g. `keyboards`, `brass`)
4533+
instrument:
4534+
type: string
4535+
description: The identifier of the instrument (e.g. `piano`, `trumpet`)
4536+
longName:
4537+
type: string
4538+
description: The full name of the instrument
4539+
shortName:
4540+
type: string
4541+
description: The abbreviation of the name of the instrument
4542+
layoutData:
4543+
type: object
4544+
description: Control the appearance of the score. If missing, default values are used.
4545+
properties:
4546+
notesSpacingCoeff:
4547+
type: number
4548+
description: A float value >= 1 that controls the spacing between notes.
4549+
lengthUnit:
4550+
description: The unit to use for layout customizations
4551+
type: string
4552+
default: cm
4553+
enum:
4554+
- cm
4555+
- inch
4556+
pageHeight:
4557+
type: number
4558+
description: The height of the page in chosen unit (`lengthUnit`).
4559+
pageWidth:
4560+
type: number
4561+
description: The width of the page in chosen unit (`lengthUnit`).
4562+
pageMarginTop:
4563+
type: number
4564+
description: The top margin of the page in chosen unit (`lengthUnit`).
4565+
pageMarginBottom:
4566+
type: number
4567+
description: The bottom margin of the page in chosen unit (`lengthUnit`).
4568+
pageMarginLeft:
4569+
type: number
4570+
description: The left margin of the page in chosen unit (`lengthUnit`).
4571+
pageMarginRight:
4572+
type: number
4573+
description: The right margin of the page in chosen unit (`lengthUnit`).
4574+
example:
4575+
title: Violin and Piano
4576+
privacy: private
4577+
builderData:
4578+
scoreData:
4579+
fifths: 8
4580+
nbBeats: 2
4581+
beatType: 4
4582+
instruments:
4583+
- group: strings
4584+
instrument: hq-violin
4585+
- group: strings
4586+
instrument: hq-grand-piano
4587+
shortName: Pno.
4588+
longName: Super Piano
4589+
layoutData:
4590+
notesSpacingCoeff: 2
4591+
lengthUnit: cm
4592+
pageHeight: 29.7
4593+
pageWidth: 21
4594+
pageMarginTop: 1.5
4595+
pageMarginBottom: 1.5
4596+
pageMarginLeft: 2.5
4597+
pageMarginRight: 2.5
44524598
ScoreFork:
44534599
type: object
44544600
properties:
@@ -5376,6 +5522,9 @@ components:
53765522
items:
53775523
type: string
53785524
description: Identifiers for the students that have access to the assignment
5525+
shuffleExercises:
5526+
type: boolean
5527+
description: Mixing exercises for each students
53795528
description: Assignment creation details
53805529
example:
53815530
title: First assignment
@@ -5578,6 +5727,12 @@ components:
55785727
minimum: 0
55795728
maximum: 100
55805729
description: Optional grade. If unset, no grade was set.
5730+
exercisesIds:
5731+
type: array
5732+
nullable: true
5733+
items:
5734+
type: string
5735+
description: The ids of exercises when they need to be in a specific order
55815736
return:
55825737
type: boolean
55835738
description: If `true`, the submission will be marked as done
@@ -5650,6 +5805,12 @@ components:
56505805
maxPoints:
56515806
type: number
56525807
description: Optional max points for the grade. If set, a corresponding `draftGrade` or `grade` will be set.
5808+
exercisesIds:
5809+
type: array
5810+
nullable: true
5811+
items:
5812+
type: string
5813+
description: The ids of exercises when they need to be in a specific order
56535814
googleClassroom:
56545815
$ref: '#/components/schemas/GoogleClassroomSubmission'
56555816
microsoftGraph:

0 commit comments

Comments
 (0)