# Issue creating meeting using JWT

**URL:** <https://devforum.zoom.us/t/issue-creating-meeting-using-jwt/53091>\
**Category:** API and Webhooks\
**Created:** [June 24, 2021, 3:33pm UTC](https://devforum.zoom.us/t/issue-creating-meeting-using-jwt/53091 "2021-06-24T15:33:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![emjay](https://avatars.discourse-cdn.com/v4/letter/e/a88e57/32.png) [@emjay](https://devforum.zoom.us/u/emjay)\
**Post date:** [June 24, 2021, 3:33pm UTC](https://devforum.zoom.us/t/issue-creating-meeting-using-jwt/53091/1 "2021-06-24T15:33:16Z")

</div>

I am attempting to create a zoom meeting using C# with JWT authentication.  
I can create a meeting using Postman but struggling through my code.  
I am getting an empty response back and no meeting is created.

```
    [WebMethod]
	public String AddZoomMeetingLink(String b)
	{

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

		var tokenDescriptor = new Microsoft.IdentityModel.Tokens.SecurityTokenDescriptor
		{
			Issuer = "myapikey",
			Expires = now.AddSeconds(30),
			SigningCredentials = new Microsoft.IdentityModel.Tokens.SigningCredentials(new Microsoft.IdentityModel.Tokens.SymmetricSecurityKey(symmetricKey), Microsoft.IdentityModel.Tokens.SecurityAlgorithms.HmacSha256Signature)
		};

		var token = tokenHandler.CreateToken(tokenDescriptor);
		var tokenString = tokenHandler.WriteToken(token);

		JObject jObjectbody = new JObject();
		jObjectbody.Add("topic", "test");
		jObjectbody.Add("duration", "10");
		jObjectbody.Add("start_time", "2021-06-30T05:00:00");
		jObjectbody.Add("type", "2");

		var client = new RestClient("https://api.zoom.us/v2/users/myemail@mycompany.com/meetings");		
		var request = new RestRequest(Method.POST);
		request.AddHeader("authorization", String.Format("Bearer {0}", tokenString));
		request.AddHeader("content-type", "application/json");
		request.AddParameter("application/json", jObjectbody, ParameterType.RequestBody);
		IRestResponse restResponse = client.Execute(request);
		HttpStatusCode statusCode = restResponse.StatusCode;
		return restResponse.Content;
	}

```

Any help greatly appreciated

---

<div class="post-metadata">

**Author:** ![will.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/will.zoom/32/14417_2.png) [@will.zoom](https://devforum.zoom.us/u/will.zoom)\
**Post date:** [June 25, 2021, 4:50pm UTC](https://devforum.zoom.us/t/issue-creating-meeting-using-jwt/53091/2 "2021-06-25T16:50:24Z")

</div>

Hi @emjay,

Happy to help! Can you try using this sample below in C# and let me know if it helps? You’ll need to plug in your own token and user ID:

```auto
var client = new RestClient("https://api.zoom.us/v2/users/{userId}/meetings");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {token}");
request.AddParameter("application/json", "{\n \"topic\": \"Test\",\n \"start_time\": \"2021-07-17T11:50:00\",\n \"timezone\": \"Asia/Kolkata\",\n \"duration\": \"30\",\n \"type\": 2\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);

```

Thanks!  
Will

---

<div class="post-metadata">

**Author:** ![emjay](https://avatars.discourse-cdn.com/v4/letter/e/a88e57/32.png) [@emjay](https://devforum.zoom.us/u/emjay)\
**Post date:** [June 28, 2021, 11:00am UTC](https://devforum.zoom.us/t/issue-creating-meeting-using-jwt/53091/3 "2021-06-28T11:00:25Z")

</div>

Hi Will, thanks for your reply.

To Fix I had to specify the tls version before my call:

ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;

I turned off Tls 1.0 and Tls 1.1 on my machine but still had to specify the correct version.

---

<div class="post-metadata">

**Author:** ![will.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/will.zoom/32/14417_2.png) [@will.zoom](https://devforum.zoom.us/u/will.zoom)\
**Post date:** [June 29, 2021, 4:44pm UTC](https://devforum.zoom.us/t/issue-creating-meeting-using-jwt/53091/4 "2021-06-29T16:44:09Z")

</div>

Ah, I see—thank you for sharing @emjay 🙂

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [July 30, 2021, 2:45am UTC](https://devforum.zoom.us/t/issue-creating-meeting-using-jwt/53091/5 "2021-07-30T02:45:07Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
