I’m working with the example from Zoom Developer Postman examples for creating meetings. I can get a bearer token using OAuth and use is in the Auth section in Postman. Below is the C# httpclient code created by postman. I know the Bad Request typically means bad JSON, but the below is just taking the example code and adjusting. I have also tried the url using email address also.
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, “https://api.zoom.us/v2/users/me/meetings”);
request.Headers.Add(“Authorization”, “Bearer eyJzdiI6IjAwMDAwMSIsImFsZyI6IkhTNTEyIiwidiI6IjIuMCIsImtpZCI6ImQwZGQ4YjFlLTE1NTEtND1Ny1iYTM2LTYwOGE2YWZhZGQ5YSJ9.eyJhdWQiOiJodHRwczovL29hdXRoLnpvb20udXMiLCJ1aWQiOiJlaTF6QzFYWlR0S0RVRkV1TVpYaTVBIiwidmVyIjo5LCJhdWlkIjoiMDQxMTEyNThjNzcwMWM3ZGRjZGE2ZmMxZGU1NzFiYjIiLCJuYmYiOjE2ODE4NzEzNDksImNvZGUiOiJ6MG92ajN1R1NSQzlSaFphNmRxSFF3Rm1UNERkV2Q5WFMiLCJpc3MiOiJ6bTpjaWQ6aUVpUFlDVGJUZzZxSlVmWlR0X0JTdyIsImdubyI6MCwiZXhwIjoxNjgxODc0OTQ5LCJ0eXBlIjozLCJpYXQiOjE2ODE4NzEzNDksImFpZCI6IlBVVDhzOHB0VGJpR2FiVVRTQ0tMbHcifQ.b0M6ZH7EIGYxglmcS1B7wBaMMtJNr_YhNNq_rg2Y-gzNDp-ZiRIolYkPkJNKPiaw8Fw_y37NupjHUZ3rQg0E-A”);
var content = new StringContent(“{\n "agenda": "My Meeting",\n "duration": 60,\n "start_time": "2022-04-19T07:32:55Z",\n "topic": "My Meeting",\n "type": 2\n}”, null, “application/json”);
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
I changed accounts and used this Zoom video (How to create and use a Server to Server OAuth app - YouTube) to recreate Server to Server OAuth. It works fine and I get the bearer token. I used the bearer token to get Userid info and that worked. I then setup the Create Meeting as shown in the video, validated the body JSON, and still am getting 400 Bad Request response: