Description
Hi team,
In my web application , I am calling zoom create api using jwt token which is generated by using api_key and secret key which giving me response as expected on local server (development environment).But same on production giving me “” blank response.
What to do in order to get proper response on production.
Same apikey and secret key are used to generate jwt token on production.
Error
Not getting error but getting 200 status code and blank response
Which App Type (OAuth / Chatbot / JWT / Webhook)?
Jwt app type Account type basic
Which Endpoint/s?
api_key and secret key
How To Reproduce (If applicable)
Steps to reproduce the behavior:
var client = new RestClient(“https://api.zoom.us/v2/users/me/meetings”);
//var client = new RestClient(“https://api.zoom.us/v2/users?status=active&page_size=300&page_number=1”);
var request = new RestRequest(Method.POST);
request.AddHeader(“content-type”, “application/json”);
request.AddHeader(“authorization”, String.Format(“Bearer {0}”, ZoomUtility.ZoomToken()));
// request.AddHeader(“authorization”, String.Format(“Bearer {0}”, “eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdWQiOm51bGwsImlzcyI6IkVPTVJXb2g3UU5tbTBDUTdHRUszenciLCJleHAiOjE1OTYwMzgyODAsImlhdCI6MTU5NTk1MTg5Mn0.AmBujF-9uN2ttlzKn1szm8GoADDiKh2XIGn-mp4_6kc”));
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(20);
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;
}