PHP code example of om-hosting / openmeetings-php-client

1. Go to this page and download the library: Download om-hosting/openmeetings-php-client 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/ */

    

om-hosting / openmeetings-php-client example snippets


        $BASE_URL = "http://localhost:5080/openmeetings";
    
        //1. Login to service
        $config = new Configuration();
        $config->setHost($BASE_URL . '/services');
        $userApiInstance = new UserServiceApi(null, $config);
        $serviceResultLoginWrapper = $userApiInstance->login("soapuser", "!HansHans1");
        if ($serviceResultLoginWrapper->getServiceResult()->getType() != "SUCCESS") {
            $text = "Login Failed " . $serviceResultLoginWrapper->getServiceResult()->getMessage();
            return view('hello_index', ['text' => $text]);
        }
        $sid = $serviceResultLoginWrapper->getServiceResult()->getMessage();

        // 2. Generate Hash for entering a conference room
        $serviceResultHashWrapper = $userApiInstance->getRoomHash($sid,
            new ExternalUserDTO(
                array(
                    "firstname" => "John",
                    "lastname" => "Doe",
                    "external_id" => "uniqueId1",
                    "external_type" => "myCMS",
                    "login" => "john.doe",
                    "email" => "[email protected]"
                )
            ),
            new RoomOptionsDTO(
                array(
                    "room_id" => 2,
                    "moderator" => true
                )
            )
        );

        // 3. Construct Login URL
        $hash = $serviceResultHashWrapper->getServiceResult()->getMessage();
        $url = $this->BASE_URL . "/hash?secure=".$hash;

    


Instance = new Swagger\Client\Api\CalendarServiceApi(
    // 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()
);
$sid = "sid_example"; // string | The SID of the User. This SID must be marked as Loggedin
$id = 789; // int | the id to delete

try {
    $result = $apiInstance->delete($sid, $id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CalendarServiceApi->delete: ', $e->getMessage(), PHP_EOL;
}

$apiInstance = new Swagger\Client\Api\CalendarServiceApi(
    // 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()
);
$sid = "sid_example"; // string | The SID of the User. This SID must be marked as Loggedin
$roomid = 789; // int | id of appointment special room

try {
    $result = $apiInstance->getByRoom($sid, $roomid);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CalendarServiceApi->getByRoom: ', $e->getMessage(), PHP_EOL;
}

$apiInstance = new Swagger\Client\Api\CalendarServiceApi(
    // 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()
);
$sid = "sid_example"; // string | The SID of the User. This SID must be marked as Loggedin
$title = "title_example"; // string | the search string

try {
    $result = $apiInstance->getByTitle($sid, $title);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CalendarServiceApi->getByTitle: ', $e->getMessage(), PHP_EOL;
}

$apiInstance = new Swagger\Client\Api\CalendarServiceApi(
    // 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()
);
$sid = "sid_example"; // string | The SID of the User. This SID must be marked as Loggedin

try {
    $result = $apiInstance->next($sid);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CalendarServiceApi->next: ', $e->getMessage(), PHP_EOL;
}

$apiInstance = new Swagger\Client\Api\CalendarServiceApi(
    // 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()
);
$sid = "sid_example"; // string | The SID of the User. This SID must be marked as Loggedin
$userid = 789; // int | the userId the calendar events should be loaded

try {
    $result = $apiInstance->nextForUser($sid, $userid);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CalendarServiceApi->nextForUser: ', $e->getMessage(), PHP_EOL;
}

$apiInstance = new Swagger\Client\Api\CalendarServiceApi(
    // 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()
);
$sid = "sid_example"; // string | The SID of the User. This SID must be marked as Loggedin
$start = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | start time
$end = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | end time

try {
    $result = $apiInstance->range($sid, $start, $end);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CalendarServiceApi->range: ', $e->getMessage(), PHP_EOL;
}

$apiInstance = new Swagger\Client\Api\CalendarServiceApi(
    // 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()
);
$sid = "sid_example"; // string | The SID of the User. This SID must be marked as Loggedin
$userid = 789; // int | the userId the calendar events should be loaded
$start = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | start time
$end = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | end time

try {
    $result = $apiInstance->rangeForUser($sid, $userid, $start, $end);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CalendarServiceApi->rangeForUser: ', $e->getMessage(), PHP_EOL;
}

$apiInstance = new Swagger\Client\Api\CalendarServiceApi(
    // 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()
);
$sid = "sid_example"; // string | The SID of the User. This SID must be marked as Loggedin
$appointment = new \Swagger\Client\Model\AppointmentDTO(); // \Swagger\Client\Model\AppointmentDTO | 

try {
    $result = $apiInstance->save($sid, $appointment);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CalendarServiceApi->save: ', $e->getMessage(), PHP_EOL;
}
bash
php composer.phar install openmeetings-php-client

{
  "repositories": [
    {
      "type": "git",
      "url": "https://github.com/om-hosting/openmeetings-php-client.git"
    }
  ],
  "