Establish Connection to Panotpo-API
Hi!
I use the script provided at https://github.com/lucisgit/php-panopto-api to connect to your api. Anything i get is:
Fatal error: Uncaught SoapFault exception: [client] System error. in /xxxx/panopto-prototyp/tests/auth_gsma.php:34 Stack trace: #0 /xxxx/panopto-prototyp/index.php(14): include() #1 {main} thrown in /xxxx/panopto-prototyp/tests/auth_gsma.php on line 34
my defines:
define ("PP_HOST", "kmu.cloud.panopto.eu");
define ("PP_CLIENT_NAME", "GSMA Localhost MBR");
define ("PP_CLIENT_ID", "d6bb9412-ec31-42b5-917c-ad91009e3799");
define ("PP_CLIENT_SECRET", "xxxxxxxx");
my script (sorry, i tried to add it as an upload - but your forum not allows that):
<?php
$username = "Bräu_Stefan";
// Create client instance for my.panopto.host.
$panoptoclient = new \Panopto\Client(PP_HOST);
// Create AuthenticationInfo instance with user crdentials.
$panoptoclient->setAuthenticationInfo('KMU\\' . $username, '', PP_CLIENT_ID);
// 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();
}
}
?>
Answers
Hi Stefan,
We are sorry but Panopto cannot help a problem specific to a development tool or development framework. We recommend that you consult the owner of the tool or framework.
Thanks,
Joe Malmsten