flat / api
PHP client for the Flat REST API
Requires
- php: >=5.6
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^6.2
Requires (Dev)
- friendsofphp/php-cs-fixer: ~1.12
- phpunit/phpunit: ^4.8
- squizlabs/php_codesniffer: ~2.6
This package is not auto-updated.
Last update: 2024-11-10 02:40:01 UTC
README
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 Python package is automatically generated by the Swagger Codegen project.
Requirements
PHP 5.6.0 and later
Installation & Usage
Composer
To install the bindings via Composer, 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
:
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 and then run the following:
<?php require_once(__DIR__ . '/vendor/autoload.php'); // Configure OAuth2 access token for authorization: OAuth2 $config = Flat\APIClient\Configuration::getDefaultConfiguration()->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
Documentation For Models
- Assignment
- AssignmentCopy
- AssignmentCreation
- AssignmentSubmission
- AssignmentSubmissionUpdate
- ClassAttachmentCreation
- ClassCreation
- ClassDetails
- ClassDetailsCanvas
- ClassDetailsClever
- ClassDetailsGoogleClassroom
- ClassDetailsGoogleDrive
- ClassDetailsLti
- ClassRoles
- ClassState
- ClassUpdate
- Collection
- CollectionCapabilities
- CollectionCreation
- CollectionModification
- CollectionPrivacy
- CollectionTitle
- CollectionType
- FlatErrorResponse
- FlatLocales
- GoogleClassroomCoursework
- GoogleClassroomSubmission
- Group
- GroupDetails
- GroupType
- LicenseMode
- LicenseSources
- LmsName
- LtiCredentials
- LtiCredentialsCreation
- MediaAttachment
- MediaScoreSharingMode
- OrganizationInvitation
- OrganizationInvitationCreation
- OrganizationRoles
- ResourceCollaboratorCreation
- ResourceRights
- ResourceSharingKey
- ScoreComment
- ScoreCommentContext
- ScoreCommentCreation
- ScoreCommentUpdate
- ScoreCommentsCounts
- ScoreCreation
- ScoreCreationType
- ScoreData
- ScoreDataEncoding
- ScoreFork
- ScoreLicense
- ScoreLikesCounts
- ScoreModification
- ScorePrivacy
- ScoreRevision
- ScoreRevisionCreation
- ScoreRevisionStatistics
- ScoreSource
- ScoreSummary
- ScoreTrack
- ScoreTrackCreation
- ScoreTrackPoint
- ScoreTrackState
- ScoreTrackType
- ScoreTrackUpdate
- ScoreViewsCounts
- UserAdminUpdate
- UserBasics
- UserCreation
- UserDetailsAdminLicense
- UserInstruments
- ResourceCollaborator
- ScoreDetails
- UserPublicSummary
- UserDetailsAdmin
- UserPublic
- UserDetails
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.