# {"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:** 1\
**Showing post:** 3

<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;
}

```

---

_[View the full topic](https://devforum.zoom.us/t/code-124-message-the-token-cant-be-used-before-when-trying-to-create-a-meeting-using-jwt/57100)._
