Manage Zoom Meeting Rooms through Zoom API with Laravel
This tutorial is for who want to build an app that provides server_to_server interaction with Zoom APIs to manage your account.
Build an Zoom Application
- Access Zoom marketplace
- Sign in
Developbutton on header and select
- Choose the
JWTand create application with the app name what you want.
- Input required information and click
Continueuntil your app will be activated. Don't forget to remember your credentials. It's used for API calling.
Test API Endpoint
Now, we should modify api routes file to check our setting was correct.
Access http://localhost:8000/api and check our setting was set correctly. If your source code work correctly, let’s start to configure some setting to use Zoom APIs.
Add libraries and settings
To use server_to_server Zoom API, we need to generate JWT. And to authenticate, we need to communicate with Zoom.
So I add
guzzlehttp/guzzle libraries to my project.
Additionally we need to modify
.env files to set the api url & key & secret of the zoom.
Before make some endpoints, think about what we want to do.
We want to
GET list of meetings,
GET information of the meeting,
UPDATE meeting information,
DELETE meeting. The 4 types of requests are required, right?
So, I’ll make traits that include some common methods.
Make traits to use easily common methods
The first method of ZoomJWT trait is
generateZoomToken. To use Zoom API, we have to include JWT token on the request.
firebase/php-jwt library, it's very simple to generate JWT. It returns string type's encoded JWT token.
Second, we will make method for get
ZOOM_API_URL environment variable.
Third method returns
Request. We'll use this
Request instance to send request to Zoom API end point.
These methods return
Response that is used to execute
The last methods are used for generate new format of datetime string.
<input type="datetime-local"> format to set start time of meeting, but that form just get
yyyy-MM-dd\THH:mm format of data.
To use Zoom API, we should change time format to
yyyy-MM-dd\THH:mm:ss. That's why I'm creating these 2 methods.
Make API Endpoints
I’ll create 5 end point.
Meeting rooms of the Zoom have ID that is composed of
integer type of data.
Make a controller
In this time, I’ll controll meeting rooms simply because it’s just test application.
This is a declaration section.
use: to use traits
const xxx = <numeric>: Zoom supports 4 types of Meeting. In this time, we'll manage
MEETING_TYPE_SCHEDULEtype of Meeting because it's the default type.
This section gets list of meeting rooms and their information.
timezone easily, I add
start_at property in the information.
To create the meeting room, actually we need various properties, but in this time, we just use
If you want to set more various options to create meeting, please read Zoom API Reference.
Next is get a meeting information section. Using meeting room id, we can get meeting room information easily.
The update section is almost same as create section.
The last section is delete section. It uses when user want to delete a specific meeting.
You can check my API Document made by Postman.
Write Medium in Markdown? Try Markdium!