PHP code example of lucisgit / php-panopto-api

1. Go to this page and download the library: Download lucisgit/php-panopto-api library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

lucisgit / php-panopto-api example snippets




// This file is generated by Composer



// php-panopto-api content has been placed in `lib/panopto` sub-directory.



// This file is generated by Composer
st.
$panoptoclient = new \Panopto\Client('my.panopto.host');
// Create AuthenticationInfo instance with user crdentials.
$panoptoclient->setAuthenticationInfo('username', 'userpassword');

// Get AuthenticationInfo instance for using in calls.
$auth = $panoptoclient->getAuthenticationInfo();

// For example, get RemoteRecorderManagement webservice instance for
// accessing its methods.
$rrmclient = $panoptoclient->RemoteRecorderManagement();

// Let's list recorders for this simple example. According to API docs we need
// Pagination instance.
$page = 1;
$perpage = 10;
$pagination = new \Panopto\RemoteRecorderManagement\Pagination();
$pagination->setPageNumber($page);
$pagination->setMaxNumberResults($perpage);

// Prepare ListRecorders parameter instance, sort recorders by 'Name'.
$param = new \Panopto\RemoteRecorderManagement\ListRecorders($auth, $pagination, 'Name');

// Perform API call, this return value of ListRecordersResponse type.
try {
    $recorderslist = $rrmclient->ListRecorders($param)->getListRecordersResult();
} catch(Exception $e) {
    throw new SoapFault('client', $e->getMessage());
}

echo "Total recorders count: " . $recorderslist->TotalResultCount;

// Iterate through the list of recorders, each recorder is represented as
// RemoteRecorder type, see API docs for supported properties.
$recorders = $recorderslist->PagedResults->getRemoteRecorder();
foreach($recorders as $recorder) {
    echo "Recorder name: " . $recorder->getName();
    echo "Recorder IP: " . $recorder->getMachineIP();

    // Get devices, each device is represented as RemoteRecorderDevice type,
    // see API docs for supported properties.
    $devices = $recorder->getDevices()->getRemoteRecorderDevice();
    foreach($devices as $device) {
        echo "Device: " . $device->getDeviceType() . ': ' . $device->getName();
    }
}


// Create client instance for my.panopto.host.
$panoptoclient = new \Panopto\Client('my.panopto.host');

// Create AuthenticationInfo instance with user crdentials.
$panoptoclient->setAuthenticationInfo('MyInstanceName\username', '', '00000000-0000-0000-0000-000000000000');

// Get AuthenticationInfo instance for using in calls.
$auth = $panoptoclient->getAuthenticationInfo();
bash
$ php composer.phar 
bash
$ php generate_phpclasses.php
Using https://demo.hosted.panopto.com/Panopto/PublicAPI/4.6/ for webservices interface.
Generating \Panopto\AccessManagement classes...
Generating \Panopto\Auth classes...
Generating \Panopto\RemoteRecorderManagement classes...
Generating \Panopto\SessionManagement classes...
Generating \Panopto\UsageReporting classes...
Generating \Panopto\UserManagement classes...

PHP classess have been generated from Panopto API WSDL. Use /home/user/git/php-panopto-api/lib/Panopto/PublicAPI/4.6/<webservice>/autoload.php in your project.