Code2night
  • Home
  • Guest Posts
  • Tutorial
  • Languages
  • Post Blog
  • Tools
    • JSON Beautifier
    • HTML Beautifier
    • XML Beautifier
    • CSS Beautifier
    • JS Beautifier
    • PDF Editor
    • Word Counter
    • Base64 Encode/Decode
    • Diff Checker
    • JSON to CSV
    • Password Generator
  • Register
  • Login
  1. Home
  2. Blogpost

Creating Zoom Meetings in ASP.NET MVC using Zoom Api

Date- Jun 25,2023

9890

Free Download
Zoom Api Zoom in c#

Zoom Api Integration

We can easily use Zoom Api's in our Asp.Net application which gives us power to create/Update and delete zoom meetings from our application. So for achieving that in asp.net mvc we have to follow these steps :

1. Create a new Asp.Net MVC project in visual studio

2. Now Add following namespaces on the controller


  • using System.Net.Http; using System.Net.Http.Headers;
  • using Newtonsoft.Json;

So now on the controller add following code to create meeting

 public ActionResult Index()
        {
            return View();
        }

        private const string ZoomApiKey = "YOUR_ZOOM_API_KEY";
        private const string ZoomApiSecret = "YOUR_ZOOM_API_SECRET";

        public async Task<ActionResult> CreateMeeting()
        {
            string meetingTopic = "My ASP.NET MVC Zoom Meeting";
            string meetingStartTime = DateTime.UtcNow.AddMinutes(10).ToString("yyyy-MM-ddTHH:mm:ssZ");
            int meetingDuration = 60; // Meeting duration in minutes

            HttpClient httpClient = new HttpClient();
            httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));

            // Generate JWT Token
            var jwtToken = GenerateJWTToken(ZoomApiKey, ZoomApiSecret);

            // Create Zoom Meeting
            string apiUrl = "https://api.zoom.us/v2/users/me/meetings";
            httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", jwtToken);

            var requestBody = new
            {
                topic = meetingTopic,
                type = 2, // Scheduled Meeting
                start_time = meetingStartTime,
                duration = meetingDuration,
                timezone = "UTC",
                settings = new
                {
                    host_video = true,
                    participant_video = true
                }
            };

            var requestContent = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(requestBody), Encoding.UTF8, "application/json");
            var response = await httpClient.PostAsync(apiUrl, requestContent);
            var responseContent = await response.Content.ReadAsStringAsync();

            if (response.IsSuccessStatusCode)
            {
            
                ViewBag.Message = "Zoom meeting created successfully.";
                ViewBag.Response = responseContent;
            }
            else
            {
               
                ViewBag.Message = "Failed to create Zoom meeting.";
                ViewBag.Response = responseContent;
            }

            return View("Index");
        }

        private static string GenerateJWTToken(string apiKey, string apiSecret)
        {
            var payload = new
            {
                iss = apiKey,
                exp = DateTimeOffset.UtcNow.AddMinutes(10).ToUnixTimeSeconds()
            };

            var header = new { alg = "HS256", typ = "JWT" };
            string base64UrlEncodedHeader = Base64UrlEncode(Newtonsoft.Json.JsonConvert.SerializeObject(header));
            string base64UrlEncodedPayload = Base64UrlEncode(Newtonsoft.Json.JsonConvert.SerializeObject(payload));

            string signature = ComputeHMACSHA256($"{base64UrlEncodedHeader}.{base64UrlEncodedPayload}", apiSecret);

            return $"{base64UrlEncodedHeader}.{base64UrlEncodedPayload}.{signature}";
        }

        private static string Base64UrlEncode(string input)
        {
            byte[] inputBytes = Encoding.UTF8.GetBytes(input);
            string base64String = Convert.ToBase64String(inputBytes);
            return base64String.TrimEnd('=').Replace('+', '-').Replace('/', '_');
        }

        private static string ComputeHMACSHA256(string input, string key)
        {
            byte[] keyBytes = Encoding.UTF8.GetBytes(key);
            using (var hmac = new System.Security.Cryptography.HMACSHA256(keyBytes))
            {
                byte[] inputBytes = Encoding.UTF8.GetBytes(input);
                byte[] hashBytes = hmac.ComputeHash(inputBytes);
                return Convert.ToBase64String(hashBytes).TrimEnd('=').Replace('+', '-').Replace('/', '_');
            }
        }

In the above code we have one Index action and then we have one Create meeting method which will call the Zoom API

Now add following code on the View side

@{
    ViewBag.Title = "Create Meeting";
}

<div class="jumbotron">
    <h1>ASP.NET</h1>
    <p class="lead">ASP.NET is a free web framework for building great Web sites and Web applications using HTML, CSS and JavaScript.</p>
    <p><a href="https://asp.net" class="btn btn-primary btn-lg">Learn more &raquo;</a></p>
</div>


<a href="/Home/CreateMeeting">Create meeting</a>

@if (!string.IsNullOrEmpty(ViewBag.Message))
{
    <p>@ViewBag.Message</p>
}

@if (!string.IsNullOrEmpty(ViewBag.Response))
{
    <pre>@ViewBag.Response</pre>
}

Now since we have UI and backend code ready , you have to replace the Zoom api key and the Zoom secret key with your keys. And run the application

So this is how you can integrate zoom api in asp.net and we can using this for creating zoom meetings in asp.net mvc using zoom api.

S
Shubham Batra
Programming author at Code2Night — sharing tutorials on ASP.NET, C#, and more.
View all posts →

Related Articles

How to refund payment using Paypal in Asp.Net MVC
Jan 30, 2024
Integrate Stripe Payment Gateway In ASP.NET Core 8.0
Nov 23, 2023
How to get fcm server key
Nov 23, 2023
How to Convert Text to Speech in Asp.Net
Nov 06, 2023

Comments

Tags

AspNet
C#
programming
AspNet MVC
c programming
AspNet Core
C
software development
tutorial
MVC
memory management
Paypal
coding
coding best practices
data structures
programming tutorial
tutorials
object oriented programming
Slick Slider
StripeNet
Free Download for Youtube Subscribers!

First click on Subscribe Now and then subscribe the channel and come back here.
Then Click on "Verify and Download" button for download link

Subscribe Now | 1760
Download
Support Us....!

Please Subscribe to support us

Thank you for Downloading....!

Please Subscribe to support us

Continue with Downloading
Be a Member
Join Us On Whatsapp Join Us On Facebook
Code2Night

A community platform for sharing programming knowledge, tutorials, and blogs. Learn, write, and grow with developers worldwide.

Panipat, Haryana, India
info@code2night.com
Quick Links
  • Home
  • Blogs
  • Tutorials
  • About Us
  • Contact
  • Privacy Policy
  • Terms & Conditions
  • Guest Posts
Free Dev Tools
  • JSON Beautifier
  • HTML Beautifier
  • CSS Beautifier
  • JS Beautifier
  • Password Generator
  • QR Code Generator
  • Hash Generator
  • Diff Checker
  • Base64 Encode/Decode
  • Word Counter
By Language
© 2026 Code2Night. All Rights Reserved.
Made with for developers  |  Privacy  ·  Terms
Translate Page