Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/flatio/api-client-js
💛 JavaScript client for the Flat REST API
https://github.com/flatio/api-client-js
api-client bower education flat-api javascript midi music-notation musicxml nodejs score
Last synced: about 1 month ago
JSON representation
💛 JavaScript client for the Flat REST API
- Host: GitHub
- URL: https://github.com/flatio/api-client-js
- Owner: FlatIO
- License: apache-2.0
- Created: 2017-04-09T18:05:19.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-05-16T01:07:42.000Z (7 months ago)
- Last Synced: 2024-11-09T06:18:54.270Z (about 2 months ago)
- Topics: api-client, bower, education, flat-api, javascript, midi, music-notation, musicxml, nodejs, score
- Language: JavaScript
- Homepage:
- Size: 694 KB
- Stars: 11
- Watchers: 6
- Forks: 3
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# JavaScript (Browser & Node.js) Client for the Flat REST API
[![Build Status](https://img.shields.io/travis/FlatIO/api-client-js.svg?style=flat)](https://travis-ci.org/FlatIO/api-client-js)
[![NPM Version](https://img.shields.io/npm/v/flat-api.svg?style=flat)](https://www.npmjs.org/package/flat-api)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 or MIDI 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.You can find the API reference including code samples and our OpenAPI Specification at the following url: [https://flat.io/developers/api/reference](https://flat.io/developers/api/reference).
To request some API credentials, please visit [https://flat.io/developers](https://flat.io/developers).
This JavaScript package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project.
## Installation
### For [Node.js](https://nodejs.org/)
#### npm
```shell
$ npm install flat-api --save
```#### git
```shell
$ npm install git://github.com/FlatIO/api-client-js --save
```### For browser
### bower
```shell
$ bower install flat-api
```### git / github
The library also works in the browser environment via npm and [browserify](http://browserify.org/).
A build is available in the `build` directory, you can also rebuild the library:```shell
$ npm install -d && npm run build
$ ls -1 build
flat-api.js
flat-api.js.map
flat-api.min.js
```Then include *bundle.js* in the HTML pages.
## Getting Started
Please follow the [installation](#installation) instruction and execute the following JS code:
```javascript
var FlatApi = require('flat-api');// Configure OAuth2 access token for authorization
FlatApi.ApiClient.instance.authentications.OAuth2.accessToken = 'YOUR_ACCES_TOKEN';var flatAccountApi = new FlatApi.AccountApi();
flatAccountApi.getAuthenticatedUser(function(error, data, response) {
if (error) {
console.error(error);
}
else {
console.log('Successfully retrieved user profile: ', data);
}
});
```## Documentation for API Endpoints
All URIs are relative to *https://api.flat.io/v2*
Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*FlatApi.AccountApi* | [**getAuthenticatedUser**](docs/AccountApi.md#getAuthenticatedUser) | **GET** /me | Get current user profile
*FlatApi.ClassApi* | [**activateClass**](docs/ClassApi.md#activateClass) | **POST** /classes/{class}/activate | Activate the class
*FlatApi.ClassApi* | [**addClassUser**](docs/ClassApi.md#addClassUser) | **PUT** /classes/{class}/users/{user} | Add a user to the class
*FlatApi.ClassApi* | [**archiveClass**](docs/ClassApi.md#archiveClass) | **POST** /classes/{class}/archive | Archive the class
*FlatApi.ClassApi* | [**copyAssignment**](docs/ClassApi.md#copyAssignment) | **POST** /classes/{class}/assignments/{assignment}/copy | Copy an assignment
*FlatApi.ClassApi* | [**createAssignment**](docs/ClassApi.md#createAssignment) | **POST** /classes/{class}/assignments | Assignment creation
*FlatApi.ClassApi* | [**createClass**](docs/ClassApi.md#createClass) | **POST** /classes | Create a new class
*FlatApi.ClassApi* | [**createSubmission**](docs/ClassApi.md#createSubmission) | **PUT** /classes/{class}/assignments/{assignment}/submissions | Create or edit a submission
*FlatApi.ClassApi* | [**deleteClassUser**](docs/ClassApi.md#deleteClassUser) | **DELETE** /classes/{class}/users/{user} | Remove a user from the class
*FlatApi.ClassApi* | [**editSubmission**](docs/ClassApi.md#editSubmission) | **PUT** /classes/{class}/assignments/{assignment}/submissions/{submission} | Edit a submission
*FlatApi.ClassApi* | [**enrollClass**](docs/ClassApi.md#enrollClass) | **POST** /classes/enroll/{enrollmentCode} | Join a class
*FlatApi.ClassApi* | [**getClass**](docs/ClassApi.md#getClass) | **GET** /classes/{class} | Get the details of a single class
*FlatApi.ClassApi* | [**getScoreSubmissions**](docs/ClassApi.md#getScoreSubmissions) | **GET** /scores/{score}/submissions | List submissions related to the score
*FlatApi.ClassApi* | [**getSubmission**](docs/ClassApi.md#getSubmission) | **GET** /classes/{class}/assignments/{assignment}/submissions/{submission} | Get a student submission
*FlatApi.ClassApi* | [**getSubmissions**](docs/ClassApi.md#getSubmissions) | **GET** /classes/{class}/assignments/{assignment}/submissions | List the students' submissions
*FlatApi.ClassApi* | [**listAssignments**](docs/ClassApi.md#listAssignments) | **GET** /classes/{class}/assignments | Assignments listing
*FlatApi.ClassApi* | [**listClassStudentSubmissions**](docs/ClassApi.md#listClassStudentSubmissions) | **GET** /classes/{class}/students/{user}/submissions | List the submissions for a student
*FlatApi.ClassApi* | [**listClasses**](docs/ClassApi.md#listClasses) | **GET** /classes | List the classes available for the current user
*FlatApi.ClassApi* | [**unarchiveClass**](docs/ClassApi.md#unarchiveClass) | **DELETE** /classes/{class}/archive | Unarchive the class
*FlatApi.ClassApi* | [**updateClass**](docs/ClassApi.md#updateClass) | **PUT** /classes/{class} | Update the class
*FlatApi.CollectionApi* | [**addScoreToCollection**](docs/CollectionApi.md#addScoreToCollection) | **PUT** /collections/{collection}/scores/{score} | Add a score to the collection
*FlatApi.CollectionApi* | [**createCollection**](docs/CollectionApi.md#createCollection) | **POST** /collections | Create a new collection
*FlatApi.CollectionApi* | [**deleteCollection**](docs/CollectionApi.md#deleteCollection) | **DELETE** /collections/{collection} | Delete the collection
*FlatApi.CollectionApi* | [**deleteScoreFromCollection**](docs/CollectionApi.md#deleteScoreFromCollection) | **DELETE** /collections/{collection}/scores/{score} | Delete a score from the collection
*FlatApi.CollectionApi* | [**editCollection**](docs/CollectionApi.md#editCollection) | **PUT** /collections/{collection} | Update a collection's metadata
*FlatApi.CollectionApi* | [**getCollection**](docs/CollectionApi.md#getCollection) | **GET** /collections/{collection} | Get collection details
*FlatApi.CollectionApi* | [**listCollectionScores**](docs/CollectionApi.md#listCollectionScores) | **GET** /collections/{collection}/scores | List the scores contained in a collection
*FlatApi.CollectionApi* | [**listCollections**](docs/CollectionApi.md#listCollections) | **GET** /collections | List the collections
*FlatApi.CollectionApi* | [**untrashCollection**](docs/CollectionApi.md#untrashCollection) | **POST** /collections/{collection}/untrash | Untrash a collection
*FlatApi.GroupApi* | [**getGroupDetails**](docs/GroupApi.md#getGroupDetails) | **GET** /groups/{group} | Get group information
*FlatApi.GroupApi* | [**getGroupScores**](docs/GroupApi.md#getGroupScores) | **GET** /groups/{group}/scores | List group's scores
*FlatApi.GroupApi* | [**listGroupUsers**](docs/GroupApi.md#listGroupUsers) | **GET** /groups/{group}/users | List group's users
*FlatApi.OrganizationApi* | [**createLtiCredentials**](docs/OrganizationApi.md#createLtiCredentials) | **POST** /organizations/lti/credentials | Create a new couple of LTI 1.x credentials
*FlatApi.OrganizationApi* | [**createOrganizationInvitation**](docs/OrganizationApi.md#createOrganizationInvitation) | **POST** /organizations/invitations | Create a new invitation to join the organization
*FlatApi.OrganizationApi* | [**createOrganizationUser**](docs/OrganizationApi.md#createOrganizationUser) | **POST** /organizations/users | Create a new user account
*FlatApi.OrganizationApi* | [**listLtiCredentials**](docs/OrganizationApi.md#listLtiCredentials) | **GET** /organizations/lti/credentials | List LTI 1.x credentials
*FlatApi.OrganizationApi* | [**listOrganizationInvitations**](docs/OrganizationApi.md#listOrganizationInvitations) | **GET** /organizations/invitations | List the organization invitations
*FlatApi.OrganizationApi* | [**listOrganizationUsers**](docs/OrganizationApi.md#listOrganizationUsers) | **GET** /organizations/users | List the organization users
*FlatApi.OrganizationApi* | [**removeOrganizationInvitation**](docs/OrganizationApi.md#removeOrganizationInvitation) | **DELETE** /organizations/invitations/{invitation} | Remove an organization invitation
*FlatApi.OrganizationApi* | [**removeOrganizationUser**](docs/OrganizationApi.md#removeOrganizationUser) | **DELETE** /organizations/users/{user} | Remove an account from Flat
*FlatApi.OrganizationApi* | [**revokeLtiCredentials**](docs/OrganizationApi.md#revokeLtiCredentials) | **DELETE** /organizations/lti/credentials/{credentials} | Revoke LTI 1.x credentials
*FlatApi.OrganizationApi* | [**updateOrganizationUser**](docs/OrganizationApi.md#updateOrganizationUser) | **PUT** /organizations/users/{user} | Update account information
*FlatApi.ScoreApi* | [**addScoreCollaborator**](docs/ScoreApi.md#addScoreCollaborator) | **POST** /scores/{score}/collaborators | Add a new collaborator
*FlatApi.ScoreApi* | [**addScoreTrack**](docs/ScoreApi.md#addScoreTrack) | **POST** /scores/{score}/tracks | Add a new video or audio track to the score
*FlatApi.ScoreApi* | [**createScore**](docs/ScoreApi.md#createScore) | **POST** /scores | Create a new score
*FlatApi.ScoreApi* | [**createScoreRevision**](docs/ScoreApi.md#createScoreRevision) | **POST** /scores/{score}/revisions | Create a new revision
*FlatApi.ScoreApi* | [**deleteScore**](docs/ScoreApi.md#deleteScore) | **DELETE** /scores/{score} | Delete a score
*FlatApi.ScoreApi* | [**deleteScoreComment**](docs/ScoreApi.md#deleteScoreComment) | **DELETE** /scores/{score}/comments/{comment} | Delete a comment
*FlatApi.ScoreApi* | [**deleteScoreTrack**](docs/ScoreApi.md#deleteScoreTrack) | **DELETE** /scores/{score}/tracks/{track} | Remove an audio or video track linked to the score
*FlatApi.ScoreApi* | [**editScore**](docs/ScoreApi.md#editScore) | **PUT** /scores/{score} | Edit a score's metadata
*FlatApi.ScoreApi* | [**forkScore**](docs/ScoreApi.md#forkScore) | **POST** /scores/{score}/fork | Fork a score
*FlatApi.ScoreApi* | [**gerUserLikes**](docs/ScoreApi.md#gerUserLikes) | **GET** /users/{user}/likes | List liked scores
*FlatApi.ScoreApi* | [**getGroupScores**](docs/ScoreApi.md#getGroupScores) | **GET** /groups/{group}/scores | List group's scores
*FlatApi.ScoreApi* | [**getScore**](docs/ScoreApi.md#getScore) | **GET** /scores/{score} | Get a score's metadata
*FlatApi.ScoreApi* | [**getScoreCollaborator**](docs/ScoreApi.md#getScoreCollaborator) | **GET** /scores/{score}/collaborators/{collaborator} | Get a collaborator
*FlatApi.ScoreApi* | [**getScoreCollaborators**](docs/ScoreApi.md#getScoreCollaborators) | **GET** /scores/{score}/collaborators | List the collaborators
*FlatApi.ScoreApi* | [**getScoreComments**](docs/ScoreApi.md#getScoreComments) | **GET** /scores/{score}/comments | List comments
*FlatApi.ScoreApi* | [**getScoreRevision**](docs/ScoreApi.md#getScoreRevision) | **GET** /scores/{score}/revisions/{revision} | Get a score revision
*FlatApi.ScoreApi* | [**getScoreRevisionData**](docs/ScoreApi.md#getScoreRevisionData) | **GET** /scores/{score}/revisions/{revision}/{format} | Get a score revision data
*FlatApi.ScoreApi* | [**getScoreRevisions**](docs/ScoreApi.md#getScoreRevisions) | **GET** /scores/{score}/revisions | List the revisions
*FlatApi.ScoreApi* | [**getScoreSubmissions**](docs/ScoreApi.md#getScoreSubmissions) | **GET** /scores/{score}/submissions | List submissions related to the score
*FlatApi.ScoreApi* | [**getScoreTrack**](docs/ScoreApi.md#getScoreTrack) | **GET** /scores/{score}/tracks/{track} | Retrieve the details of an audio or video track linked to a score
*FlatApi.ScoreApi* | [**getUserScores**](docs/ScoreApi.md#getUserScores) | **GET** /users/{user}/scores | List user's scores
*FlatApi.ScoreApi* | [**listScoreTracks**](docs/ScoreApi.md#listScoreTracks) | **GET** /scores/{score}/tracks | List the audio or video tracks linked to a score
*FlatApi.ScoreApi* | [**markScoreCommentResolved**](docs/ScoreApi.md#markScoreCommentResolved) | **PUT** /scores/{score}/comments/{comment}/resolved | Mark the comment as resolved
*FlatApi.ScoreApi* | [**markScoreCommentUnresolved**](docs/ScoreApi.md#markScoreCommentUnresolved) | **DELETE** /scores/{score}/comments/{comment}/resolved | Mark the comment as unresolved
*FlatApi.ScoreApi* | [**postScoreComment**](docs/ScoreApi.md#postScoreComment) | **POST** /scores/{score}/comments | Post a new comment
*FlatApi.ScoreApi* | [**removeScoreCollaborator**](docs/ScoreApi.md#removeScoreCollaborator) | **DELETE** /scores/{score}/collaborators/{collaborator} | Delete a collaborator
*FlatApi.ScoreApi* | [**untrashScore**](docs/ScoreApi.md#untrashScore) | **POST** /scores/{score}/untrash | Untrash a score
*FlatApi.ScoreApi* | [**updateScoreComment**](docs/ScoreApi.md#updateScoreComment) | **PUT** /scores/{score}/comments/{comment} | Update an existing comment
*FlatApi.ScoreApi* | [**updateScoreTrack**](docs/ScoreApi.md#updateScoreTrack) | **PUT** /scores/{score}/tracks/{track} | Update an audio or video track linked to a score
*FlatApi.UserApi* | [**gerUserLikes**](docs/UserApi.md#gerUserLikes) | **GET** /users/{user}/likes | List liked scores
*FlatApi.UserApi* | [**getUser**](docs/UserApi.md#getUser) | **GET** /users/{user} | Get a public user profile
*FlatApi.UserApi* | [**getUserScores**](docs/UserApi.md#getUserScores) | **GET** /users/{user}/scores | List user's scores## Documentation for Models
- [FlatApi.Assignment](docs/Assignment.md)
- [FlatApi.AssignmentCopy](docs/AssignmentCopy.md)
- [FlatApi.AssignmentCreation](docs/AssignmentCreation.md)
- [FlatApi.AssignmentSubmission](docs/AssignmentSubmission.md)
- [FlatApi.AssignmentSubmissionUpdate](docs/AssignmentSubmissionUpdate.md)
- [FlatApi.ClassAttachmentCreation](docs/ClassAttachmentCreation.md)
- [FlatApi.ClassCreation](docs/ClassCreation.md)
- [FlatApi.ClassDetails](docs/ClassDetails.md)
- [FlatApi.ClassDetailsCanvas](docs/ClassDetailsCanvas.md)
- [FlatApi.ClassDetailsClever](docs/ClassDetailsClever.md)
- [FlatApi.ClassDetailsGoogleClassroom](docs/ClassDetailsGoogleClassroom.md)
- [FlatApi.ClassDetailsGoogleDrive](docs/ClassDetailsGoogleDrive.md)
- [FlatApi.ClassDetailsLti](docs/ClassDetailsLti.md)
- [FlatApi.ClassRoles](docs/ClassRoles.md)
- [FlatApi.ClassState](docs/ClassState.md)
- [FlatApi.ClassUpdate](docs/ClassUpdate.md)
- [FlatApi.Collection](docs/Collection.md)
- [FlatApi.CollectionCapabilities](docs/CollectionCapabilities.md)
- [FlatApi.CollectionCreation](docs/CollectionCreation.md)
- [FlatApi.CollectionModification](docs/CollectionModification.md)
- [FlatApi.CollectionPrivacy](docs/CollectionPrivacy.md)
- [FlatApi.CollectionTitle](docs/CollectionTitle.md)
- [FlatApi.CollectionType](docs/CollectionType.md)
- [FlatApi.FlatErrorResponse](docs/FlatErrorResponse.md)
- [FlatApi.FlatLocales](docs/FlatLocales.md)
- [FlatApi.GoogleClassroomCoursework](docs/GoogleClassroomCoursework.md)
- [FlatApi.GoogleClassroomSubmission](docs/GoogleClassroomSubmission.md)
- [FlatApi.Group](docs/Group.md)
- [FlatApi.GroupDetails](docs/GroupDetails.md)
- [FlatApi.GroupType](docs/GroupType.md)
- [FlatApi.LicenseMode](docs/LicenseMode.md)
- [FlatApi.LicenseSources](docs/LicenseSources.md)
- [FlatApi.LmsName](docs/LmsName.md)
- [FlatApi.LtiCredentials](docs/LtiCredentials.md)
- [FlatApi.LtiCredentialsCreation](docs/LtiCredentialsCreation.md)
- [FlatApi.MediaAttachment](docs/MediaAttachment.md)
- [FlatApi.MediaScoreSharingMode](docs/MediaScoreSharingMode.md)
- [FlatApi.OrganizationInvitation](docs/OrganizationInvitation.md)
- [FlatApi.OrganizationInvitationCreation](docs/OrganizationInvitationCreation.md)
- [FlatApi.OrganizationRoles](docs/OrganizationRoles.md)
- [FlatApi.ResourceCollaboratorCreation](docs/ResourceCollaboratorCreation.md)
- [FlatApi.ResourceRights](docs/ResourceRights.md)
- [FlatApi.ResourceSharingKey](docs/ResourceSharingKey.md)
- [FlatApi.ScoreComment](docs/ScoreComment.md)
- [FlatApi.ScoreCommentContext](docs/ScoreCommentContext.md)
- [FlatApi.ScoreCommentCreation](docs/ScoreCommentCreation.md)
- [FlatApi.ScoreCommentUpdate](docs/ScoreCommentUpdate.md)
- [FlatApi.ScoreCommentsCounts](docs/ScoreCommentsCounts.md)
- [FlatApi.ScoreCreation](docs/ScoreCreation.md)
- [FlatApi.ScoreCreationType](docs/ScoreCreationType.md)
- [FlatApi.ScoreData](docs/ScoreData.md)
- [FlatApi.ScoreDataEncoding](docs/ScoreDataEncoding.md)
- [FlatApi.ScoreFork](docs/ScoreFork.md)
- [FlatApi.ScoreLicense](docs/ScoreLicense.md)
- [FlatApi.ScoreLikesCounts](docs/ScoreLikesCounts.md)
- [FlatApi.ScoreModification](docs/ScoreModification.md)
- [FlatApi.ScorePrivacy](docs/ScorePrivacy.md)
- [FlatApi.ScoreRevision](docs/ScoreRevision.md)
- [FlatApi.ScoreRevisionCreation](docs/ScoreRevisionCreation.md)
- [FlatApi.ScoreRevisionStatistics](docs/ScoreRevisionStatistics.md)
- [FlatApi.ScoreSource](docs/ScoreSource.md)
- [FlatApi.ScoreSummary](docs/ScoreSummary.md)
- [FlatApi.ScoreTrack](docs/ScoreTrack.md)
- [FlatApi.ScoreTrackCreation](docs/ScoreTrackCreation.md)
- [FlatApi.ScoreTrackPoint](docs/ScoreTrackPoint.md)
- [FlatApi.ScoreTrackState](docs/ScoreTrackState.md)
- [FlatApi.ScoreTrackType](docs/ScoreTrackType.md)
- [FlatApi.ScoreTrackUpdate](docs/ScoreTrackUpdate.md)
- [FlatApi.ScoreViewsCounts](docs/ScoreViewsCounts.md)
- [FlatApi.UserAdminUpdate](docs/UserAdminUpdate.md)
- [FlatApi.UserBasics](docs/UserBasics.md)
- [FlatApi.UserCreation](docs/UserCreation.md)
- [FlatApi.UserDetailsAdminLicense](docs/UserDetailsAdminLicense.md)
- [FlatApi.UserInstruments](docs/UserInstruments.md)
- [FlatApi.ResourceCollaborator](docs/ResourceCollaborator.md)
- [FlatApi.ScoreDetails](docs/ScoreDetails.md)
- [FlatApi.UserPublicSummary](docs/UserPublicSummary.md)
- [FlatApi.UserDetailsAdmin](docs/UserDetailsAdmin.md)
- [FlatApi.UserPublic](docs/UserPublic.md)
- [FlatApi.UserDetails](docs/UserDetails.md)## Documentation for Authorization
### OAuth2
- **Type**: OAuth
- **Flow**: accessCode
- **Authorization URL**: https://flat.io/auth/oauth
- **Scopes**:
- account.public_profile: Provides access to the basic person's public profile. Education profiles may be anonymized with this scope, you can request the scope `education_profile` to access to the a basic education account profile.
- account.education_profile: Provides access to the basic person's education profile and public organization information.
- scores.readonly: Allows read-only access to all a user's scores. You won't need this scope to read public scores.
- scores.social: Allow to post comments and like scores
- scores: Full, permissive scope to access all of a user's scores.
- collections.readonly: Allow read-only access to a user's collections.
- collections.add_scores: Allow to add scores to a user's collections.
- collections: Full, permissive scope to access all of a user's collections.
- edu.classes: Full, permissive scope to manage the classes.
- edu.classes.readonly: Read-only access to the classes.
- edu.assignments: Read-write access to the assignments and submissions.
- edu.assignments.readonly: Read-only access to the assignments and submissions.
- edu.admin: Full, permissive scope to manage all the admin of an organization.
- edu.admin.lti: Access and manage the LTI Credentials for an organization.
- edu.admin.lti.readonly: Read-only access to the LTI Credentials of an organization.
- edu.admin.users: Access and manage the users and invitations of the organization.
- edu.admin.users.readonly: Read-only access to the users and invitations of the organization.