Video SDK for CorePHP - Meet Hour
Published: 2023-06-08 15:08:14

# MeetHour-CorePHP-Example

[Meet Hour - 100% free video conference solution](https://meethour.io)
Meet Hour is 100% free video conference solution with End to End Encrypted and many other features such as lobby mode, Donor box & Click&Pledge Connect for fundraising, Video call recording, Youtube Live Stream etc.

# Features:

    ✅  Free Unlimited Time Group Video Conference
    ✅  Upto 100 Participants Group Meeting
    ✅  Free Video Conference Recording
    ✅  YouTube Live Stream
    ✅  Raise funds via Click&Pledge Connect & DonorBox
    ✅  Virtual Background
    ✅  Live Pad
    ✅  Screensharing on Desktop & Mobile and many other features.

# Try out one free session -

    1. Website - https://meethour.io
    2. Android - https://bit.ly/2U239ll
    3. iOS - https://apple.co/3k8Rpbn

### Composer package (Packagist) (Latest version - 1.0.1)

```
https://packagist.org/packages/meethour/php-sdk

```


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4b7q0v15thrv1rndjwuk.png)



# MeetHour SDK Implementation - Steps

1. SDK Example Link - https://github.com/v-empower/MeetHour-Web-MobileSDKs/tree/master/Web/PHP/CorePHP
2. API Documentation Link - https://docs.v-empower.com/docs/MeetHour-API/

## Install

```
composer require meethour/php-sdk

                OR

"require": {
        "meethour/php-sdk": "1.0.1"  // Composer Require
    }

require('./vendor/autoload.php');

require('./vendor/meethour/php-sdk/src/autoload.php');

```

### Steps to run the Example

1. First create a database in mysql -> meethour-php-example.sql
2. Go to meethour.io and signup for Developer or Higher plan. Currently we offer 28 days free trial.
3. Go to the dashboard and then click on developers menu.
4. Later go to constants.php and enter all the credentials of database and Meet Hour credentials as well.
5. On Home page Click on Get Access Token
6. Then Try Schedule a Meeting & Join Meeting.

### Usage

     Provide your credentials in the constructor of Login object and hit the login api to get your access token. Which will further be used for making rest of the api calls.

     <?php

     require('./vendor/autoload.php');
     require('./vendor/meethour/php-sdk/src/autoload.php');

     use MeetHourApp\Services\MHApiService;
     use MeetHourApp\Types\Login;
     use MeetHourApp\Types\ScheduleMeeting;

     $meetHourApiService = new MHApiService();
     $login = new Login($client_id, $client_secret, $grant_type, $username, $password);
     $loginResponse = $meetHourApiService->login($login);
     $scheduleBody = new ScheduleMeeting("Quick Meeting", "123456", date('h:i'), 'PM', date('d-m-Y'), 'Asia/Kolkata');  // You can give
     $response = $meetHourApiService->scheduleMeeting($loginResponse->access_token, $scheduleBody);
     var_dump($response);
     $test = new ViewMeeting($meeting_id);
     $response = $meetHourApiService->timezone($loginResponse->access_token);
     var_dump($response);

     ?>

#### Meet Hour - Join Meeting

We need to follow the Javascript SDK for Join Meetin Module - https://github.com/v-empower/MeetHour-Web-MobileSDKs/tree/master/Web/Javascript/Generic-Javascript

### API End Points Supported

Important points:
=> Instead of '{version}', you to pass our latest version whenever you call the given functions. Currently we are using v1.2 Same version applies to the below calls.
=> In the token section, you need to pass the received access token which is received when login api is hit, for making further api calls.
=> You can make API calls by passing required properties in the constructor. But, to meet special requirements you can set rest of the properties directly, according to your need. For more details go to https://docs.v-empower.com/docs/MeetHour-API then click on APIS section to get all the information related to each api call.

1. To Get Access Token Endpoint : => https://docs.v-empower.com/docs/MeetHour-API/a44a7d7669f91-user-login-get-access-token

   ```
       class Login {
           public ?string $client_id;
           public ?string $client_secret;
           public ?string $grant_type;
           public ?string $password;
           public ?string $username;
       }
       $body = new Login($client_id, $client_secret, $grant_type, $username, $password);
       MHApiServices.login($body);
   ```

   => You have to pass respective values in the argument section. Hence, to get desired response.

2. To schedule a meeting: => https://docs.v-empower.com/docs/MeetHour-API/2de4b757a6312-meeting-schedule-meeting

   ```
       class ScheduleMeeting {
           public ?string $agenda;
           public ?array $attend;
           public string $default_recording_storage;
           public ?int $duration_hr;
           public ?int $duration_min;
           public ?int $enable_pre_registration;
           public ?string $endBy;
           public ?string $end_date_time;
           public ?int $end_times;
           public ?array $groups;
           public ?array $hostusers;
           public ?string $instructions;
           public ?int $is_recurring;
           public ?int $is_show_portal;
           public ?string $meeting_agenda;
           public string $meeting_date;
           public string $meeting_meridiem;
           public string $meeting_name;
           public string $meeting_time;
           public ?string $meeting_topic;
           public ?string $monthlyBy;
           public ?string $monthlyByDay;
           public ?string $monthlyByWeekday;
           public ?string $monthlyByWeekdayIndex;
           public ?array $options;
           public string $passcode;
           public ?string $recurring_type;
           public ?int $repeat_interval;
           public int $send_calendar_invite;
           public string $timezone;
           public ?int $weeklyWeekDays;
       }

       $body = new ScheduleMeeting($meeting_name, $passcode, $meeting_time, $meeting_meridiem, $meeting_date, $timezone);
       MHApiServices.scheduleMeeting($token, $body);

   ```

3. To Generate JWT Token Endpoint => https://docs.v-empower.com/docs/MeetHour-API/b7e3d0ab3906f-generate-jwt

   ```
       class GenerateJwt {
           public string $meeting_id;
           public ?int $contact_id;
           public ?object $ui_config;
           public ?array $config;
       }

       $body = new GenerateJwt($meeting_id);
       MHApiServices.generateJwt($token, $body);
   ```

4. To fetch User Details: => https://docs.v-empower.com/docs/MeetHour-API/ff9d0e37d9191-user-details

   ```
       MHApiServices.userDetails($token);
   ```

5. To fetch access Token using Refresh Token: => https://docs.v-empower.com/docs/MeetHour-API/d851be1af9804-get-access-token-using-refresh-token

   ```
       class RefreshToken {
           private string $client_id;
           private string $client_secret;
           private ?string $grant_type;
           private string $refresh_token;
       }

       $body = new RefreshToken($client_id, $client_secret, $refresh_token);
       MHApiServices.getRefreshToken($token, $body);
   ```

6. To add a contact in Meet Hour database: => https://docs.v-empower.com/docs/MeetHour-API/bd1e416413e8c-add-contact

   ```
       class ContactsList {
           public ?int $limit;
           public ?int $page;
           public ?int $exclude_hosts;
       }

       $body = new ContactsList();
       MHApiServices.contactList($token, $body);
   ```

7. To get Timezones of various countries: => https://docs.v-empower.com/docs/MeetHour-API/c688c29bce9b9-timezone-list

   ```
       MHApiServices.timezone($token);
   ```

8. To get list of all the contacts in your Meet Hour account: => https://api.meethour.io/api/{version}/customer/contacts

   ```
       class ContactsList {
           public string $email;
           public string $firstname;
           public ?string $country_code;
           public ?string $image;
           public ?bool $is_show_portal;
           public ?string $lastname;
           public ?string $phone;
       }

       $body = new ContactsList($email, $first_name);
       MHApiServices.ContactsList($token, $body);

   ```

9. To make changes in the existing contact details: => https://docs.v-empower.com/docs/MeetHour-API/28cae9187d215-edit-contact

   ````
    class EditContact {
        public string $email;
        public string $firstname;
        public ?string $country_code;
        public ?string $image;
        public ?bool $is_show_portal;
        public ?string $lastname;
        public ?string $phone;
    }

    $body = new EditContact($contact_id, $firstname, $email);
    MHApiServices.editContact($token, $body);

    ```

   ````

10. To get Upcoming Meetings: => https://docs.v-empower.com/docs/MeetHour-API/31df88388416d-upcoming-meetings

    ```
        class UpcomingMeetings {
            public ?int $limit;
            public ?int $page;
            public ?int $show_all;
        }

        $body = new UpcomingMeetings();
        MHApiServices.upcomingMeetings($token, $body);
    ```

11. To archive a meeting: => https://docs.v-empower.com/docs/MeetHour-API/1dd64523cc6bf-archive-meeting

    ```
        class ArchiveMeeting {
            public string $id;
        }

        $body = new ArchiveMeeting($id);
        MHApiServices.archiveMeeting($token, $body);
    ```

12. To get the details of a missed meeting: => https://docs.v-empower.com/docs/MeetHour-API/92998e2dda102-missed-meetings

    ```
        class MissedMeetings {
            public ?int $limit;
            public ?int $page;
            public ?int $show_all;
        }

        $body = new MissedMeetings();
        MHApiServices.missedMeetings($token, $body);
    ```

13. To get completed meetings: => https://docs.v-empower.com/docs/MeetHour-API/aa9ef6a678250-completed-meetings

    ```
        class CompletedMeetings {
            public ?int $limit;
            public ?int $page;
            public ?int $show_all;
        }

        $body = new CompletedMeetings();
        MHApiServices.completedMeetings($token, $body);
    ```

14. To edit an existing meeting: => https://docs.v-empower.com/docs/MeetHour-API/5dedde36380b4-meeting-edit-meeting

    ```
        class EditMeeting {
            public string $meeting_id;
            public ?string $meeting_name;
            public ?string $agenda;
            public ?string $passcode;
            public ?string $meeting_date;
            public ?string $meeting_time;
            public ?string $meeting_meridiem;
            public ?int $duration_hr;
            public ?int $duration_min;
            public ?string $timezone;
            public ?int $is_recurring;
            public ?string $recurring_type;
            public ?int $repeat_interval;
            public ?int $weeklyWeekDays;
            public ?string $monthlyBy;
            public ?string $monthlyByDay;
            public ?string $monthlyByWeekdayIndex;
            public ?string $monthlyByWeekday;
            public ?string $endBy;
            public ?string $end_date_time;
            public ?string $instructions;
            public ?int $is_show_portal;
            public ?int $enable_pre_registration;
            public ?string $meeting_topic;
            public ?string $meeting_agenda;
            public ?array $options;
            public ?array $old_attend;
            public ?array $attend;
            public ?array $groups;
            public ?array $hostusers;
            public ?string $default_recording_storage;
            public ?array $live_stream_settings;
        }

        $body = new EditMeeting($meeting_id);
        MHApiServices.editMeeting($token, $body);
    ```

15. To view a meeting: => https://docs.v-empower.com/docs/MeetHour-API/7e9a0a1e0da7f-meeting-view-meeting

    ```
        class ViewMeeting {
            public string $meeting_id;
        }

        $body = new ViewMeeting($meeting_id);
        MHApiServices.viewMeeting($token, $body);
    ```

16. To get all the recordings list: => https://docs.v-empower.com/docs/MeetHour-API/ce7c4fd8cae7e-recording-list

    ```
        class RecordingsList {
            public ?string $filter_by;
            public ?int $limit;
            public ?int $page;
        }

        $body = new RecordingsList();
        MHApiServices.recordingsList($token, $body);
    ```