Now the server where I am calling zoom api for create meeting still providing response as blank.
i am using c# asp.net core application where i have implemented function as below. In that function jwt token geerated using ZoomToken() function.
This is working fine in my local server but giving blank response when run on UAT server whish i used to host application.
Kindly find the following steps:
this function i am calling from our iis server
var client = new RestClient(“https://api.zoom.us/v2/users/me/meetings”);
var request = new RestRequest(Method.POST);
request.AddHeader(“content-type”, “application/json”);
request.AddHeader(“authorization”, String.Format(“Bearer {0}”,ZoomUtility.ZoomToken()));
request.AddParameter(“application/json”, “{“topic”:“Meeting”,“type”:“1”,“start_time”:”" + sdate + “”,“duration”:“120”,“schedule_for”:null,“timezone”:“Asia/Calcutta”,“password”:"",“agenda”:"",“recurrence”:{“type”:“2”,“repeat_interval”:"",“weekly_days”:"",“monthly_day”:"",“monthly_week”:"",“monthly_week_day”:"",“end_times”:"",“end_date_time”:"" + edate + “”},“settings”:{“host_video”:true,“participant_video”:false,“cn_meeting”:false,“in_meeting”:true,“join_before_host”:false,“mute_upon_entry”:false,“watermark”:false,“use_pmi”:false,“approval_type”:“1”,“registration_type”:“1”,“audio”:"",“auto_recording”:"",“enforce_login”:"",“enforce_login_domains”:"",“alternative_hosts”:"",“global_dial_in_countries”:[""],“registrants_email_notification”:true}}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
var content = response.Content;
public static string ZoomToken()
{
// Token will be good for 20 minutes
DateTime Expiry = DateTime.UtcNow.AddMinutes(1440);
int ts = (int)(Expiry - new DateTime(1970, 1, 1)).TotalSeconds;
string apiSecret = ZoomAPISecretString();
string apiKey = ZoomAppKeyString();
// Create Security key using private key above:
var securityKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(apiSecret));
// I did changes in below line because DLL needed HmacSha256Signature instead of HmacSha256
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;
}