This is an automated email from the ASF dual-hosted git repository. sebawagner pushed a commit to branch feature/OPENMEETINGS-2674-update-with-php-example in repository https://gitbox.apache.org/repos/asf/openmeetings.git
commit f30ddd6597f8e495dba2725cbe9fc554d40ee6ba Author: Sebastian Wagner <seba.wag...@gmail.com> AuthorDate: Sun Sep 26 14:52:42 2021 +1300 OPENMEETINGS-2674 Update and add section for PHP Composer client module. --- .../src/site/xdoc/RestAPISample.xml | 60 ++++++++++++++++++++++ openmeetings-server/src/site/xdoc/index.xml | 15 ++++++ 2 files changed, 75 insertions(+) diff --git a/openmeetings-server/src/site/xdoc/RestAPISample.xml b/openmeetings-server/src/site/xdoc/RestAPISample.xml index f34520d..f8823f5 100644 --- a/openmeetings-server/src/site/xdoc/RestAPISample.xml +++ b/openmeetings-server/src/site/xdoc/RestAPISample.xml @@ -39,6 +39,66 @@ </div> </div> </section> + <section name="How to integrate using PHP and composer"> + <p>You can integrate OpenMeetings via the Rest API into your PHP project.</p> + <div class="bd-callout bd-callout-info"> + There is a community sponsored free module for integrating with see: <a href="https://github.com/om-hosting/openmeetings-php-client" target="_blank">openmeetings-php-client</a> + </div> + <p>Install the module</p> +<source> +php composer.phar install openmeetings-php-client +</source> + <p>Eg generate a unique hash to enter a conference room:</p> + <ol> + <li>Login to service</li> + <li>Generate Hash for entering a conference room</li> + <li>Construct Login URL</li> + </ol> +<source> +$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" => "john....@gmail.com" + ) + ), + new RoomOptionsDTO( + array( + "room_id" => 2, + "moderator" => true + ) + ) +); + +// 3. Construct Login URL +$hash = $serviceResultHashWrapper->getServiceResult()->getMessage(); +$url = $this->BASE_URL . "/hash?secure=".$hash; +</source> + <p>Full sample source code can be found at <a href="https://github.com/om-hosting/openmeetings-php-laravel-sample-project" target="_BLANK">https://github.com/om-hosting/openmeetings-php-laravel-sample-project</a> + </p> + <p>You can find details about all API endpoints and examples at <a href="https://github.com/om-hosting/openmeetings-php-client#documentation-for-api-endpoints" target="_blank">https://github.com/om-hosting/openmeetings-php-client#documentation-for-api-endpoints</a></p> + <div class="bd-callout bd-callout-info"> + A sample PHP use case for a website using Laravel can be found here: <a href="https://om-hosting.com/openmeetings-integration-php-composer/" target="_BLANK">https://om-hosting.com/openmeetings-integration-php-composer/</a> + </div> + </section> <section name="How to integrate using Node.js"> <p>You can integrate OpenMeetings via the Rest API into your Node project.</p> <div class="bd-callout bd-callout-info"> diff --git a/openmeetings-server/src/site/xdoc/index.xml b/openmeetings-server/src/site/xdoc/index.xml index e6b14ad..61ef6ea 100644 --- a/openmeetings-server/src/site/xdoc/index.xml +++ b/openmeetings-server/src/site/xdoc/index.xml @@ -69,6 +69,21 @@ </section> <section name="News"> <div class="bd-callout bd-callout-danger"> + <div class="h4">PHP integration using composer module</div> + <div>You can now use a community contributed PHP composer module to make integration to OpenMeetings easier<br/><br/> + More information: + <ul> + <li>NPM module <a href="https://github.com/om-hosting/openmeetings-php-client" target="_blank">OpenMeetings PHP Client</a></li> + <li>OpenMeetings <a href="RestAPISample.html#how-to-integrate-using-php-and-composer">PHP Rest API sample</a></li> + </ul> + The PHP module makes use of the OpenMeetings Rest API which is now also available in OpenAPI 3.0 format: <a href="https://openmeetings.apache.org/swagger/" target="_blank">https://openmeetings.apache.org/swagger/</a> + <br/> + You can find details about all API endpoints and examples at <a href="https://github.com/om-hosting/openmeetings-php-client#documentation-for-api-endpoints" target="_blank">https://github.com/om-hosting/openmeetings-php-client#documentation-for-api-endpoints</a> + </div> + <br/> + <span class="date">(2021-09-26)</span> + </div> + <div class="bd-callout bd-callout-danger"> <div class="h4">OpenAPI, Swagger and Node.js integration</div> <div>You can now use a community contributed Node.js module as well as use the OpenAPI Swagger Spec to make integration to OpenMeetings easier<br/><br/> More information: