Categories
PHP Video Call

Create a Zoom meeting using Zoom API

In this tutorial, I will show you how to create a meeting with Zoom API. As you know very well what is zoom and where it will be used.

What is Zoom?

Zoom is used for teleconferencing, telecommuting, distance education, and social relations. It provides videotelephony, online chat. You can share your screen with the other connected users.

During the Coronavirus pandemic, the zoom is mostly used by the companies for meetings and by teachers for distance education. At this time zoom is mostly used as a comparison to Google meet.

Create Zoom Account

Using zoom API. First you have to create an app in zoom marketplace.

Go at this link – https://marketplace.zoom.us/

If you don’t have any account in zoom than you have to create an account in zoom. You can create here – https://zoom.us/signup

Create an OAuth App

For creating an App you can check out my video.

How to get a client id and secret for your app. How to set scopes for the app. Which scopes you have to select for your app.

Scopes means what type of user data can access your app. Whenever an user login in your app he can see these scopes or data access this app.

If you are on the localhost then use the ngrok and generate the local URL. In my case, I am using ngrok, and using the generated URL through ngrok my URL for OAuth redirection and Whitelist URL.

If you don’t know how to use ngrok to create a localhost URL then don’t worry I already created a video for how to create a localhost URL, you can refer to this video.

Environment Setup

Till now zoom team didn’t create a package for developers to integrate zoom easily. They provide the APIs for everything. Whatever we want to do we have to hit the APIs of zoom. So I choose the PHP for hitting the APIs using guzzlehttp.

Install guzzlehttp library in your project using below command –

composer require guzzlehttp/guzzle

We are going to store the access token in the database for later use. The access token is valid for a short period of time. In our code, we will regenerate the access token in the background so that the user doesn’t need to do the authorization process again. Run the below SQL query to create a database table that holds access token.

As we will require the token values from the database, we need to write a code for it. Create a file db.php and add the code below in it.

Generate Access Token

The user can create an access token for their account using the App credentials and OAuth process. Create a config.php file and store app credentials and redirect URL in this PHP file. Include the other environments like DB class and vendor library also.

You have to replace the client id, client secret and redirect Url as well. Redirect Url is callback Url where the user comes after the authorization. Let’s create the callback file where we get the access token of the user.

my callback url will be – http://————————————————-

Here it is callback.php code

Now, let’s generate an authorized URL where a user can click and complete the authorization process. I am going to create this URL in the index.php file.

Run the above file on the browser, click on the URL, and complete the authorization process. On successful authentication, you will see a success message and access token would store in your ‘token’ table. If that works, we can go ahead and create a meeting with the Zoom API.

ZOOM APIs

As I said earlier in the zoom APIs there are a lot of options that you can Integrate on your app. You can checkout the documentation of Zoom APIs here – click here

In this blog we create a meeting, delete and get the meeting details.

Create a meeting

You can check the documentation of create a meeting here – click here

This API has a daily rate limit of 100 requests per day. if you want to know which scopes do you want to authorize from user for any API. You can check at documentation of API

I have created a file create-meeting.php file and send a POST request to the endpoint. If you want to change the setting of meeting than you can do, just checkout the documentation of create meeting API.

You can change the type of meeting and those are :-

  • 1 – Instant meeting
  • 2 – Scheduled meeting (this will be the default)
  • 3 – Recurring meeting with no fixed time
  • 8 – Recurring meeting with fixed time

Get meetings

You can get all meetings with this API. Documentation here – click here

You can set the query parameters also for this api –

  • type (scheduled, live, upcoming)
  • page_size (The number of records returned within a single API call.)
  • page_number (The current page number of returned records)

Delete meeting

You can also delete the meeting. Click here

I Hope, now you can integrate the zoom APIs into your project easily. If you don’t understand something in this blog or you got an error in code, You can watch a zoom integration video tutorial which will help you.

I would like to hear your thoughts or suggestions in the comment section.

github link – Click here

Leave a Reply

Your email address will not be published. Required fields are marked *