# How to integrate zoom meeting in .net core application

**URL:** <https://devforum.zoom.us/t/how-to-integrate-zoom-meeting-in-net-core-application/116001>\
**Category:** Meetings\
**Created:** [August 20, 2024, 7:03pm UTC](https://devforum.zoom.us/t/how-to-integrate-zoom-meeting-in-net-core-application/116001 "2024-08-20T19:03:54Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![thendral.d](https://avatars.discourse-cdn.com/v4/letter/t/c0e974/32.png) [@thendral.d](https://devforum.zoom.us/u/thendral.d)\
**Post date:** [August 20, 2024, 7:03pm UTC](https://devforum.zoom.us/t/how-to-integrate-zoom-meeting-in-net-core-application/116001/1 "2024-08-20T19:03:54Z")

</div>

I have created a basic app in Zoom market place and got the api key and secret key.

using the following code to create a meeting url.

```
        var tokenHandler = new System.IdentityModel.Tokens.Jwt.JwtSecurityTokenHandler();
        var now = DateTime.UtcNow;
        var apiSecret = "--";
        byte[] symmetricKey = Encoding.ASCII.GetBytes(apiSecret);

        var tokenDescriptor = new SecurityTokenDescriptor
        {
            Issuer = "---",
            Expires = now.AddSeconds(300),
            SigningCredentials = new SigningCredentials(new SymmetricSecurityKey(symmetricKey), SecurityAlgorithms.HmacSha256),
        };
        var token = tokenHandler.CreateToken(tokenDescriptor);
        var tokenString = tokenHandler.WriteToken(token);

        var client = new RestClient("https://api.zoom.us/ve/users/me/meetings");
        var request = new RestRequest(Method.Get.ToString());
        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));
        request.AddHeader("Content-Type", "application/json");

        var restResponse = client.Execute<RestRequest>(request);
        HttpStatusCode statusCode = restResponse.StatusCode;
        int numericStatusCode = (int)statusCode;
        var jObject = JObject.Parse(restResponse.Content);
        var Host = (string)jObject["start_url"];
        var Join = (string)jObject["join_url"];
        var Code = Convert.ToString(numericStatusCode);

        return NoContent();

```

I am getting the error response, which does not have any other details.

Please help me with the steps to create zoom meeting in .net

---

<div class="post-metadata">

**Author:** ![thendral.d](https://avatars.discourse-cdn.com/v4/letter/t/c0e974/32.png) [@thendral.d](https://devforum.zoom.us/u/thendral.d)\
**Post date:** [August 20, 2024, 7:30pm UTC](https://devforum.zoom.us/t/how-to-integrate-zoom-meeting-in-net-core-application/116001/2 "2024-08-20T19:30:43Z")

</div>

i changed the endpoint to [https://api.zoom.us/v2/users](https://api.zoom.us/v2/users) and i get **invalid access token**

---

<div class="post-metadata">

**Author:** ![elisa.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/elisa.zoom/32/47836_2.png) [@elisa.zoom](https://devforum.zoom.us/u/elisa.zoom)\
**Post date:** [August 21, 2024, 3:33pm UTC](https://devforum.zoom.us/t/how-to-integrate-zoom-meeting-in-net-core-application/116001/3 "2024-08-21T15:33:11Z")

</div>

Hi @thendral.d  
Make sure to use the correct endpoint to create a meeting:

> **[Zoom Meeting API](https://developers.zoom.us/docs/api/rest/reference/zoom-api/methods/#operation/meetingCreate)**
>
> API Reference for /docs/api/rest/reference/zoom-api/methods

If you are working with a server-to-server OAuth app, please review our documentation to ensure that you are generating the token correctly

> **[Internal apps (Server-to-server)](https://developers.zoom.us/docs/internal-apps/)**
>
> The Zoom Developer Platform is an open platform that allows third-party developers to build applications and integrations upon Zoom’s video-first unified communications platform.

---

<div class="post-metadata">

**Author:** ![thendral.d](https://avatars.discourse-cdn.com/v4/letter/t/c0e974/32.png) [@thendral.d](https://devforum.zoom.us/u/thendral.d)\
**Post date:** [August 21, 2024, 4:15pm UTC](https://devforum.zoom.us/t/how-to-integrate-zoom-meeting-in-net-core-application/116001/4 "2024-08-21T16:15:37Z")

</div>

Hi,

I am using the [https://api.zoom.us/v2/users/thendral/meetings](https://api.zoom.us/v2/users/thendral/meetings) api, Can you please confirm this is correct?

Thanks,  
Thendral

---

<div class="post-metadata">

**Author:** ![elisa.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/elisa.zoom/32/47836_2.png) [@elisa.zoom](https://devforum.zoom.us/u/elisa.zoom)\
**Post date:** [August 21, 2024, 7:31pm UTC](https://devforum.zoom.us/t/how-to-integrate-zoom-meeting-in-net-core-application/116001/5 "2024-08-21T19:31:18Z")

</div>

Hi @thendral.d make sure to pass your email as a “user\_id” or the “me” parameter

---

<div class="post-metadata">

**Author:** ![thendral.d](https://avatars.discourse-cdn.com/v4/letter/t/c0e974/32.png) [@thendral.d](https://devforum.zoom.us/u/thendral.d)\
**Post date:** [August 21, 2024, 7:33pm UTC](https://devforum.zoom.us/t/how-to-integrate-zoom-meeting-in-net-core-application/116001/6 "2024-08-21T19:33:32Z")

</div>

I did , but still getting the error response

---

<div class="post-metadata">

**Author:** ![thendral.d](https://avatars.discourse-cdn.com/v4/letter/t/c0e974/32.png) [@thendral.d](https://devforum.zoom.us/u/thendral.d)\
**Post date:** [August 21, 2024, 8:48pm UTC](https://devforum.zoom.us/t/how-to-integrate-zoom-meeting-in-net-core-application/116001/7 "2024-08-21T20:48:14Z")

</div>

As per your previous reply

1. I have created account level server-to-server app
2. Got the client id,client secret and account id
3. made a post call to [https://zoom.us/oauth/token](https://zoom.us/oauth/token)
4. I get error “not found”
5. When I try the same in Postmand I get “Invalid grant type” error

I used the following code

```
       var tokenHandler = new System.IdentityModel.Tokens.Jwt.JwtSecurityTokenHandler();
       var now = DateTime.UtcNow;
       var apiSecret = "ak3bP9M6GNkXICUDNbR9VHoL1k5Evprn";
       byte[] symmetricKey = Encoding.ASCII.GetBytes(apiSecret);

       var tokenDescriptor = new SecurityTokenDescriptor
       {
           Issuer = "5wJdnzpjSPyQwn4MrhvyZg",
           Expires = now.AddSeconds(300),
           SigningCredentials = new SigningCredentials(new SymmetricSecurityKey(symmetricKey), SecurityAlgorithms.HmacSha256),
       };
       var token = tokenHandler.CreateToken(tokenDescriptor);
       var tokenString = tokenHandler.WriteToken(token);

       var encoding = new System.Text.ASCIIEncoding();
       byte[] messageBytesTest = encoding.GetBytes("fuux1tbRSmbShAIedMw7w:YiFHa36YpikhfL4U6MjLLb9ZDy9woZVE");
       string msgHashPreHmac = System.Convert.ToBase64String(messageBytesTest);
       var client1 = new RestClient("https://zoom.us/oauth/token");
       var request1 = new RestRequest(Method.Post.ToString());
       //request1.RequestFormat = DataFormat.Json;
       //request1.AddStringBody("grantype:account_credentials", "account_id:FkmZHX8iQ5OnYFjWPFkShg");
       request1.AddHeader("Content-Type", "application/x-www-form-urlencoded");
       request1.AddHeader("authorization", String.Format("Basic {0}", msgHashPreHmac));
       request1.AddParameter("grantype:account_credentials", ParameterType.RequestBody);
       request1.AddParameter("account_id:FkmZHX8iQ5OnYFjWPFkShg", ParameterType.RequestBody);

       var restResponse1 = client1.Execute<RestRequest>(request1);

       var client = new RestClient("https://api.zoom.us//v2/users/me/meetings");
       var request = new RestRequest(Method.Post.ToString());
       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));
       request.AddHeader("Content-Type", "application/json");

       var restResponse = client.Execute<RestRequest>(request);
       HttpStatusCode statusCode = restResponse.StatusCode;
       int numericStatusCode = (int)statusCode;
       var jObject = JObject.Parse(restResponse.Content);
       var Host = (string)jObject["start_url"];
       var Join = (string)jObject["join_url"];
       var Code = Convert.ToString(numericStatusCode);

       return NoContent();

```

---

<div class="post-metadata">

**Author:** ![chunsiong.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/chunsiong.zoom/32/35488_2.png) [@chunsiong.zoom](https://devforum.zoom.us/u/chunsiong.zoom)\
**Post date:** [August 22, 2024, 8:23am UTC](https://devforum.zoom.us/t/how-to-integrate-zoom-meeting-in-net-core-application/116001/8 "2024-08-22T08:23:31Z")

</div>

@thendral.d I’ll do something like this

Part 1, get an access token using S2S App. Use the client id, client secret and account id to get access token.

```auto
using Newtonsoft.Json;
using System.Text;
using System.Text.Json;

    public class s2soauth
    {

        public static Task S2SOauth(HttpContext context)
        {
            return Task.Run(async () =>
            {

                string s2s_oauth_client_id = Environment.GetEnvironmentVariable("S2S_OAUTH_CLIENT_ID"); 
                string s2s_oauth_client_secret = Environment.GetEnvironmentVariable("S2S_OAUTH_CLIENT_SECRET"); 
                string s2s_oauth_account_id = Environment.GetEnvironmentVariable("S2S_OAUTH_ACCOUNT_ID");

                // Access the environment variables
                var clientId = s2s_oauth_client_id;
                var clientSecret = s2s_oauth_client_secret;
                var accountId = s2s_oauth_account_id;
                var oauthUrl = $"https://zoom.us/oauth/token?grant_type=account_credentials&account_id={accountId}";

                try
                {
                    // Create the Basic Authentication header
                    var authHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes($"{clientId}:{clientSecret}"));

                    // Initialize HttpClient
                    using var client = new HttpClient();

                    // Create request message
                    var request = new HttpRequestMessage(HttpMethod.Post, oauthUrl);
                    request.Headers.Add("Authorization", $"Basic {authHeader}");

                    // Send request and get response
                    var response = await client.SendAsync(request);

                    // Check if the request was successful (status code 200)
                    if (response.IsSuccessStatusCode)
                    {
                        // Parse the JSON response to get the access token
                        var jsonResponse = await response.Content.ReadAsStringAsync();
                        var accessToken = JsonDocument.Parse(jsonResponse).RootElement.GetProperty("access_token").GetString();

                        // Set the "Content-Type" header to "application/json"
                        await context.Response.WriteAsync(JsonConvert.SerializeObject(accessToken));
                      
                    }
                    else
                    {
                        await context.Response.WriteAsync($"OAuth Request Failed with Status Code: {response.StatusCode}");
                      
                    }
                }
                catch (Exception e)
                {
                    await context.Response.WriteAsync($"An error occurred: {e.Message}");
                   
                }

            });
        }

   
    }

```

---

<div class="post-metadata">

**Author:** ![chunsiong.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/chunsiong.zoom/32/35488_2.png) [@chunsiong.zoom](https://devforum.zoom.us/u/chunsiong.zoom)\
**Post date:** [August 22, 2024, 8:24am UTC](https://devforum.zoom.us/t/how-to-integrate-zoom-meeting-in-net-core-application/116001/9 "2024-08-22T08:24:04Z")

</div>

@thendral.d

next I’ll use the access token to create a meeting with the code below

```auto
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
using System.Net.Http;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
public class callapi
{
    public static Task CallAPI(HttpContext context)
    {
        return Task.Run(async () =>
        {
            // Fetch access_token from query string
            var access_token = context.Request.Query["access_token"];

            // Meeting data
            var meeting_data = new
            {
                topic = "hello world",
                type = 2,
                start_time = "2023-10-01T10:00:00Z",
                duration = 120,
                password = "12345678",
                agenda = "40 mins limit demonstration",
                pre_schedule = false,
                timezone = "Asia/Singapore",
                default_password = false
            };

            // Zoom API endpoint
            var api_url = "https://api.zoom.us/v2/users/me/meetings";

            // Headers for the request
            var headers = new
            {
                Authorization = $"Bearer {access_token}",
                Content_Type = "application/json",
                Accept = "application/json"
            };

            // Send POST request to create meeting
            using var client = new HttpClient();
            using var request = new HttpRequestMessage(HttpMethod.Post, api_url);
            request.Content = new StringContent(JsonSerializer.Serialize(meeting_data), Encoding.UTF8, "application/json");

            foreach (var header in headers.GetType().GetProperties())
            {
                request.Headers.Add(header.Name, header.GetValue(headers).ToString());
            }

            var response = await client.SendAsync(request);

            // Return response
            await context.Response.WriteAsync("Meeting Details: " + await response.Content.ReadAsStringAsync());
        });

    }
}

 

```

---

<div class="post-metadata">

**Author:** ![thendral.d](https://avatars.discourse-cdn.com/v4/letter/t/c0e974/32.png) [@thendral.d](https://devforum.zoom.us/u/thendral.d)\
**Post date:** [August 22, 2024, 4:52pm UTC](https://devforum.zoom.us/t/how-to-integrate-zoom-meeting-in-net-core-application/116001/10 "2024-08-22T16:52:55Z")

</div>

@chunsiong.zoom Thank you , it worked now

---

<div class="post-metadata">

**Author:** ![thendral.d](https://avatars.discourse-cdn.com/v4/letter/t/c0e974/32.png) [@thendral.d](https://devforum.zoom.us/u/thendral.d)\
**Post date:** [August 22, 2024, 6:01pm UTC](https://devforum.zoom.us/t/how-to-integrate-zoom-meeting-in-net-core-application/116001/11 "2024-08-22T18:01:17Z")

</div>

Now I can successfully get the start and join url, now I need to know how I can embed that in angular. Can someone please help me with that?

---

<div class="post-metadata">

**Author:** ![thendral.d](https://avatars.discourse-cdn.com/v4/letter/t/c0e974/32.png) [@thendral.d](https://devforum.zoom.us/u/thendral.d)\
**Post date:** [August 22, 2024, 6:25pm UTC](https://devforum.zoom.us/t/how-to-integrate-zoom-meeting-in-net-core-application/116001/12 "2024-08-22T18:25:14Z")

</div>

Idea of the project is ,

1. There will be multiple users in our application.
2. On click of a button “user A” and “user B” should join the meeting.
3. There will be multiple meeting scheduled between the users.

I want to accomplish this in Angular and .Net core

So far I have done the following.

1. Created a Server to server app in zoom market place.
2. Got the access token and start and join url from .Net

My questions are

1. Will I get the same access token every time ?
2. With that access token will I be able to make different meeting windows in angular between users?
3. How can I embed the start url in angular?

Please help me with the questions.

---

<div class="post-metadata">

**Author:** ![thendral.d](https://avatars.discourse-cdn.com/v4/letter/t/c0e974/32.png) [@thendral.d](https://devforum.zoom.us/u/thendral.d)\
**Post date:** [August 22, 2024, 7:50pm UTC](https://devforum.zoom.us/t/how-to-integrate-zoom-meeting-in-net-core-application/116001/13 "2024-08-22T19:50:41Z")

</div>

I followed the below link to embed zoom meeting .

> **[GitHub - zoom/meetingsdk-angular-sample: Use the Zoom Meeting SDK in Angular](https://github.com/zoom/meetingsdk-angular-sample)**
>
> Use the Zoom Meeting SDK in Angular

But I get invalid sdk key error. I created server to server app and got the client id. I hope client id is the sdk key. Can someone please help me with this?

---

<div class="post-metadata">

**Author:** ![thendral.d](https://avatars.discourse-cdn.com/v4/letter/t/c0e974/32.png) [@thendral.d](https://devforum.zoom.us/u/thendral.d)\
**Post date:** [August 22, 2024, 7:51pm UTC](https://devforum.zoom.us/t/how-to-integrate-zoom-meeting-in-net-core-application/116001/14 "2024-08-22T19:51:43Z")

</div>

@chunsiong.zoom Can you please help me with this one if you have any idea?

---

<div class="post-metadata">

**Author:** ![chunsiong.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/chunsiong.zoom/32/35488_2.png) [@chunsiong.zoom](https://devforum.zoom.us/u/chunsiong.zoom)\
**Post date:** [August 23, 2024, 12:05am UTC](https://devforum.zoom.us/t/how-to-integrate-zoom-meeting-in-net-core-application/116001/15 "2024-08-23T00:05:29Z")

</div>

@thendral.d for meeting SDK, you will need to use the client ID and client secret from a General App with Meeting SDK enabled.

---

<div class="post-metadata">

**Author:** ![thendral.d](https://avatars.discourse-cdn.com/v4/letter/t/c0e974/32.png) [@thendral.d](https://devforum.zoom.us/u/thendral.d)\
**Post date:** [August 29, 2024, 6:20pm UTC](https://devforum.zoom.us/t/how-to-integrate-zoom-meeting-in-net-core-application/116001/16 "2024-08-29T18:20:09Z")

</div>

I created meeting from servertoserver app. used the component view to embed the meeting in angular.

When I leave or close or end the meeting and try to join in the same meeting again in the same browser I get the following error.

ERROR Error: Uncaught (in promise): Object: {“type”:“INVALID\_OPERATION”,“reason”:“Duplicated join operation”}

Also I want to know how i can end the meeting programmatically from .net.

@chunsiong.zoom Please provide your inputs.

---

<div class="post-metadata">

**Author:** ![chunsiong.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/chunsiong.zoom/32/35488_2.png) [@chunsiong.zoom](https://devforum.zoom.us/u/chunsiong.zoom)\
**Post date:** [August 30, 2024, 5:46am UTC](https://devforum.zoom.us/t/how-to-integrate-zoom-meeting-in-net-core-application/116001/17 "2024-08-30T05:46:21Z")

</div>

@thendral.d are you trying to join the same meeting from the 2 different browser tab? That is not supported

---

<div class="post-metadata">

**Author:** ![thendral.d](https://avatars.discourse-cdn.com/v4/letter/t/c0e974/32.png) [@thendral.d](https://devforum.zoom.us/u/thendral.d)\
**Post date:** [September 3, 2024, 3:42pm UTC](https://devforum.zoom.us/t/how-to-integrate-zoom-meeting-in-net-core-application/116001/18 "2024-09-03T15:42:53Z")

</div>

Steps I followed

1. I created a meeting and end it in a browser. (Meeting perfectly gets loaded in meetingSDKElement element)
2. Created another meeting and try to join in the same browser , the meeting is started in ([zoom.us](http://zoom.us)). But it is not loaded in “meetingSDKElement” element .

Can you please help me with this?

@chunsiong.zoom please help me.

---

<div class="post-metadata">

**Author:** ![chunsiong.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/chunsiong.zoom/32/35488_2.png) [@chunsiong.zoom](https://devforum.zoom.us/u/chunsiong.zoom)\
**Post date:** [September 4, 2024, 6:28am UTC](https://devforum.zoom.us/t/how-to-integrate-zoom-meeting-in-net-core-application/116001/19 "2024-09-04T06:28:13Z")

</div>

@thendral.d you cannot have 2 instances of the web SDK running on the same browser.

---

<div class="post-metadata">

**Author:** ![thendral.d](https://avatars.discourse-cdn.com/v4/letter/t/c0e974/32.png) [@thendral.d](https://devforum.zoom.us/u/thendral.d)\
**Post date:** [September 4, 2024, 2:37pm UTC](https://devforum.zoom.us/t/how-to-integrate-zoom-meeting-in-net-core-application/116001/20 "2024-09-04T14:37:15Z")

</div>

Is it possible with Web SDK Client view? @chunsiong.zoom

I should be able to join multiple meetings once previous meeting is completed in the same browser. How can I achieve this? Please help me with any workarounds.

[Next page](https://devforum.zoom.us/t/how-to-integrate-zoom-meeting-in-net-core-application/116001.md?page=2)
