0.6.0 • Published 6 years ago

flat-api v0.6.0

Weekly downloads
2
License
Apache-2.0
Repository
github
Last release
6 years ago

JavaScript (Browser & Node.js) Client for the Flat REST API

Build Status Greenkeeper badge NPM Version Bower Version

The Flat API allows you to easily extend the abilities of the Flat Platform, 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.

To request some API credentials, please visit https://flat.io/developers.

This JavaScript package is automatically generated by the Swagger Codegen project.

Installation

For Node.js

npm

$ npm install flat-api --save

git

$ npm install git://github.com/FlatIO/api-client-js --save

For browser

bower

$ bower install flat-api

git / github

The library also works in the browser environment via npm and browserify. A build is available in the build directory, you can also rebuild the library:

$ 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 instruction and execute the following JS code:

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

ClassMethodHTTP requestDescription
FlatApi.AccountApigetAuthenticatedUserGET /meGet current user profile
FlatApi.ClassApiactivateClassPOST /classes/{class}/activateActivate the class
FlatApi.ClassApiaddClassUserPUT /classes/{class}/users/{user}Add a user to the class
FlatApi.ClassApiarchiveClassPOST /classes/{class}/archiveArchive the class
FlatApi.ClassApicopyAssignmentPOST /classes/{class}/assignments/{assignment}/copyCopy an assignment
FlatApi.ClassApicreateAssignmentPOST /classes/{class}/assignmentsAssignment creation
FlatApi.ClassApicreateClassPOST /classesCreate a new class
FlatApi.ClassApicreateSubmissionPUT /classes/{class}/assignments/{assignment}/submissionsCreate or edit a submission
FlatApi.ClassApideleteClassUserDELETE /classes/{class}/users/{user}Remove a user from the class
FlatApi.ClassApieditSubmissionPUT /classes/{class}/assignments/{assignment}/submissions/{submission}Edit a submission
FlatApi.ClassApienrollClassPOST /classes/enroll/{enrollmentCode}Join a class
FlatApi.ClassApigetClassGET /classes/{class}Get the details of a single class
FlatApi.ClassApigetScoreSubmissionsGET /scores/{score}/submissionsList submissions related to the score
FlatApi.ClassApigetSubmissionGET /classes/{class}/assignments/{assignment}/submissions/{submission}Get a student submission
FlatApi.ClassApigetSubmissionsGET /classes/{class}/assignments/{assignment}/submissionsList the students' submissions
FlatApi.ClassApilistAssignmentsGET /classes/{class}/assignmentsAssignments listing
FlatApi.ClassApilistClassStudentSubmissionsGET /classes/{class}/students/{user}/submissionsList the submissions for a student
FlatApi.ClassApilistClassesGET /classesList the classes available for the current user
FlatApi.ClassApiunarchiveClassDELETE /classes/{class}/archiveUnarchive the class
FlatApi.ClassApiupdateClassPUT /classes/{class}Update the class
FlatApi.CollectionApiaddScoreToCollectionPUT /collections/{collection}/scores/{score}Add a score to the collection
FlatApi.CollectionApicreateCollectionPOST /collectionsCreate a new collection
FlatApi.CollectionApideleteCollectionDELETE /collections/{collection}Delete the collection
FlatApi.CollectionApideleteScoreFromCollectionDELETE /collections/{collection}/scores/{score}Delete a score from the collection
FlatApi.CollectionApieditCollectionPUT /collections/{collection}Update a collection's metadata
FlatApi.CollectionApigetCollectionGET /collections/{collection}Get collection details
FlatApi.CollectionApilistCollectionScoresGET /collections/{collection}/scoresList the scores contained in a collection
FlatApi.CollectionApilistCollectionsGET /collectionsList the collections
FlatApi.CollectionApiuntrashCollectionPOST /collections/{collection}/untrashUntrash a collection
FlatApi.GroupApigetGroupDetailsGET /groups/{group}Get group information
FlatApi.GroupApigetGroupScoresGET /groups/{group}/scoresList group's scores
FlatApi.GroupApilistGroupUsersGET /groups/{group}/usersList group's users
FlatApi.OrganizationApicreateLtiCredentialsPOST /organizations/lti/credentialsCreate a new couple of LTI 1.x credentials
FlatApi.OrganizationApicreateOrganizationInvitationPOST /organizations/invitationsCreate a new invitation to join the organization
FlatApi.OrganizationApicreateOrganizationUserPOST /organizations/usersCreate a new user account
FlatApi.OrganizationApilistLtiCredentialsGET /organizations/lti/credentialsList LTI 1.x credentials
FlatApi.OrganizationApilistOrganizationInvitationsGET /organizations/invitationsList the organization invitations
FlatApi.OrganizationApilistOrganizationUsersGET /organizations/usersList the organization users
FlatApi.OrganizationApiremoveOrganizationInvitationDELETE /organizations/invitations/{invitation}Remove an organization invitation
FlatApi.OrganizationApiremoveOrganizationUserDELETE /organizations/users/{user}Remove an account from Flat
FlatApi.OrganizationApirevokeLtiCredentialsDELETE /organizations/lti/credentials/{credentials}Revoke LTI 1.x credentials
FlatApi.OrganizationApiupdateOrganizationUserPUT /organizations/users/{user}Update account information
FlatApi.ScoreApiaddScoreCollaboratorPOST /scores/{score}/collaboratorsAdd a new collaborator
FlatApi.ScoreApiaddScoreTrackPOST /scores/{score}/tracksAdd a new video or audio track to the score
FlatApi.ScoreApicreateScorePOST /scoresCreate a new score
FlatApi.ScoreApicreateScoreRevisionPOST /scores/{score}/revisionsCreate a new revision
FlatApi.ScoreApideleteScoreDELETE /scores/{score}Delete a score
FlatApi.ScoreApideleteScoreCommentDELETE /scores/{score}/comments/{comment}Delete a comment
FlatApi.ScoreApideleteScoreTrackDELETE /scores/{score}/tracks/{track}Remove an audio or video track linked to the score
FlatApi.ScoreApieditScorePUT /scores/{score}Edit a score's metadata
FlatApi.ScoreApiforkScorePOST /scores/{score}/forkFork a score
FlatApi.ScoreApigerUserLikesGET /users/{user}/likesList liked scores
FlatApi.ScoreApigetGroupScoresGET /groups/{group}/scoresList group's scores
FlatApi.ScoreApigetScoreGET /scores/{score}Get a score's metadata
FlatApi.ScoreApigetScoreCollaboratorGET /scores/{score}/collaborators/{collaborator}Get a collaborator
FlatApi.ScoreApigetScoreCollaboratorsGET /scores/{score}/collaboratorsList the collaborators
FlatApi.ScoreApigetScoreCommentsGET /scores/{score}/commentsList comments
FlatApi.ScoreApigetScoreRevisionGET /scores/{score}/revisions/{revision}Get a score revision
FlatApi.ScoreApigetScoreRevisionDataGET /scores/{score}/revisions/{revision}/{format}Get a score revision data
FlatApi.ScoreApigetScoreRevisionsGET /scores/{score}/revisionsList the revisions
FlatApi.ScoreApigetScoreSubmissionsGET /scores/{score}/submissionsList submissions related to the score
FlatApi.ScoreApigetScoreTrackGET /scores/{score}/tracks/{track}Retrieve the details of an audio or video track linked to a score
FlatApi.ScoreApigetUserScoresGET /users/{user}/scoresList user's scores
FlatApi.ScoreApilistScoreTracksGET /scores/{score}/tracksList the audio or video tracks linked to a score
FlatApi.ScoreApimarkScoreCommentResolvedPUT /scores/{score}/comments/{comment}/resolvedMark the comment as resolved
FlatApi.ScoreApimarkScoreCommentUnresolvedDELETE /scores/{score}/comments/{comment}/resolvedMark the comment as unresolved
FlatApi.ScoreApipostScoreCommentPOST /scores/{score}/commentsPost a new comment
FlatApi.ScoreApiremoveScoreCollaboratorDELETE /scores/{score}/collaborators/{collaborator}Delete a collaborator
FlatApi.ScoreApiuntrashScorePOST /scores/{score}/untrashUntrash a score
FlatApi.ScoreApiupdateScoreCommentPUT /scores/{score}/comments/{comment}Update an existing comment
FlatApi.ScoreApiupdateScoreTrackPUT /scores/{score}/tracks/{track}Update an audio or video track linked to a score
FlatApi.UserApigerUserLikesGET /users/{user}/likesList liked scores
FlatApi.UserApigetUserGET /users/{user}Get a public user profile
FlatApi.UserApigetUserScoresGET /users/{user}/scoresList user's scores

Documentation for Models

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.
0.6.0

6 years ago

0.5.0

7 years ago

0.4.0

7 years ago

0.3.0

7 years ago

0.2.0

7 years ago

0.1.0

7 years ago

0.0.0

7 years ago