2017 © Pedro Peláez
 

library api

PHP client for the Flat REST API

image

flat/api

PHP client for the Flat REST API

  • Thursday, April 26, 2018
  • by flat
  • Repository
  • 7 Watchers
  • 1 Stars
  • 14 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 11 Versions
  • 0 % Grown

The README.md

PHP Client for the Flat REST API

Build Status Packagist, (*1)

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., (*2)

You can find the API reference including code samples and our OpenAPI Specification at the following url: https://flat.io/developers/api/reference., (*3)

To request some API credentials, please visit https://flat.io/developers., (*4)

This Python package is automatically generated by the Swagger Codegen project., (*5)

Requirements

PHP 5.6.0 and later, (*6)

Installation & Usage

Composer

To install the bindings via Composer, add the following to composer.json:, (*7)

{
    "name": "Example Application",
    "description": "This is an example using the Flat API",
    "require": {
        "flat/api": "dev-master"
    }
}

Then run composer install, (*8)

Manual Installation

Download the files and include autoload.php:, (*9)

require_once('/path/to/./vendor/autoload.php');

Tests

To run the unit tests:, (*10)

composer install
./vendor/bin/phpunit

Getting Started

Please follow the installation procedure and then run the following:, (*11)

setAccessToken('YOUR_ACCESS_TOKEN');

$apiInstance = new Flat\APIClient\Api\AccountApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);

try {
    $result = $apiInstance->getAuthenticatedUser();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AccountApi->getAuthenticatedUser: ', $e->getMessage(), PHP_EOL;
}

?>

Documentation for API Endpoints

All URIs are relative to https://api.flat.io/v2, (*12)

Class Method HTTP request Description
AccountApi getAuthenticatedUser GET /me Get current user profile
ClassApi activateClass POST /classes/{class}/activate Activate the class
ClassApi addClassUser PUT /classes/{class}/users/{user} Add a user to the class
ClassApi archiveClass POST /classes/{class}/archive Archive the class
ClassApi copyAssignment POST /classes/{class}/assignments/{assignment}/copy Copy an assignment
ClassApi createAssignment POST /classes/{class}/assignments Assignment creation
ClassApi createClass POST /classes Create a new class
ClassApi createSubmission PUT /classes/{class}/assignments/{assignment}/submissions Create or edit a submission
ClassApi deleteClassUser DELETE /classes/{class}/users/{user} Remove a user from the class
ClassApi editSubmission PUT /classes/{class}/assignments/{assignment}/submissions/{submission} Edit a submission
ClassApi enrollClass POST /classes/enroll/{enrollmentCode} Join a class
ClassApi getClass GET /classes/{class} Get the details of a single class
ClassApi getScoreSubmissions GET /scores/{score}/submissions List submissions related to the score
ClassApi getSubmission GET /classes/{class}/assignments/{assignment}/submissions/{submission} Get a student submission
ClassApi getSubmissions GET /classes/{class}/assignments/{assignment}/submissions List the students' submissions
ClassApi listAssignments GET /classes/{class}/assignments Assignments listing
ClassApi listClassStudentSubmissions GET /classes/{class}/students/{user}/submissions List the submissions for a student
ClassApi listClasses GET /classes List the classes available for the current user
ClassApi unarchiveClass DELETE /classes/{class}/archive Unarchive the class
ClassApi updateClass PUT /classes/{class} Update the class
CollectionApi addScoreToCollection PUT /collections/{collection}/scores/{score} Add a score to the collection
CollectionApi createCollection POST /collections Create a new collection
CollectionApi deleteCollection DELETE /collections/{collection} Delete the collection
CollectionApi deleteScoreFromCollection DELETE /collections/{collection}/scores/{score} Delete a score from the collection
CollectionApi editCollection PUT /collections/{collection} Update a collection's metadata
CollectionApi getCollection GET /collections/{collection} Get collection details
CollectionApi listCollectionScores GET /collections/{collection}/scores List the scores contained in a collection
CollectionApi listCollections GET /collections List the collections
CollectionApi untrashCollection POST /collections/{collection}/untrash Untrash a collection
GroupApi getGroupDetails GET /groups/{group} Get group information
GroupApi getGroupScores GET /groups/{group}/scores List group's scores
GroupApi listGroupUsers GET /groups/{group}/users List group's users
OrganizationApi createLtiCredentials POST /organizations/lti/credentials Create a new couple of LTI 1.x credentials
OrganizationApi createOrganizationInvitation POST /organizations/invitations Create a new invitation to join the organization
OrganizationApi createOrganizationUser POST /organizations/users Create a new user account
OrganizationApi listLtiCredentials GET /organizations/lti/credentials List LTI 1.x credentials
OrganizationApi listOrganizationInvitations GET /organizations/invitations List the organization invitations
OrganizationApi listOrganizationUsers GET /organizations/users List the organization users
OrganizationApi removeOrganizationInvitation DELETE /organizations/invitations/{invitation} Remove an organization invitation
OrganizationApi removeOrganizationUser DELETE /organizations/users/{user} Remove an account from Flat
OrganizationApi revokeLtiCredentials DELETE /organizations/lti/credentials/{credentials} Revoke LTI 1.x credentials
OrganizationApi updateOrganizationUser PUT /organizations/users/{user} Update account information
ScoreApi addScoreCollaborator POST /scores/{score}/collaborators Add a new collaborator
ScoreApi addScoreTrack POST /scores/{score}/tracks Add a new video or audio track to the score
ScoreApi createScore POST /scores Create a new score
ScoreApi createScoreRevision POST /scores/{score}/revisions Create a new revision
ScoreApi deleteScore DELETE /scores/{score} Delete a score
ScoreApi deleteScoreComment DELETE /scores/{score}/comments/{comment} Delete a comment
ScoreApi deleteScoreTrack DELETE /scores/{score}/tracks/{track} Remove an audio or video track linked to the score
ScoreApi editScore PUT /scores/{score} Edit a score's metadata
ScoreApi forkScore POST /scores/{score}/fork Fork a score
ScoreApi gerUserLikes GET /users/{user}/likes List liked scores
ScoreApi getGroupScores GET /groups/{group}/scores List group's scores
ScoreApi getScore GET /scores/{score} Get a score's metadata
ScoreApi getScoreCollaborator GET /scores/{score}/collaborators/{collaborator} Get a collaborator
ScoreApi getScoreCollaborators GET /scores/{score}/collaborators List the collaborators
ScoreApi getScoreComments GET /scores/{score}/comments List comments
ScoreApi getScoreRevision GET /scores/{score}/revisions/{revision} Get a score revision
ScoreApi getScoreRevisionData GET /scores/{score}/revisions/{revision}/{format} Get a score revision data
ScoreApi getScoreRevisions GET /scores/{score}/revisions List the revisions
ScoreApi getScoreSubmissions GET /scores/{score}/submissions List submissions related to the score
ScoreApi getScoreTrack GET /scores/{score}/tracks/{track} Retrieve the details of an audio or video track linked to a score
ScoreApi getUserScores GET /users/{user}/scores List user's scores
ScoreApi listScoreTracks GET /scores/{score}/tracks List the audio or video tracks linked to a score
ScoreApi markScoreCommentResolved PUT /scores/{score}/comments/{comment}/resolved Mark the comment as resolved
ScoreApi markScoreCommentUnresolved DELETE /scores/{score}/comments/{comment}/resolved Mark the comment as unresolved
ScoreApi postScoreComment POST /scores/{score}/comments Post a new comment
ScoreApi removeScoreCollaborator DELETE /scores/{score}/collaborators/{collaborator} Delete a collaborator
ScoreApi untrashScore POST /scores/{score}/untrash Untrash a score
ScoreApi updateScoreComment PUT /scores/{score}/comments/{comment} Update an existing comment
ScoreApi updateScoreTrack PUT /scores/{score}/tracks/{track} Update an audio or video track linked to a score
UserApi gerUserLikes GET /users/{user}/likes List liked scores
UserApi getUser GET /users/{user} Get a public user profile
UserApi getUserScores GET /users/{user}/scores List 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.

Author

developers@flat.io, (*13)

The Versions

26/04 2018

dev-master

9999999-dev https://github.com/FlatIO/api-client-php

PHP client for the Flat REST API

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

music openapi musicxml midi music notation sheet music music score

26/04 2018

0.8.2

0.8.2.0 https://github.com/FlatIO/api-client-php

PHP client for the Flat REST API

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

music openapi musicxml midi music notation sheet music music score

25/04 2018

0.8.1

0.8.1.0 https://github.com/FlatIO/api-client-php

PHP client for the Flat REST API

  Sources   Download

Apache-2.0

The Requires

  • php >=5.6
  • ext-curl *
  • ext-json *
  • ext-mbstring *

 

The Development Requires

music openapi musicxml midi music notation sheet music music score

23/04 2018

0.8.0

0.8.0.0 https://github.com/FlatIO/api-client-php

PHP client for the Flat REST API

  Sources   Download

Apache-2.0

The Requires

  • php >=5.6
  • ext-curl *
  • ext-json *
  • ext-mbstring *

 

The Development Requires

music openapi musicxml midi music notation sheet music music score

04/10 2017

2.4.x-dev

2.4.9999999.9999999-dev https://github.com/FlatIO/api-client-php

PHP client for the Flat REST API

  Sources   Download

Apache-2.0

The Requires

  • php >=5.6
  • ext-curl *
  • ext-json *
  • ext-mbstring *

 

The Development Requires

music openapi musicxml midi music notation sheet music music score

04/10 2017

0.7.0

0.7.0.0 https://github.com/FlatIO/api-client-php

PHP client for the Flat REST API

  Sources   Download

Apache-2.0

The Requires

  • php >=5.6
  • ext-curl *
  • ext-json *
  • ext-mbstring *

 

The Development Requires

music openapi musicxml midi music notation sheet music music score

28/08 2017

0.6.0

0.6.0.0 https://github.com/FlatIO/api-client-php

PHP client for the Flat REST API

  Sources   Download

Apache-2.0

The Requires

  • php >=5.6
  • ext-curl *
  • ext-json *
  • ext-mbstring *

 

The Development Requires

music openapi musicxml midi music notation sheet music music score

02/07 2017

0.5.0

0.5.0.0 https://github.com/FlatIO/api-client-php

PHP client for the Flat REST API

  Sources   Download

Apache-2.0

The Requires

  • php >=5.6
  • ext-curl *
  • ext-json *
  • ext-mbstring *

 

The Development Requires

music openapi musicxml midi music notation sheet music music score

09/04 2017

0.3.0

0.3.0.0 https://github.com/FlatIO/api-client-php

PHP client for the Flat REST API

  Sources   Download

Apache-2.0

The Requires

  • php >=5.6
  • ext-curl *
  • ext-json *
  • ext-mbstring *

 

The Development Requires

music openapi musicxml midi music notation sheet music music score

09/04 2017

0.2.0

0.2.0.0 https://github.com/FlatIO/api-client-php

PHP client for the Flat REST API

  Sources   Download

Apache-2.0

The Requires

  • php >=5.6
  • ext-curl *
  • ext-json *
  • ext-mbstring *

 

The Development Requires

music openapi musicxml midi music notation sheet music music score

09/04 2017

0.1.0

0.1.0.0 http://swagger.io

  Sources   Download

proprietary

The Requires

  • php >=5.4
  • ext-curl *
  • ext-json *
  • ext-mbstring *

 

The Development Requires

api php swagger sdk