cancel
Showing results for 
Search instead for 
Did you mean: 
Effective January 9th, 2026 through January 22nd, 2026: The Zoom Community is currently in read-only mode with login disabled, to deliver you a new and improved community experience!

The site is still accessible to view, however, the ability to login, create content, or access your community account is temporarily unavailable. We appreciate your patience during this time. If seeking support, please browse existing community content or ask our Zoom Virtual Agent.

Create meeting API gives 401 error in server

rahulchaudhary
Newcomer
Newcomer

When I create a meeting locally it working fine but not in production(server)

 

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/v2/users/rahulchaudhary.sce@gmail.com/meetings");
var request = new RestRequest(Method.POST);
request.RequestFormat = DataFormat.Json;
request.AddJsonBody(new { topic = "Meeting with Rahul", duration = "10", start_time = "2021-04-20T05:00:00", type = "2" });

request.AddHeader("authorization", String.Format("Bearer {0}", tokenString));
IRestResponse restResponse = client.Execute(request);
HttpStatusCode statusCode = restResponse.StatusCode;
int numericStatusCode = (int)statusCode;
var jObject = JObject.Parse(restResponse.Content);

1 REPLY 1

colegs
Community Champion | Employee
Community Champion | Employee

Rahul, 

 

Welcome to the Zoom Community!  Can you tell me if you are using the same account for both your local and server applications?

 

Dean