To install NuGet Packages, right click ZoomAPI from the solution Explorer and click Manage Nuget packages.
Now open the Code Behind and add the code.
Required Namespaces
C#
using Newtonsoft.Json.Linq;
using RestSharp;
using System;
using System.Text;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.IdentityModel.Tokens;
using Microsoft.AspNetCore.Mvc;
using System.Net;
Now BindProperty with the following strings
public string Host { get; set; }
public string Join { get; set; }
public string Code { get; set; }
Now declare the variables
C#
var tokenHandler = new System.IdentityModel.Tokens.Jwt.JwtSecurityTokenHandler();
var now = DateTime.UtcNow;
var apiSecret = "Your API secret";
byte[] symmetricKey = Encoding.ASCII.GetBytes(apiSecret);
Create the Token Descriptor and change it to Token String for the Authorization Header
C#
var tokenDescriptor = new SecurityTokenDescriptor
{
Issuer = "Your API Key",
Expires = now.AddSeconds(300),
SigningCredentials = new SigningCredentials(new SymmetricSecurityKey(symmetricKey), SecurityAlgorithms.HmacSha256),
};
var token = tokenHandler.CreateToken(tokenDescriptor);
var tokenString = tokenHandler.WriteToken(token);
Create Request
Now use the code for the Request
C#
var client = new RestClient("https://api.zoom.us/v2/users/{userid}/meetings");
var request = new RestRequest(Method.POST);
request.RequestFormat = DataFormat.Json;
request.AddJsonBody(new { topic = "Meeting with Ussain", duration = "10", start_time = "2021-05-20T05:00:00", type = "2" });
request.AddHeader("authorization", String.Format("Bearer {0}", tokenString));
{userid}: you can use your Zoom Username.
host_email: Host Email
topic: Topic for the meeting
duration: Duration of the meeting
start_time: Set the start time for the meeting
type: We use 2 for Scheduled meeting
For more objects like above please refer this link
Here we use DataFormat.Json for format as we created JWT.
Here I will explain you step by step on how to create a Zoom Meeting Link with Zoom API using Asp.net Core Razor Page.
Create Zoom App to get API Key and Secret
To get Zoom API, we need to create an Account on Zoom Marketplace. Click this link to create one.
Once you created the Zoom account. Go to the Build App page and select the JWT to generate your API Key & Secret.
By using JWT, you don’t need a user authorization and it supports server to server integration.
You can see the detailed documentation about JWT through this link.
Also see on How to create a Zoom Meeting Link with Zoom API using Asp.net C# and VB
Now create an Asp.net Core Razor Page on Visual Studio and name it as ZoomAPI.
Now right click Pages folder on Solution Explorer and add a new Razor Page and name it as Zoom.cshtml
Add the code below on Zoom.cshtml
NuGet Packages needed to run the application.
To install NuGet Packages, right click ZoomAPI from the solution Explorer and click Manage Nuget packages.
Now open the Code Behind and add the code.
Required Namespaces
C#
Now BindProperty with the following strings
Now declare the variables
C#
Create the Token Descriptor and change it to Token String for the Authorization Header
C#
Create Request
Now use the code for the Request
C#
{userid}: you can use your Zoom Username.
host_email: Host Email
topic: Topic for the meeting
duration: Duration of the meeting
start_time: Set the start time for the meeting
type: We use 2 for Scheduled meeting
For more objects like above please refer this link
Here we use DataFormat.Json for format as we created JWT.
Get Response
Now use the code to get the Response
C#
That’s it.
Now you can generate the link.
Download