# {"code":124,"message":"The Token can't be used before"} when trying to create a meeting using JWT

**URL:** <https://devforum.zoom.us/t/code-124-message-the-token-cant-be-used-before-when-trying-to-create-a-meeting-using-jwt/57100>\
**Category:** API and Webhooks\
**Created:** [September 8, 2021, 10:29am UTC](https://devforum.zoom.us/t/code-124-message-the-token-cant-be-used-before-when-trying-to-create-a-meeting-using-jwt/57100 "2021-09-08T10:29:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![praveenag](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/praveenag/32/30847_2.png) [@praveenag](https://devforum.zoom.us/u/praveenag)\
**Post date:** [September 8, 2021, 10:29am UTC](https://devforum.zoom.us/t/code-124-message-the-token-cant-be-used-before-when-trying-to-create-a-meeting-using-jwt/57100/1 "2021-09-08T10:29:48Z")

</div>

**Description**  
I’m trying to schedule a zoom meeting by using JWT in C# [ASP.NET](http://ASP.NET). However, when I try to call below request URL the error pops up as,

Request Url: [https://api.zoom.us/v2/users/{0}/meetings](https://api.zoom.us/v2/users/%7B0%7D/meetings)

Response :{“code”:124,“message”:“The Token can’t be used before Wed Sep 08 10:17:07 UTC 2021.”}

**Error**  
Response :{“code”:124,“message”:“The Token can’t be used before Wed Sep 08 10:17:07 UTC 2021.”}

**Which App Type (OAuth / Chatbot / JWT / Webhook)?**  
JWT

**How To Reproduce (If applicable)**

```auto
var client = new RestClient("https://api.zoom.us/v2/users/my_user_id/meetings");
var request = new RestRequest(Method.POST);
request.RequestFormat = DataFormat.Json;
request.AddJsonBody(new { topic = meetingDescription, duration = duration, start_time = startDateTime, type = 2 });
equest.AddHeader("authorization", String.Format("Bearer {0}", tokenString));

//Get Response
var restResponse = client.Execute(request);

```

**Additional context**  
I have noticed that in the response headers Date is always few seconds behind the ValidFrom date of JWT token.

---

<div class="post-metadata">

**Author:** ![MaxM](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/maxm/32/42303_2.png) [@MaxM](https://devforum.zoom.us/u/MaxM)\
**Post date:** [September 10, 2021, 5:54pm UTC](https://devforum.zoom.us/t/code-124-message-the-token-cant-be-used-before-when-trying-to-create-a-meeting-using-jwt/57100/2 "2021-09-10T17:54:03Z")

</div>

Hey @praveenag,

Thank you for reaching out to the Zoom Developer Forum. Please make sure that your server is using a UTC timezone when generating the JWT token and making the request.

If that doesn’t help, please send an email to [developersupport@zoom.us](mailto:developersupport@zoom.us) with a link to this thread as well as the JWT token you’re seeing issues with.

Let me know if that helps.

Thanks,  
Max

---

<div class="post-metadata">

**Author:** ![praveenag](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/praveenag/32/30847_2.png) [@praveenag](https://devforum.zoom.us/u/praveenag)\
**Post date:** [September 12, 2021, 10:58am UTC](https://devforum.zoom.us/t/code-124-message-the-token-cant-be-used-before-when-trying-to-create-a-meeting-using-jwt/57100/3 "2021-09-12T10:58:37Z")

</div>

Hi @MaxM,

Thank you for your response. I have been able to resolve the issue by using below code posted by @k.krylov on [How to create JWT token using REST api in c#](https://devforum.zoom.us/t/how-to-create-jwt-token-using-rest-api-in-c/6620) to generate the JWT Token. Posting the code below,

```auto
public static string ZoomToken()
{
// Token will be good for 20 minutes
DateTime Expiry = DateTime.UtcNow.AddMinutes(20);

string ApiKey = ConfigurationManager.AppSettings["ClientIdJwt"];
string ApiSecret = ConfigurationManager.AppSettings["ClientSecretJwt"];

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:** ![MaxM](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/maxm/32/42303_2.png) [@MaxM](https://devforum.zoom.us/u/MaxM)\
**Post date:** [September 14, 2021, 11:07pm UTC](https://devforum.zoom.us/t/code-124-message-the-token-cant-be-used-before-when-trying-to-create-a-meeting-using-jwt/57100/4 "2021-09-14T23:07:47Z")

</div>

Awesome! Thanks for sharing your solution.

I’ll go ahead and close this topic now but feel free to open a new topic if you encounter any further issues or questions.

Max

---

<div class="post-metadata">

**Author:** ![MaxM](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/maxm/32/42303_2.png) [@MaxM](https://devforum.zoom.us/u/MaxM)\
**Post date:** [September 14, 2021, 11:07pm UTC](https://devforum.zoom.us/t/code-124-message-the-token-cant-be-used-before-when-trying-to-create-a-meeting-using-jwt/57100/5 "2021-09-14T23:07:50Z")

</div>

Closed on September 14, 2021, 11:07pm UTC


