Overview of Zoom API
Zoom is one of the leading video conference platforms in the world, and is accessible over mobile or desktop. The Zoom API is based on the Rest API and GraphQL API. Developers use Zoom API integration to build their own apps. They can use the API to integrate video, voice, and screen sharing into their applications.
Zoom developer API and key functionalities
Developers can incorporate Zoom’s video conferencing and communication features into their own applications, platforms, or services using the robust range of tools and resources found in the Zoom Developer API. By utilizing the Zoom Open API, developers can create unique solutions that improve collaboration, support virtual events, and streamline operations. Some of key functionalities of Zoom Api for developers are:
- Meeting: By integrating with the Zoom API. Developers can Create, join, and manage meetings.
- Zoom phone API: Developers may access and control Zoom Phone via the RESTful Zoom Phone API. It can be used to create unique applications and integrations that increase Zoom’s functionality. The API has webhooks and the master account API.
- Contact Center: Developers can access data from the Zoom contact center.
- Video SDK: The Video SDK offers a variety of services, including streaming video, audio, screen sharing, chat, and data feeds. You can opt to construct with some or all of these characteristics. A complete set of server side APIs and webhooks are also included with the Video SDK.
- Zoom IQ: Zoom IQ is a smart companion that summarizes chats, organize ideas, drafts content for chats, emails, whiteboard session, and much more.
- Marketplace: The Zoom marketplace helps users find apps that can integrate with Zoom, improving user experience.
- QSS API:
- SCIM2: Zoom developed SCIM2 (System for Cross-domain Identity Management) is a specification designed to automate the provisioning of user identities across various cloud-based applications.
- GraphQL: The GraphQL is a query language for API.
Zoom provides several resources to developers some of most popular are:-
- Zoom Community: helps you collaborate with users.
- Weekly live trainings: Zoom offers weekly live training to learn Zoom and ask questions.
- Video Tutorials: Gives access to these videos to get started.
- Daily release notes: Stay up to date on Zoom latest updates.
- Zoom Service Status: Subscribe to receive updates about outage and new products.
Also read: How To Use YouTube API: A Step-By-Step Guide To Integrate YouTube API And Full Documentation List
How to use Zoom API – step-by-step integration guide
Zoom API is a great tool that developers can use to integrate Zoom into their applications. The Zoom API integration offers better security, and management, and is independent of third-party vendors. The zoom meeting API has two authentication methods:
- Auth 2.0: Request allows users to authorize your platform to use their data.
- JWT Web Tokens (JWT) allows server-to-server authentication.
Which authentication method you use will depend on your specific needs. If you want to build an App that can be purchased on the Zoom marketplace use Auth2.0. If you want to build an App for internal usage. We will focus on the Zoom api oauth, since it has wider applications and gives developers access to larger portion of the Zoom rest API.
- Visit the Zoom marketplace and sign up. You will need to log-in again.
- Click on Develop tab and then Build App.
- Alternatively, you can visit the Zoom marketplace and choose your app type page. And click on the OAuth app.
- Name your app, and ensure you use an Account-level app, since it is more comprehensive. We recommend you uncheck “the publish” to marketplace till you are more familiar with the Zoom apps API.
- There are several pages of set up before you can publish your App.
- You will be to see your Client ID and Client Secret. Store your Client Secret securely and should not be used in plain text when stored in the cloud repository.
- In the Redirect URL and Whitelist field you will need to enter: marketplace.zoom.us/docs/oauth/callback/success.
- You will be asked to fill in basic information like the developer’s name and email address.
- You can skip the features page and go on to Scope API. The scopes you need for the app must be assigned here. The scope for which the App will enquire about user permission here. Then click Add Scopes. For this test, a user is required: Add that one by adding read: admin scope.
Congratulations, you have successfully installed the Zoom API. It is easy to integrate the SDK with your app.
- First, you need to create an SDK by clicking on the SDK option on the Zoom App Marketplace page under the Build App option.
- Moving on to the next step, you need to fill up the credentials for the SDK as you did for the OAuth. Add the app name and click on Create.
- After that, you will be redirected to the page, where you have to choose the App Type. Here the options include the Legacy SDK app User-managed OAuth app. The other option to select is the Select an OAuth flow with options Server-to server and PKCE (Proof Key for Code Exchange).
- You will see a radio button asking, ‘Would you like to publish this app on Zoom App Marketplace’ that you need to opt for. Click on Enable.
- This last step will lead you to the forms that would require you to fill in the App information, Developer’s contact information, Links, etc., and then, you need to click on Continue to move forward.
- The next step is to download the SDKs for the OSes. Now SDK credentials will be generated for you to access the Zoom SDK and OAuth, that you will use during the development (development credentials) and production (production credentials).
- The last step is to select the scopes and test the app. As soon as you insert the test URL, you can activate the app. You also get the Deactivate and Reactivate options for the app, which would only require the SDK Key and SDK Secret.
Also read: How to use ChatGPT API: A step-by-step integration guide and full documentation list
Zoom API documentation references and examples
Developers seeking to integrate with their application with the Zoom API can use the Zoom API documentation references. The documentation helps developers to understand various end-points, parameters, and methods available. The detailed documentation helps them understand the API better and leverage its features to build better applications. The practical examples in this section is a good starting point.
How to use Zoom API Python
- Go to the Zoom marketplace and sign-in or sign-up in to your Zoom account.
- Click on Develop tab and select Build App.
- Read and agree to the terms and conditions of the Zoom API license.
- Choose JWT, in this example, we focus on JWT since it is easier.
- Enter the name of your app and click Create.
- Fill in relevant and mandatory details and click on Continue.
- Go to the App Credential tab and copy zoom api key and secret
Before you proceed you need to install the following packages:
- JWT − JWT (JSON Web Token) is a compact, URL-safe means of representing claims to be transferred between two parties.
- Requests − the requests package in Python is used for making HTTP requests to web APIs.
- JSON − the json package in Python is used for encoding and decoding JSON data.
You can install the packages by typing
pip3 install jwt requests json
pip3 install jwt requests json
import jwt
import requests
import json
from time import time
# Enter your API key and your API secret
API_KEY = ‘Your API key’
API_SEC = ‘Your API secret’
# create a function to generate a token
# using the pyjwt library
def generateToken():
token = jwt.encode(
# Create a payload of the token containing
# API Key & expiration time
{‘iss’: API_KEY, ‘exp’: time() + 5000},
# Secret used to generate token signature
API_SEC,
# Specify the hashing alg
algorithm=’HS256′
)
return token.decode(‘utf-8’)
# create json data for post requests
meetingdetails = {“topic”: “The title of your zoom meeting”,
“type”: 2,
“start_time”: “2019-06-14T10: 21: 57”,
“duration”: “45”,
“timezone”: “Europe/Madrid”,
“agenda”: “test”,
“recurrence”: {“type”: 1,
“repeat_interval”: 1
},
“settings”: {“host_video”: “true”,
“participant_video”: “true”,
“join_before_host”: “False”,
“mute_upon_entry”: “False”,
“watermark”: “true”,
“audio”: “voip”,
“auto_recording”: “cloud”
}
}
# send a request with headers including
# a token and meeting details
def createMeeting():
headers = {‘authorization’: ‘Bearer ‘ + generateToken(),
‘content-type’: ‘application/json’}
r = requests.post(
f’https://api.zoom.us/v2/users/me/meetings’,
headers=headers, data=json.dumps(meetingdetails))
print(“\n creating zoom meeting … \n”)
# print(r.text)
# converting the output into json and extracting the details
y = json.loads(r.text)
join_URL = y[“join_url”]
meetingPassword = y[“password”]
print(
f’\n here is your zoom meeting link {join_URL} and your \
password: “{meetingPassword}”\n’)
# run the create meeting function
createMeeting()
How to use Zoom API iOS
Here is how to use the Zoom API iOS:
Sign-up and sign-in to Zoom marketplace.
- Setup the SDK Key and download it from the marketplace.
- Create an Xcode project and drag and drop the SDK in your project.
- Go to info.plist file to add the microphone and camera permissions.
- Go to the Applegate.swift and write the following code
import UIKit
import MobileRTC
import MobileCoreServices
@UIApplicationMain
class AppDelegate: UIResponder,
UIApplicationDelegate,MobileRTCAuthDelegate
{
var window: UIWindow?
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions:
[UIApplication.LaunchOptionsKey: Any]?) -> Bool
{
let storyBoard : UIStoryboard
= UIStoryboard(name: “Main”,
bundle:nil)
let newViewController
= storyBoard.instantiateViewController(withIdentifier:
“ViewController”) as! ViewController
let navigationController
= UINavigationController(rootViewController:
newViewController)
window?.rootViewController =
navigationController
window?.makeKeyAndVisible()
let mainSDK
= MobileRTCSDKInitContext()
mainSDK.domain = “zoom.us”
MobileRTC.shared().initialize(mainSDK)
let authService = MobileRTC.shared().getAuthService()
print(MobileRTC.shared().mobileRTCVersion)
authService?.delegate = self
authService?.clientKey = “Your Client Key”
authService?.clientSecret = “Your Client Secret Key”
authService?.sdkAuth()
return true
}
func onMobileRTCAuthReturn(_ returnValue: MobileRTCAuthError)
{
print(returnValue)
if (returnValue != MobileRTCAuthError_Success)
{
let msg = “SDK authentication failed, error code: \
(returnValue)”
print(msg)
}
}
}
- Now move to your ViewController where you want to implement Zoom video calling and use the code below
import UIKit
import MobileRTC
class ViewController: UIViewController
{
let meetingNo = “Your Meeting Number”
let kSDKUserName
=”override func viewDidLoad() {
super.viewDidLoad()
if(self.meetingNo == “”) {
// If the meeting number is empty, return error.
print(“Please enter a meeting number”)
return
} else
{ // If the meeting number is not empty.
let getservice = MobileRTC.shared().getMeetingService()
if let service = getservice {
service.delegate = self
let paramDict = [kMeetingParam_Username:kSDKUserName,kMeetingParam_MeetingNumber:meetingNo, kMeetingParam_MeetingPassword:””,kMeetingParam_WebinarToken:”Your Webinar Token”]
let response = service.joinMeeting(with: paramDict)
print(“onJoinMeeting, response: \(response)”)
}}}}
extension ViewController: MobileRTCMeetingServiceDelegate{
func onMeetingStateChange(_ state: MobileRTCMeetingState)
{
print(“\(state)”)
}}
How to use Zoom API NodeJs
Here is how to use Zoom API Node.js
- Get started by installing any other node package.
npm install zoomus
- After installing the package, all you need to do is initialize Zoom passing in your API key and secret.
var Zoom = require(“zoomus”)({
key: “YOUR_API_KEY”,
secret: “YOUR_API_SECRET”
});
- From there you can use the built-in methods to perform the required actions within the Zoom API.
//create a user
var user = {
email: “user@comapny.com”,
type: 1
}Zoom.user.create(user, function(res){
if(res.error){
//handle errors
} else {
//do something with the response
var createdUser = res;
}
});
How to use Zoom API C#
Here is how to use Zoom API C#
- Start by creating account on Zoom marketplace.
- Once you created the Zoom account. Go to the Build app page and select the JWT to generate API key and Secret. If you use JWT you do not want to generate API key and secret. JWT supports server authorization.
- We start by Generating a JWT in C. We’ll use Microsoft’s System.IdentityModel.Tokens.Jwt nuget package to generate the JWT. Open Nuget Package Manager, and add System.IdentityModel.Tokens.Jwt by Microsoft.
- Add this piece of code to create your JWT token:
var tokenHandler = new System.IdentityModel.Tokens.Jwt.JwtSecurityTokenHandler();
var now = DateTime.UtcNow;
var apiSecret = “<your API secret here>”;
byte[] symmetricKey = Encoding.ASCII.GetBytes(apiSecret);
var tokenDescriptor = new SecurityTokenDescriptor
{
Issuer = “<your API key here>”,
Expires = now.AddSeconds(30),
SigningCredentials = new SigningCredentials(new SymmetricSecurityKey(symmetricKey), SecurityAlgorithms.HmacSha256),
};
var token = tokenHandler.CreateToken(tokenDescriptor);
var tokenString = tokenHandler.WriteToken(token);
Important things to note here:
- The symmetricKey is what’s used to sign the JWT. This should be ASCII encoded, or else Zoom will reject it (this seems to be undocumented)
- The Issuer field is your Zoom API key.
- The Expires field can be set to any future date, but is recommended to be short-lived.
- Only the SecurityAlgorithms.HmacSha256 hashing algorithm is supported by Zoom.
- We now need to debug the token. To ensure that you have the correct token, you can use the JWT debugger Paste your JWT, and enter your secret in the secret field. You should see the headers including the HS256 algorithm and the JWT token type:
{
“alg”: “HS256”,
“typ”: “JWT”
}
- And the payload including the exp expiry time in unix milliseconds, and iss (issuer) with your API key:
{
“nbf”: 1587197901,
“exp”: 1587197931,
“iat”: 1587197901,
“iss”: “<your API key here>”
}
- You can now make API calls
var client = new RestClient(“https://api.zoom.us/v2/users?status=active&page_size=30&page_number=1”);
var request = new RestRequest(Method.GET);
request.AddHeader(“content-type”, “application/json”);
request.AddHeader(“authorization”, String.Format(“Bearer {0}”, tokenString));
IRestResponse response = client.Execute(request);
How to use Zoom API JavaScript example
Here is how to use Zoom API JavaScript example:
- Start by cloning the repo
$ Git clone https://github.com/zoom/meetingsdk-sample-javascript.git
- Once cloned, navigate to the meetingsdk-sample-javascript directory:
$ cd meetingsdk-sample-javascript
- Open the client-view.js file, and enter values for the variables:
To use the Component View, replace client-view.js with component-view.js. (The leaveUrl is not needed) Also, uncomment the Component View CSS and JavaScript tags and comment out the Client View CSS and JavaScript tags in index.html.
Variable | Description |
authEndpoint | Required, your Meeting SDK auth endpoint that secuerly generates a Meeting SDK JWT. Get a Meeting SDK auth endpoint here. |
sdkKey | Required, your Zoom Meeting SDK Key or Client ID for Meeting SDK app type’s created after February 11, 2023. You can get yours here. |
meetingNumber | Required, the Zoom Meeting or webinar number. |
passWord | Optional, meeting password. Leave as empty string if the meeting does not require a password. |
role | Required, 0 to specify participant, 1 to specify host. |
userName | Required, a name for the user joining / starting the meeting / webinar. |
userEmail | Required for Webinar, optional for Meeting, required for meeting and webinar if registration is required. The email of the user starting or joining the meeting / webinar. |
registrantToken | Required if your meeting or webinar requires registration. |
zakToken | Required to start meetings or webinars on external Zoom user’s behalf, the authorized Zoom user’s ZAK token. |
leaveUrl | Required for Client View, the url the user is taken to once the meeting is over. |
Example:
var authEndpoint = ‘http://localhost:4000’
var sdkKey = ‘abc123’
var meetingNumber = ‘123456789’
var passWord = ”
var role = 0
var userName = ‘JavaScript’
var userEmail = ”
var registrantToken = ”
var leaveUrl = ‘https://zoom.us’
Save client-view.js. (Or component-view.js if using Component View.)
- Navigate to index.html in your browser (or serve over localhost) and click “Join Meeting”.
How to use JQuery call to Zoom API
- Start by installing this by plugin via npm
npm install jquery-zoom
- Add JQuery if it doesn’t already exists.
<script src=”https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js” defer=”defer”></script>
- Add the Zoom.min.js plugin file to your theme.
{% if template contains ‘product’ %}
<script type=”text/javascript” src=”{{ ‘jquery.zoom.min.js’ | asset_url }}” defer=”defer”>
{% endif %}
- Edit product.liquid to target the zoomed image.
<div class=”image-container”>
<img class=”image-zoom” src=”{{ featured_image | img_url: ‘480×480’ }}” alt=”{{ image.alt | escape }} data-zoom=”{{ featured_image | img_url: ‘1024×1024’, scale: 2 }}>
<div class=”image-details”></div>
</div>
- Initiate the Zoom plugin dynamically.
script>
$(document).ready(function(){
$(‘.image-zoom’)
.wrap(‘<span style=”display:inline-block”></span>’)
.css(‘display’, ‘block’)
.parent()
.zoom({
url: $(this).find(‘img’).attr(‘data-zoom’)
});
});
</script>
How to use Zoom API JSON
- Navigate to the Zoom Marketplace while logged in to the account that is associated with your JWT app
- Once logged in, click on your JWT App from the Manage page
- From your App’s page, click on the App Credentials tab:
- Click on the View JWT Token dropdown
- Copy this token and use this to authenticate your API requests (auth type: “Bearer Token”)
import requests
jwt_token = “your_jwt_token”
api_endpoint = “https://api.zoom.us/v2/users”
headers = {
“Authorization”: f”Bearer {jwt_token}”,
“Content-Type”: “application/json”
}
response = requests.get(api_endpoint, headers=headers)
data = response.json()
print(data)
How to use Java Zoom API JAR
To use the Zoom API with Java, you can leverage the Zoom API Java JAR library. Here’s a step-by-step guide:
- Signup for Zoom Account with a paid plan.
- Go to zoom developers and create a JWT App for your application with your details.
- Get and copy Zoom Api Key and Api Secret to your project.
- Get user id from your registered Zoom Account.
- Now create and add methods below (Create for creation, and get/list for getting new/existing created meetings)
import io.jsonwebtoken.Jwts;
import io.jsonwebtoken.SignatureAlgorithm;
import io.jsonwebtoken.security.Keys;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.util.UriComponentsBuilder;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
public ZoomMeetingObjectDTO createMeeting(ZoomMeetingObjectDTO zoomMeetingObjectDTO) {
log.debug(“Request to create a Zoom meeting”);
// replace zoomUserId with your user ID
String apiUrl = “https://api.zoom.us/v2/users/” + zoomUserId + “/meetings”;
// replace with your password or method
zoomMeetingObjectDTO.setPassword(yourPass);
// replace email with your email
zoomMeetingObjectDTO.setHost_email(“yourEmail”);
// Optional Settings for host and participant related options
ZoomMeetingSettingsDTO settingsDTO = new ZoomMeetingSettingsDTO();
settingsDTO.setJoin_before_host(false);
settingsDTO.setParticipant_video(true)
settingsDTO.setHost_video(false);
settingsDTO.setAuto_recording(“cloud”);
settingsDTO.setMute_upon_entry(true);
zoomMeetingObjectDTO.setSettings(settingsDTO);
RestTemplate restTemplate = new RestTemplate();
HttpHeaders headers = new HttpHeaders();
headers.add(“Authorization”, “Bearer ” + generateZoomJWTTOken());
headers.add(“content-type”, “application/json”);
HttpEntity<ZoomMeetingObjectDTO> httpEntity = new HttpEntity<ZoomMeetingObjectDTO>(zoomMeetingObjectDTO, headers);
ResponseEntity<ZoomMeetingObjectDTO> zEntity = restTemplate.exchange(apiUrl, HttpMethod.POST, httpEntity, ZoomMeetingObjectDTO.class);
if(zEntity.getStatusCodeValue() == 201) {
log.debug(“Zooom meeeting response {}”,zEntity);
return zEntity.getBody();
} else {
log.debug(“Error while creating zoom meeting {}”, zEntity.getStatusCode());
}
return zoomMeetingObjectDTO;
}
/**
* Generate JWT token for Zoom using api credentials*
* @return JWT Token String*/
private String generateZoomJWTTOken() {
String id = UUID.randomUUID().toString().replace(“-“, “”);
SignatureAlgorithm signatureAlgorithm = SignatureAlgorithm.HS256;
Date creation = new Date(System.currentTimeMillis());
Date tokenExpiry = new Date(System.currentTimeMillis() + (1000 * 60));
Key key = Keys
.hmacShaKeyFor(zoomApiSecret.getBytes());
return Jwts.builder()
.setId(id)
.setIssuer(zoomApiKey)
.setIssuedAt(creation)
.setSubject(“”)
.setExpiration(tokenExpiry)
.signWith(key, signatureAlgorithm)
.compact();}
How to use Zoom PHP API example
Here is how to use Zoom PHP API:
- Register your app on the Zoom marketplace.
- After registration you will be sent generated credentials. Redirect URL for OAuth and Whitelist URL must be provided here.
- Enter basic information about your app.
- You can voluntarily enable a few more functionalities like Chat Subscriptions and Event Subscriptions.
- You need to add scopes pertaining to your app under the “Scopes” tab. For Zoom meetings, for instance, you may add a scope.
- Install the Guzzle library using the command
composer require guzzlehttp/guzzle
You need to have access token values from the database. We’ll create it and keep it in the database. The access token is only functional for a little time. To avoid requiring the user to repeat the authorisation process, our solution will automatically regenerate the access token.
- Create a zoom_oauth table using the below SQL.
CREATE TABLE `zoom_oauth` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`provider` varchar(255) NOT NULL,
`provider_value` text NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
- Create a file class-db.php and add the code below to it.
<?php
class DB {
private $dbHost = “DB_HOST”;
private $dbUsername = “DB_USERNAME”;
private $dbPassword = “DB_PASSWORD”;
private $dbName = “DB_NAME”;
public function __construct(){
if(!isset($this->db)){
// Connect to the database
$conn = new mysqli($this->dbHost, $this->dbUsername, $this->dbPassword, $this->dbName);
if($conn->connect_error){
die(“Failed to connect with MySQL: ” . $conn->connect_error);
}else{
$this->db = $conn;
}
}
}
public function is_table_empty() {
$result = $this->db->query(“SELECT id FROM zoom_oauth WHERE provider = ‘zoom'”);
if($result->num_rows) {
return false;}
return true;}
public function get_access_token() {
$sql = $this->db->query(“SELECT provider_value FROM zoom_oauth WHERE provider = ‘zoom'”);
$result = $sql->fetch_assoc();
return json_decode($result[‘provider_value’]);}
public function get_refresh_token() {
$result = $this->get_access_token();
return $result->refresh_token;
}
public function update_access_token($token) {
if($this->is_table_empty()) {
$this->db->query(“INSERT INTO zoom_oauth(provider, provider_value) VALUES(‘zoom’, ‘$token’)”);
} else {
$this->db->query(“UPDATE zoom_oauth SET provider_value = ‘$token’ WHERE provider = ‘zoom'”);
}
}
}
- Create a config.php file that will contain your app credentials, and redirect URL. Also include the DB class and Guzzle package as follows.
<?php
require_once ‘vendor/autoload.php’;
require_once “class-db.php”;
define(‘CLIENT_ID’, ‘YOUR_CLIENT_ID’);
define(‘CLIENT_SECRET’, ‘YOUR_CLIENT_SECRET’);
define(‘REDIRECT_URI’, ‘REDIRECT_URL_FOR_OAUTH’);
- It means in the callback.php file, we have to write the code which calls a Zoom API, fetches an access token, and stores it in the database.
24
<?php
require_once ‘config.php’;
try {
$client = new GuzzleHttp\Client([‘base_uri’ => ‘https://zoom.us‘]);
$response = $client->request(‘POST’, ‘/oauth/token’, [
“headers” => [
“Authorization” => “Basic “. base64_encode(CLIENT_ID.’:’.CLIENT_SECRET)
],
‘form_params’ => [
“grant_type” => “authorization_code”,
“code” => $_GET[‘code’],
“redirect_uri” => REDIRECT_URI
],
]);
$token = json_decode($response->getBody()->getContents(), true);
$db = new DB();
$db->update_access_token(json_encode($token));
echo “Access token inserted successfully.”;
} catch(Exception $e) {
echo $e->getMessage();
}
Now, let’s generate an authorization URL where a user can click and complete the authorization. I am going to create this URL in the index.php file.
<?php
require_once ‘config.php’;
$url = “https://zoom.us/oauth/authorize?response_type=code&client_id=“.CLIENT_ID.”&redirect_uri=”.REDIRECT_URI;
?>
<a href=”<?php echo $url; ?>”>Login with Zoom</a>
Run the above file on the browser, click on the ‘Login with Zoom’ link and complete the authorization. On successful authentication, you should see a success message and the access token would store in your zoom_oauth table. If it works, we can go ahead and create a meeting with the Zoom API.
We now create a Zoom meeting with file create.php
create-meeting.php
<?php
require_once ‘config.php’;
function create_meeting() {
$client = new GuzzleHttp\Client([‘base_uri’ => ‘https://api.zoom.us‘]);
$db = new DB();
$arr_token = $db->get_access_token();
$accessToken = $arr_token->access_token;
try {
$response = $client->request(‘POST’, ‘/v2/users/me/meetings’, [
“headers” => [
“Authorization” => “Bearer $accessToken”
],
‘json’ => [
“topic” => “Let’s learn Laravel”,
“type” => 2,
“start_time” => “2023-05-05T20:30:00”,
“duration” => “30”, // 30 mins
“password” => “123456”
],
]);
$data = json_decode($response->getBody());
echo “Join URL: “. $data->join_url;
echo “<br>”;
echo “Meeting Password: “. $data->password;
} catch(Exception $e) {
if( 401 == $e->getCode() ) {
$refresh_token = $db->get_refresh_token();
$client = new GuzzleHttp\Client([‘base_uri’ => ‘https://zoom.us‘]);
$response = $client->request(‘POST’, ‘/oauth/token’, [
“headers” => [
“Authorization” => “Basic “. base64_encode(CLIENT_ID.’:’.CLIENT_SECRET)
],
‘form_params’ => [
“grant_type” => “refresh_token”,
“refresh_token” => $refresh_token
],
]);
$db->update_access_token($response->getBody());
create_meeting();
} else {
echo $e->getMessage();
}}}
create_meeting();
How to use Zoom API Ruby
Using Zoom API Ruby is quite straightforward.
Sign-up on the Zoom marketplace. Create an app and obtain required api credentials for
Zoom. You will need the following credentials
- ZOOM_US_USER_EMAIL
ZOOM_US_API_KEY
ZOOM_US_API_SECRET
- You need the following gem files :
gem ‘jwt’
gem ‘openssl’
2. Get the env variables
USER_ID = ENV[‘ZOOM_US_USER_EMAIL’]
API_KEY = ENV[‘ZOOM_US_API_KEY’]
API_SECRET = ENV[‘ZOOM_US_API_SECRET’]
3. Create a payload for JWT
PAYLOAD = { iss: API_KEY,exp: 1.hour.from_now.to_i }
This payload is for an hour, you will need to expand it during production. Alternatively, you can create a permatent token.
permanent
token = ENV[‘ZOOM_TOKEN’]
4. You can automatically create header to return JWT.
token = JWT.encode(PAYLOAD, API_SECRET, ‘HS256’, {typ: ‘JWT’})
5. Now create a URL to desired endpoint.
url = URI(“https://api.zoom.us/v2/users/#{USER_ID}/meetings”)
6. Create HTTP objects.
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
7. Make a request post and set the authorization header.
request = Net::HTTP::Post.new(url)
request[“authorization”] = “Bearer #{token}”
8. Define the content-type and convert the body into JSON object .
request[“content-type”] = ‘application/json’
request.body = meeting_params.to_json
9. Send the request and parse response
res = http.request(request)
res = JSON.parse(res.body)
10. Here is how to write a Zoom post request to create meetings.
class ZoomPost
require ‘net/http’
require ‘json’
USER_ID = ENV[‘ZOOM_US_USER_EMAIL’]
API_KEY = ENV[‘ZOOM_US_API_KEY’]
API_SECRET = ENV[‘ZOOM_US_API_SECRET’]
PAYLOAD = {
iss: API_KEY,
exp: 1.hour.from_now.to_i
}
def self.post_meeting(meeting_params, user_id, virtual_class_id)
#Automatically creates header and return JWT
token = JWT.encode(PAYLOAD, API_SECRET, ‘HS256’, {typ: ‘JWT’})
#token = ENV[‘ZOOM_TOKEN’]
url = URI(“https://api.zoom.us/v2/users/#{USER_ID}/meetings”)
# Create the HTTP objects
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request[“authorization”] = “Bearer #{token}”
request[“content-type”] = ‘application/json’
request.body = meeting_params.to_json
# Send the request
res = http.request(request)
res = JSON.parse(res.body)
ZoomMeeting.create(meeting_id: res[‘id’],
start_url: res[‘start_url’],
join_url: res[‘join_url’],
duration: res[‘duration’],
time_created: res[‘created_at’],
time_zone: res[‘time_zone’],
topic: res[‘topic’],
host_id: res[‘host_id’],
user_id: user_id,
virtual_class_id: virtual_class_id)
end
end
Also read: How to use Slack API: A step-by-step integration guide and full documentation list
Zoom API pricing
The Zoom API pricing can be obtained at no cost. Any user who has a license can use the API to manage their account, schedule meetings, etc. If you include Zoom in your platform, Zoom users can authorize their account to perform API calls (via OAuth). Zoom offers a Zoom ISV Partner Program. The program allows developers to receive commercial and technical support to offer more services to your customer. The Zoom ISV Program enables partners to design a comprehensive client experience. Your clients don’t need to open new accounts or log out of your app. They can make use of Zoom’s video and meeting services. The pricing starts at $2,000 / month for 50,000 minutes.
Also read: How to use Yahoo Finance API: A step-by-step integration guide and full documentation list
Most used Zoom APIs
Developers can use the Zoom APIs to integrate Zoom into their apps and create custom workflows. In this section, we discuss the most used Zoom APIs. However, Zoom only allows users with paid accounts at the Pro level or higher to use many of its API calls.
Zoom Chat API
Developers can use the Zoom Chat API to access data connected to chat and chat channels. It allows users to send and receive chat messages.
Zoom Contact Center API
The Zoom Contact Center API allows developers to access data from the Zoom Contact Center. You can use the API to build private and public applications.
Zoom Room API
The Zoom Room is a software program that conference room experience with audio, video, screen sharing, whiteboarding, and digital signage. Developers can use the Zoom Room API to manage Zoom Rooms. They can use the API to create new Rooms or change the configurations.
Zoom webinar API
Developers can use the Zoom Webinar API to access the Zoom Webinar API data. You need to be a paid user to access the Zoom Webinar add-ons
Zoom SMS API
The Zoom SMS API is part of the Zoom Phone API. Developers can use the API to get SMS sessions, SMS details, SMS message ID, Sync SMS by session ID, Get user SMS sessions, and list user’s session in descending orders.
Zoom Events API
The Zoom Event API allows developers to access information from Zoom events. The API can be used to get information of registrations, session, tickets, and hubs. Developers can use the API to build private and public Apps on Zoom App Marketplace.
You can add closed captions to your Zoom meeting by using third-party closed caption service. The third-party service may send text from their closed captioning software to the Zoom meeting using the caption URL. Developers can add Zoom’s closed captioning REST API to the closed caption software.
Zoom Marketplace API
The Zoom Marketplace API allows developers to explore and integrate with third-party apps. This covers a range of tools like productive meetings and group chats. You can use the API to build private and public applications.
Zoom API JWT
JWT app type will be phased out. We advise you to develop Server-to-Server OAuth or OAuth apps to take the place of a JWT app’s functionality in your account.
Zoom live streaming API
There is no Zoom live streaming API, but there you can access the update details through the Zoom API meetings.
Zoom API update meeting
There is no Zoom API update meeting, but there you can access the update details through the Zoom API meetings.
Zoom API transcript
The Zoom API transcript can be accessed the recording features and is available for Pro, Business, or Enterprise accounts. You can use the participant_audio_array, you can get individually labeled transcriptions.
Zoom API reports
There is no Zoom APU reports but you can obtain the data from ZOOM meeting API. You can get detailed reports by referring to the zoom report methods.
Shubha writes blogs, articles, off-page content, Google reviews, marketing email, press release, website content based on the keywords. She has written articles on tourism, horoscopes, medical conditions and procedures, SEO and digital marketing, graphic design, and technical articles. Shubha is a skilled researcher and can write plagiarism free articles with a high Grammarly score.
Leave a Reply