# Hi. I am trying to create a meeting through the ZOOM API. I am using the api\_key and JWT ,token. api returning the response code zero with content null

**URL:** <https://devforum.zoom.us/t/hi-i-am-trying-to-create-a-meeting-through-the-zoom-api-i-am-using-the-api-key-and-jwt-token-api-returning-the-response-code-zero-with-content-null/75424>\
**Category:** Meetings\
**Created:** [September 5, 2022, 5:42pm UTC](https://devforum.zoom.us/t/hi-i-am-trying-to-create-a-meeting-through-the-zoom-api-i-am-using-the-api-key-and-jwt-token-api-returning-the-response-code-zero-with-content-null/75424 "2022-09-05T17:42:43Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![tahirhussain858](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tahirhussain858/32/41092_2.png) [@tahirhussain858](https://devforum.zoom.us/u/tahirhussain858)\
**Post date:** [September 5, 2022, 5:42pm UTC](https://devforum.zoom.us/t/hi-i-am-trying-to-create-a-meeting-through-the-zoom-api-i-am-using-the-api-key-and-jwt-token-api-returning-the-response-code-zero-with-content-null/75424/1 "2022-09-05T17:42:43Z")

</div>

public ActionResult Index()  
{

```
        var getToken = GenerateToken();
        var client = new RestClient("https://api.zoom.us/v2/users/me/meetings");
        var request = new RestRequest(Method.POST);
        request.RequestFormat = DataFormat.Json;
        request.AddJsonBody(new { topic = "Meeting with Hussain", duration = "10", start_time = "2022-03-20T05:00:00", type = "2" });
        request.AddHeader("content-type", "application/json");
        request.AddHeader("MediaType", "application/json");
        request.AddHeader("Accept", "application/json");
        request.AddHeader("KeepAlive", "true");
        request.AddHeader("Authorization", String.Format("Bearer {0} ", getToken));

        IRestResponse restResponse = client.Execute(request);
        HttpStatusCode statusCode = restResponse.StatusCode;
        int numericStatusCode = (int)statusCode;
        var jObject = JObject.Parse(restResponse.Content);

        ZoomModel model = new ZoomModel();
        model.Host = (string)jObject["start_url"];
        model.Join = (string)jObject["join_url"];
        model.Code = Convert.ToString(numericStatusCode);
        return View(model);
    } 

```

private string **GenerateToken()**  
{  
var tokenHandler = new System.IdentityModel.Tokens.Jwt.JwtSecurityTokenHandler();  
var now = DateTime.UtcNow;  
string Apikey = “xxxxxxxxxxxxxxxx”; //Secret key which will be used later during validation  
string ApiSecretkey = “xxxxxxxxxxxxxxxx”; //Secret key which will be used later during validation

```
        byte[] symmetricKey = Encoding.ASCII.GetBytes(ApiSecretkey);

        var tokenDescriptor = new SecurityTokenDescriptor
        {
            Issuer = Apikey,
            Expires = now.AddSeconds(3600),
            SigningCredentials = new SigningCredentials(new SymmetricSecurityKey(symmetricKey), SecurityAlgorithms.HmacSha256),
        };
        var token = tokenHandler.CreateToken(tokenDescriptor);

        var tokenString = tokenHandler.WriteToken(token);
  
        return tokenString;
    }

```

---

<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:** [September 6, 2022, 6:05pm UTC](https://devforum.zoom.us/t/hi-i-am-trying-to-create-a-meeting-through-the-zoom-api-i-am-using-the-api-key-and-jwt-token-api-returning-the-response-code-zero-with-content-null/75424/2 "2022-09-06T18:05:26Z")

</div>

Hey @tahirhussain858  
Thanks for reaching out to the Zoom Developer Forum, I am happy to help here!  
Have you tried making a sample call with Postman or Insomia to make sure that you are passing the proper parameters?  
Cheers,  
Elisa

---

<div class="post-metadata">

**Author:** ![tahirhussain858](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tahirhussain858/32/41092_2.png) [@tahirhussain858](https://devforum.zoom.us/u/tahirhussain858)\
**Post date:** [September 6, 2022, 6:09pm UTC](https://devforum.zoom.us/t/hi-i-am-trying-to-create-a-meeting-through-the-zoom-api-i-am-using-the-api-key-and-jwt-token-api-returning-the-response-code-zero-with-content-null/75424/3 "2022-09-06T18:09:01Z")

</div>

yes i have test api at [https://web.postman.co/](https://web.postman.co/) and its return output as I expected

---

<div class="post-metadata">

**Author:** ![tahirhussain858](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tahirhussain858/32/41092_2.png) [@tahirhussain858](https://devforum.zoom.us/u/tahirhussain858)\
**Post date:** [September 6, 2022, 6:13pm UTC](https://devforum.zoom.us/t/hi-i-am-trying-to-create-a-meeting-through-the-zoom-api-i-am-using-the-api-key-and-jwt-token-api-returning-the-response-code-zero-with-content-null/75424/4 "2022-09-06T18:13:11Z")

</div>

Header

 ![Header](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/4/7/472bc9a4b242717df3b727cf793af48fd9c99cae.png)  
Body  
 ![Body](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/7/9/7926873b76940e8524bddb69a84f9df9fc6413db.png)  
Response  
 ![APi Response](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/a/1/a1eebce83a55422fefa7a8fcdddabb65ea4202fa.png)

---

<div class="post-metadata">

**Author:** ![tahirhussain858](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tahirhussain858/32/41092_2.png) [@tahirhussain858](https://devforum.zoom.us/u/tahirhussain858)\
**Post date:** [September 7, 2022, 7:16am UTC](https://devforum.zoom.us/t/hi-i-am-trying-to-create-a-meeting-through-the-zoom-api-i-am-using-the-api-key-and-jwt-token-api-returning-the-response-code-zero-with-content-null/75424/5 "2022-09-07T07:16:06Z")

</div>

API only working fine when I test it at [https://web.postman.co/](https://web.postman.co/)  
and it’s not working in my application and postman application locally, I’m tired.

---

<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:** [September 7, 2022, 11:46am UTC](https://devforum.zoom.us/t/hi-i-am-trying-to-create-a-meeting-through-the-zoom-api-i-am-using-the-api-key-and-jwt-token-api-returning-the-response-code-zero-with-content-null/75424/6 "2022-09-07T11:46:47Z")

</div>

Hi @tahirhussain858  
The only thing that comes to my mind is the way that you are generating the access token.  
Could you please check in our documentation if you are following the best practices:

> **[JWT With Zoom](https://marketplace.zoom.us/docs/guides/auth/jwt/#generating-jwts)**
>
> 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.

> **[JWT.IO](https://jwt.io/)**
>
> JSON Web Tokens are an open, industry standard RFC 7519 method for representing claims securely between two parties.

---

<div class="post-metadata">

**Author:** ![MultiplayerSession](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/multiplayersession/32/66446_2.png) [@MultiplayerSession](https://devforum.zoom.us/u/MultiplayerSession)\
**Post date:** [September 7, 2022, 4:28pm UTC](https://devforum.zoom.us/t/hi-i-am-trying-to-create-a-meeting-through-the-zoom-api-i-am-using-the-api-key-and-jwt-token-api-returning-the-response-code-zero-with-content-null/75424/7 "2022-09-07T16:28:26Z")

</div>

Which [Postman Agent](https://learning.postman.com/docs/getting-started/installation-and-updates/#selecting-the-agent-for-requests) are you using to send requests in the Postman web app (which is succeeding for you) versus the local Postman desktop app (which is failing for you)? I wonder if your local environment is trying to intercept the connection in some way (for example, corporate environments tend to want to monitor SSL connection contents).

---

<div class="post-metadata">

**Author:** ![tahirhussain858](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tahirhussain858/32/41092_2.png) [@tahirhussain858](https://devforum.zoom.us/u/tahirhussain858)\
**Post date:** [September 7, 2022, 11:08pm UTC](https://devforum.zoom.us/t/hi-i-am-trying-to-create-a-meeting-through-the-zoom-api-i-am-using-the-api-key-and-jwt-token-api-returning-the-response-code-zero-with-content-null/75424/8 "2022-09-07T23:08:27Z")

</div>

I’m using this method to generate JWT token  
public static string ZoomToken()  
{  
// Token will be good for 20 minutes  
DateTime Expiry = DateTime.UtcNow.AddMinutes(30);

```
        string ApiKey = "zzzzzzzzzzzzzzzzzzzzz";
        string ApiSecret = "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz";

        int ts = (int)(Expiry - new DateTime(1970, 1, 1)).TotalSeconds;

        // Create Security key using private key above:
        var securityKey = new Microsoft.IdentityModel.Tokens.SymmetricSecurityKey(Encoding.UTF8.GetBytes(ApiSecret));

        // length should be >256b
        var credentials = new SigningCredentials(securityKey, SecurityAlgorithms.HmacSha256);

        //Finally create a Token
        var header = new JwtHeader(credentials);

        //Zoom Required Payload
        var payload = new JwtPayload

```

{  
{ “iss”, ApiKey},  
{ “exp”, ts },  
};

```
        var secToken = new JwtSecurityToken(header, payload);
        var handler = new JwtSecurityTokenHandler();

        // Token to String so you can use it in your client
        var tokenString = handler.WriteToken(secToken);

        return tokenString;
    }

```

---

<div class="post-metadata">

**Author:** ![tahirhussain858](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tahirhussain858/32/41092_2.png) [@tahirhussain858](https://devforum.zoom.us/u/tahirhussain858)\
**Post date:** [September 8, 2022, 4:59pm UTC](https://devforum.zoom.us/t/hi-i-am-trying-to-create-a-meeting-through-the-zoom-api-i-am-using-the-api-key-and-jwt-token-api-returning-the-response-code-zero-with-content-null/75424/9 "2022-09-08T16:59:42Z")

</div>

IRestResponse response = client.Execute(request) c# return error message **The underlying connection was closed: An unexpected error occurred on a send.**

---

<div class="post-metadata">

**Author:** ![tahirhussain858](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tahirhussain858/32/41092_2.png) [@tahirhussain858](https://devforum.zoom.us/u/tahirhussain858)\
**Post date:** [September 9, 2022, 6:45pm UTC](https://devforum.zoom.us/t/hi-i-am-trying-to-create-a-meeting-through-the-zoom-api-i-am-using-the-api-key-and-jwt-token-api-returning-the-response-code-zero-with-content-null/75424/10 "2022-09-09T18:45:36Z")

</div>

Hi! Thanks to all Zoom Dev Team I have found the solution and now the issue is fixed, just Configure ServicePointManager.SecurityProtocol through AppSettings in the project,now zoom meeting created successfully.
