mediasilo / phoenix-php-sdk
Installs: 2 988
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 6
Forks: 2
Open Issues: 3
Requires
- mdelano/oauth-php: 0.0.14
Requires (Dev)
- phpunit/phpunit: 3.7.*
- dev-master
- 0.8.1
- 0.8.0
- 0.7.501
- 0.7.59
- 0.7.58
- 0.7.57
- 0.7.56
- 0.7.55
- 0.7.54
- 0.7.53
- 0.7.52
- 0.7.51
- 0.7.6
- 0.7.5
- 0.7.4
- 0.7.3
- 0.7.2
- 0.7.1
- 0.7.0
- 0.6.9
- 0.6.8
- 0.6.7
- 0.6.6
- 0.6.5
- 0.6.4
- 0.6.3
- 0.6.2
- 0.6.1
- 0.6.0
- 0.5.14
- 0.5.13
- 0.5.12
- 0.5.11
- 0.5.10
- 0.5.9
- 0.5.8
- 0.5.7
- 0.5.6
- 0.5.5
- 0.5.4
- 0.5.3
- 0.5.2
- 0.5.1
- 0.5.0
- 0.4.9
- 0.4.8
- 0.4.7
- 0.4.6
- 0.4.5
- 0.4.4
- 0.4.3
- 0.4.2
- 0.4.1
- 0.4.0
- 0.3.2
- 0.3.1
- 0.3.0
- 0.2.1
- 0.2.0
- 0.1.9
- 0.1.0.x-dev
- 0.1.0
- dev-security-fixes
- dev-authid_add_ql_sdk
- dev-watermark
- dev-sdkhotfix
- dev-bugfix-pagination-wrap
- dev-sprites
- dev-oauthClientUpdate
- dev-commentCreateBug
- dev-oauthfix
- dev-responseHeaders
- dev-before-tori-broke-shit
This package is not auto-updated.
Last update: 2021-07-23 23:15:19 UTC
README
Overview
MediaSilo makes it easy to share and collaborate with your team and customers anywhere. Check out our full feature set here!
The SDK is built on top of our REST API. To learn more about our REST API have a look at our documentation here.
Requirements
The SDK is most easily used with Composer. To install Composer:
cd <YOUR PROJECT ROOT> curl -sS https://getcomposer.org/installer | php
Check to see that composer has been installed:
php composer.phar --version
Install the SDK's dependencies:
php composer.phar install
Install the SDK into your project
In the root of your project create a composer.json as follows. More info on getting started with composer can be found here.
{ "repositories": [ { "type": "vcs", "url": "https://github.com/mdelano/oauth-php" } ], "require" : { "mediasilo/phoenix-php-sdk": "0.7.6 } }
Next, install the SDK using
composer install
What can I do?
The MediaSiloAPI file is a wrapper to everything that the SDK can do for you. Refer to this file any time you want to see what functions are available to you.
Sample Usage
<?php require_once('vendor/autoload.php'); use mediasilo\MediaSiloAPI; // Set your credentials $username = "PoohBear"; $password = "T!gger!sPushy"; $host = "100acreforest"; // Instantiate client try { $mediaSiloAPI = MediaSiloAPI::createFromHostCredentials($username, $password, $host); } catch(\mediasilo\http\exception\NotAuthenticatedException $e) { print "Bad credentials. Cat on the keyboard? \n"; exit; } // Start making some calls $me = $mediaSiloAPI->me();
An Example
Getting Assets By Folder
... Initialize the API as shown above // Here's the project we're interested in traversing $projectId = "07706DCC-014B-2CE0-CF518D31A23C393E"; // Let's find everything at the root of the projects $rootLevelAssets = $mediaSiloApi->getAssetsByProject($projectId); $rootLevelFolders = $mediaSiloApi->getProjectFolders($projectId); // Ok, now let's traverse the prject to find the rest of the assets foreach($rootLevelFolders as $folder) { get_folder_contents($mediaSiloApi, $folder->id); } function get_folder_contents($mediaSiloApi, $folderId) { print "FolderId:".$folderId."\n"; try { $assets = $mediaSiloApi->getAssetsByFolder($folderId); var_dump($assets); } catch(NotFoundException $e) { print "There are not assets in this folder. Better get cracking and add some! \n"; } try { $subfolders = $mediaSiloApi->getSubfolders($folderId); foreach($subfolders as $subfolder) { get_folder_contents($mediaSiloApi, $subfolder->id); } } catch(NotFoundException $e) { print "No more folders here!"; } }