Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/flatio/api-client-php

🐘 PHP client for the Flat REST API
https://github.com/flatio/api-client-php

api-client composer education flat-api midi music-notation musicxml php php-client score

Last synced: about 1 month ago
JSON representation

🐘 PHP client for the Flat REST API

Awesome Lists containing this project

README

        

# PHP Client for the Flat REST API

[![Build Status](https://travis-ci.org/FlatIO/api-client-php.svg?branch=master)](https://travis-ci.org/FlatIO/api-client-php)
[![Packagist](https://img.shields.io/packagist/v/flat/api.svg)](https://packagist.org/packages/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 Python package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project.

## Requirements

PHP 5.6.0 and later

## Installation & Usage
### Composer

To install the bindings via [Composer](http://getcomposer.org/), add the following to `composer.json`:

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

```

Then run `composer install`

### Manual Installation

Download the files and include `autoload.php`:

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

## Tests

To run the unit tests:

```
composer install
./vendor/bin/phpunit
```

## Getting Started

Please follow the [installation procedure](#installation--usage) and then run the following:

```php
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*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*AccountApi* | [**getAuthenticatedUser**](docs/Api/AccountApi.md#getauthenticateduser) | **GET** /me | Get current user profile
*ClassApi* | [**activateClass**](docs/Api/ClassApi.md#activateclass) | **POST** /classes/{class}/activate | Activate the class
*ClassApi* | [**addClassUser**](docs/Api/ClassApi.md#addclassuser) | **PUT** /classes/{class}/users/{user} | Add a user to the class
*ClassApi* | [**archiveClass**](docs/Api/ClassApi.md#archiveclass) | **POST** /classes/{class}/archive | Archive the class
*ClassApi* | [**copyAssignment**](docs/Api/ClassApi.md#copyassignment) | **POST** /classes/{class}/assignments/{assignment}/copy | Copy an assignment
*ClassApi* | [**createAssignment**](docs/Api/ClassApi.md#createassignment) | **POST** /classes/{class}/assignments | Assignment creation
*ClassApi* | [**createClass**](docs/Api/ClassApi.md#createclass) | **POST** /classes | Create a new class
*ClassApi* | [**createSubmission**](docs/Api/ClassApi.md#createsubmission) | **PUT** /classes/{class}/assignments/{assignment}/submissions | Create or edit a submission
*ClassApi* | [**deleteClassUser**](docs/Api/ClassApi.md#deleteclassuser) | **DELETE** /classes/{class}/users/{user} | Remove a user from the class
*ClassApi* | [**editSubmission**](docs/Api/ClassApi.md#editsubmission) | **PUT** /classes/{class}/assignments/{assignment}/submissions/{submission} | Edit a submission
*ClassApi* | [**enrollClass**](docs/Api/ClassApi.md#enrollclass) | **POST** /classes/enroll/{enrollmentCode} | Join a class
*ClassApi* | [**getClass**](docs/Api/ClassApi.md#getclass) | **GET** /classes/{class} | Get the details of a single class
*ClassApi* | [**getScoreSubmissions**](docs/Api/ClassApi.md#getscoresubmissions) | **GET** /scores/{score}/submissions | List submissions related to the score
*ClassApi* | [**getSubmission**](docs/Api/ClassApi.md#getsubmission) | **GET** /classes/{class}/assignments/{assignment}/submissions/{submission} | Get a student submission
*ClassApi* | [**getSubmissions**](docs/Api/ClassApi.md#getsubmissions) | **GET** /classes/{class}/assignments/{assignment}/submissions | List the students' submissions
*ClassApi* | [**listAssignments**](docs/Api/ClassApi.md#listassignments) | **GET** /classes/{class}/assignments | Assignments listing
*ClassApi* | [**listClassStudentSubmissions**](docs/Api/ClassApi.md#listclassstudentsubmissions) | **GET** /classes/{class}/students/{user}/submissions | List the submissions for a student
*ClassApi* | [**listClasses**](docs/Api/ClassApi.md#listclasses) | **GET** /classes | List the classes available for the current user
*ClassApi* | [**unarchiveClass**](docs/Api/ClassApi.md#unarchiveclass) | **DELETE** /classes/{class}/archive | Unarchive the class
*ClassApi* | [**updateClass**](docs/Api/ClassApi.md#updateclass) | **PUT** /classes/{class} | Update the class
*CollectionApi* | [**addScoreToCollection**](docs/Api/CollectionApi.md#addscoretocollection) | **PUT** /collections/{collection}/scores/{score} | Add a score to the collection
*CollectionApi* | [**createCollection**](docs/Api/CollectionApi.md#createcollection) | **POST** /collections | Create a new collection
*CollectionApi* | [**deleteCollection**](docs/Api/CollectionApi.md#deletecollection) | **DELETE** /collections/{collection} | Delete the collection
*CollectionApi* | [**deleteScoreFromCollection**](docs/Api/CollectionApi.md#deletescorefromcollection) | **DELETE** /collections/{collection}/scores/{score} | Delete a score from the collection
*CollectionApi* | [**editCollection**](docs/Api/CollectionApi.md#editcollection) | **PUT** /collections/{collection} | Update a collection's metadata
*CollectionApi* | [**getCollection**](docs/Api/CollectionApi.md#getcollection) | **GET** /collections/{collection} | Get collection details
*CollectionApi* | [**listCollectionScores**](docs/Api/CollectionApi.md#listcollectionscores) | **GET** /collections/{collection}/scores | List the scores contained in a collection
*CollectionApi* | [**listCollections**](docs/Api/CollectionApi.md#listcollections) | **GET** /collections | List the collections
*CollectionApi* | [**untrashCollection**](docs/Api/CollectionApi.md#untrashcollection) | **POST** /collections/{collection}/untrash | Untrash a collection
*GroupApi* | [**getGroupDetails**](docs/Api/GroupApi.md#getgroupdetails) | **GET** /groups/{group} | Get group information
*GroupApi* | [**getGroupScores**](docs/Api/GroupApi.md#getgroupscores) | **GET** /groups/{group}/scores | List group's scores
*GroupApi* | [**listGroupUsers**](docs/Api/GroupApi.md#listgroupusers) | **GET** /groups/{group}/users | List group's users
*OrganizationApi* | [**createLtiCredentials**](docs/Api/OrganizationApi.md#createlticredentials) | **POST** /organizations/lti/credentials | Create a new couple of LTI 1.x credentials
*OrganizationApi* | [**createOrganizationInvitation**](docs/Api/OrganizationApi.md#createorganizationinvitation) | **POST** /organizations/invitations | Create a new invitation to join the organization
*OrganizationApi* | [**createOrganizationUser**](docs/Api/OrganizationApi.md#createorganizationuser) | **POST** /organizations/users | Create a new user account
*OrganizationApi* | [**listLtiCredentials**](docs/Api/OrganizationApi.md#listlticredentials) | **GET** /organizations/lti/credentials | List LTI 1.x credentials
*OrganizationApi* | [**listOrganizationInvitations**](docs/Api/OrganizationApi.md#listorganizationinvitations) | **GET** /organizations/invitations | List the organization invitations
*OrganizationApi* | [**listOrganizationUsers**](docs/Api/OrganizationApi.md#listorganizationusers) | **GET** /organizations/users | List the organization users
*OrganizationApi* | [**removeOrganizationInvitation**](docs/Api/OrganizationApi.md#removeorganizationinvitation) | **DELETE** /organizations/invitations/{invitation} | Remove an organization invitation
*OrganizationApi* | [**removeOrganizationUser**](docs/Api/OrganizationApi.md#removeorganizationuser) | **DELETE** /organizations/users/{user} | Remove an account from Flat
*OrganizationApi* | [**revokeLtiCredentials**](docs/Api/OrganizationApi.md#revokelticredentials) | **DELETE** /organizations/lti/credentials/{credentials} | Revoke LTI 1.x credentials
*OrganizationApi* | [**updateOrganizationUser**](docs/Api/OrganizationApi.md#updateorganizationuser) | **PUT** /organizations/users/{user} | Update account information
*ScoreApi* | [**addScoreCollaborator**](docs/Api/ScoreApi.md#addscorecollaborator) | **POST** /scores/{score}/collaborators | Add a new collaborator
*ScoreApi* | [**addScoreTrack**](docs/Api/ScoreApi.md#addscoretrack) | **POST** /scores/{score}/tracks | Add a new video or audio track to the score
*ScoreApi* | [**createScore**](docs/Api/ScoreApi.md#createscore) | **POST** /scores | Create a new score
*ScoreApi* | [**createScoreRevision**](docs/Api/ScoreApi.md#createscorerevision) | **POST** /scores/{score}/revisions | Create a new revision
*ScoreApi* | [**deleteScore**](docs/Api/ScoreApi.md#deletescore) | **DELETE** /scores/{score} | Delete a score
*ScoreApi* | [**deleteScoreComment**](docs/Api/ScoreApi.md#deletescorecomment) | **DELETE** /scores/{score}/comments/{comment} | Delete a comment
*ScoreApi* | [**deleteScoreTrack**](docs/Api/ScoreApi.md#deletescoretrack) | **DELETE** /scores/{score}/tracks/{track} | Remove an audio or video track linked to the score
*ScoreApi* | [**editScore**](docs/Api/ScoreApi.md#editscore) | **PUT** /scores/{score} | Edit a score's metadata
*ScoreApi* | [**forkScore**](docs/Api/ScoreApi.md#forkscore) | **POST** /scores/{score}/fork | Fork a score
*ScoreApi* | [**gerUserLikes**](docs/Api/ScoreApi.md#geruserlikes) | **GET** /users/{user}/likes | List liked scores
*ScoreApi* | [**getGroupScores**](docs/Api/ScoreApi.md#getgroupscores) | **GET** /groups/{group}/scores | List group's scores
*ScoreApi* | [**getScore**](docs/Api/ScoreApi.md#getscore) | **GET** /scores/{score} | Get a score's metadata
*ScoreApi* | [**getScoreCollaborator**](docs/Api/ScoreApi.md#getscorecollaborator) | **GET** /scores/{score}/collaborators/{collaborator} | Get a collaborator
*ScoreApi* | [**getScoreCollaborators**](docs/Api/ScoreApi.md#getscorecollaborators) | **GET** /scores/{score}/collaborators | List the collaborators
*ScoreApi* | [**getScoreComments**](docs/Api/ScoreApi.md#getscorecomments) | **GET** /scores/{score}/comments | List comments
*ScoreApi* | [**getScoreRevision**](docs/Api/ScoreApi.md#getscorerevision) | **GET** /scores/{score}/revisions/{revision} | Get a score revision
*ScoreApi* | [**getScoreRevisionData**](docs/Api/ScoreApi.md#getscorerevisiondata) | **GET** /scores/{score}/revisions/{revision}/{format} | Get a score revision data
*ScoreApi* | [**getScoreRevisions**](docs/Api/ScoreApi.md#getscorerevisions) | **GET** /scores/{score}/revisions | List the revisions
*ScoreApi* | [**getScoreSubmissions**](docs/Api/ScoreApi.md#getscoresubmissions) | **GET** /scores/{score}/submissions | List submissions related to the score
*ScoreApi* | [**getScoreTrack**](docs/Api/ScoreApi.md#getscoretrack) | **GET** /scores/{score}/tracks/{track} | Retrieve the details of an audio or video track linked to a score
*ScoreApi* | [**getUserScores**](docs/Api/ScoreApi.md#getuserscores) | **GET** /users/{user}/scores | List user's scores
*ScoreApi* | [**listScoreTracks**](docs/Api/ScoreApi.md#listscoretracks) | **GET** /scores/{score}/tracks | List the audio or video tracks linked to a score
*ScoreApi* | [**markScoreCommentResolved**](docs/Api/ScoreApi.md#markscorecommentresolved) | **PUT** /scores/{score}/comments/{comment}/resolved | Mark the comment as resolved
*ScoreApi* | [**markScoreCommentUnresolved**](docs/Api/ScoreApi.md#markscorecommentunresolved) | **DELETE** /scores/{score}/comments/{comment}/resolved | Mark the comment as unresolved
*ScoreApi* | [**postScoreComment**](docs/Api/ScoreApi.md#postscorecomment) | **POST** /scores/{score}/comments | Post a new comment
*ScoreApi* | [**removeScoreCollaborator**](docs/Api/ScoreApi.md#removescorecollaborator) | **DELETE** /scores/{score}/collaborators/{collaborator} | Delete a collaborator
*ScoreApi* | [**untrashScore**](docs/Api/ScoreApi.md#untrashscore) | **POST** /scores/{score}/untrash | Untrash a score
*ScoreApi* | [**updateScoreComment**](docs/Api/ScoreApi.md#updatescorecomment) | **PUT** /scores/{score}/comments/{comment} | Update an existing comment
*ScoreApi* | [**updateScoreTrack**](docs/Api/ScoreApi.md#updatescoretrack) | **PUT** /scores/{score}/tracks/{track} | Update an audio or video track linked to a score
*UserApi* | [**gerUserLikes**](docs/Api/UserApi.md#geruserlikes) | **GET** /users/{user}/likes | List liked scores
*UserApi* | [**getUser**](docs/Api/UserApi.md#getuser) | **GET** /users/{user} | Get a public user profile
*UserApi* | [**getUserScores**](docs/Api/UserApi.md#getuserscores) | **GET** /users/{user}/scores | List user's scores

## Documentation For Models

- [Assignment](docs/Model/Assignment.md)
- [AssignmentCopy](docs/Model/AssignmentCopy.md)
- [AssignmentCreation](docs/Model/AssignmentCreation.md)
- [AssignmentSubmission](docs/Model/AssignmentSubmission.md)
- [AssignmentSubmissionUpdate](docs/Model/AssignmentSubmissionUpdate.md)
- [ClassAttachmentCreation](docs/Model/ClassAttachmentCreation.md)
- [ClassCreation](docs/Model/ClassCreation.md)
- [ClassDetails](docs/Model/ClassDetails.md)
- [ClassDetailsCanvas](docs/Model/ClassDetailsCanvas.md)
- [ClassDetailsClever](docs/Model/ClassDetailsClever.md)
- [ClassDetailsGoogleClassroom](docs/Model/ClassDetailsGoogleClassroom.md)
- [ClassDetailsGoogleDrive](docs/Model/ClassDetailsGoogleDrive.md)
- [ClassDetailsLti](docs/Model/ClassDetailsLti.md)
- [ClassRoles](docs/Model/ClassRoles.md)
- [ClassState](docs/Model/ClassState.md)
- [ClassUpdate](docs/Model/ClassUpdate.md)
- [Collection](docs/Model/Collection.md)
- [CollectionCapabilities](docs/Model/CollectionCapabilities.md)
- [CollectionCreation](docs/Model/CollectionCreation.md)
- [CollectionModification](docs/Model/CollectionModification.md)
- [CollectionPrivacy](docs/Model/CollectionPrivacy.md)
- [CollectionTitle](docs/Model/CollectionTitle.md)
- [CollectionType](docs/Model/CollectionType.md)
- [FlatErrorResponse](docs/Model/FlatErrorResponse.md)
- [FlatLocales](docs/Model/FlatLocales.md)
- [GoogleClassroomCoursework](docs/Model/GoogleClassroomCoursework.md)
- [GoogleClassroomSubmission](docs/Model/GoogleClassroomSubmission.md)
- [Group](docs/Model/Group.md)
- [GroupDetails](docs/Model/GroupDetails.md)
- [GroupType](docs/Model/GroupType.md)
- [LicenseMode](docs/Model/LicenseMode.md)
- [LicenseSources](docs/Model/LicenseSources.md)
- [LmsName](docs/Model/LmsName.md)
- [LtiCredentials](docs/Model/LtiCredentials.md)
- [LtiCredentialsCreation](docs/Model/LtiCredentialsCreation.md)
- [MediaAttachment](docs/Model/MediaAttachment.md)
- [MediaScoreSharingMode](docs/Model/MediaScoreSharingMode.md)
- [OrganizationInvitation](docs/Model/OrganizationInvitation.md)
- [OrganizationInvitationCreation](docs/Model/OrganizationInvitationCreation.md)
- [OrganizationRoles](docs/Model/OrganizationRoles.md)
- [ResourceCollaboratorCreation](docs/Model/ResourceCollaboratorCreation.md)
- [ResourceRights](docs/Model/ResourceRights.md)
- [ResourceSharingKey](docs/Model/ResourceSharingKey.md)
- [ScoreComment](docs/Model/ScoreComment.md)
- [ScoreCommentContext](docs/Model/ScoreCommentContext.md)
- [ScoreCommentCreation](docs/Model/ScoreCommentCreation.md)
- [ScoreCommentUpdate](docs/Model/ScoreCommentUpdate.md)
- [ScoreCommentsCounts](docs/Model/ScoreCommentsCounts.md)
- [ScoreCreation](docs/Model/ScoreCreation.md)
- [ScoreCreationType](docs/Model/ScoreCreationType.md)
- [ScoreData](docs/Model/ScoreData.md)
- [ScoreDataEncoding](docs/Model/ScoreDataEncoding.md)
- [ScoreFork](docs/Model/ScoreFork.md)
- [ScoreLicense](docs/Model/ScoreLicense.md)
- [ScoreLikesCounts](docs/Model/ScoreLikesCounts.md)
- [ScoreModification](docs/Model/ScoreModification.md)
- [ScorePrivacy](docs/Model/ScorePrivacy.md)
- [ScoreRevision](docs/Model/ScoreRevision.md)
- [ScoreRevisionCreation](docs/Model/ScoreRevisionCreation.md)
- [ScoreRevisionStatistics](docs/Model/ScoreRevisionStatistics.md)
- [ScoreSource](docs/Model/ScoreSource.md)
- [ScoreSummary](docs/Model/ScoreSummary.md)
- [ScoreTrack](docs/Model/ScoreTrack.md)
- [ScoreTrackCreation](docs/Model/ScoreTrackCreation.md)
- [ScoreTrackPoint](docs/Model/ScoreTrackPoint.md)
- [ScoreTrackState](docs/Model/ScoreTrackState.md)
- [ScoreTrackType](docs/Model/ScoreTrackType.md)
- [ScoreTrackUpdate](docs/Model/ScoreTrackUpdate.md)
- [ScoreViewsCounts](docs/Model/ScoreViewsCounts.md)
- [UserAdminUpdate](docs/Model/UserAdminUpdate.md)
- [UserBasics](docs/Model/UserBasics.md)
- [UserCreation](docs/Model/UserCreation.md)
- [UserDetailsAdminLicense](docs/Model/UserDetailsAdminLicense.md)
- [UserInstruments](docs/Model/UserInstruments.md)
- [ResourceCollaborator](docs/Model/ResourceCollaborator.md)
- [ScoreDetails](docs/Model/ScoreDetails.md)
- [UserPublicSummary](docs/Model/UserPublicSummary.md)
- [UserDetailsAdmin](docs/Model/UserDetailsAdmin.md)
- [UserPublic](docs/Model/UserPublic.md)
- [UserDetails](docs/Model/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.

## Author

[email protected]