troubleshooting Question

C# class to Zoom API

Avatar of ITsolutionWizard
ITsolutionWizardFlag for United States of America asked on
ASP.NETC#JSON
3 Comments1 Solution58 ViewsLast Modified:
The following code is consuming Zoom API.
and I have two questions.

1. In Zoom, the response in json return settings. and Under settings it has audio, in_meeting and etc.
How should I construct the class to return the value?

2. var t1 = JsonConvert.DeserializeObject<Zoom>(response.Content), how can I loop all of the Zoom Class? Now I response.write one by one. using t1.class.


 public class Zoom
        {
            public string agenta { get; set; }
            public string created_at { get; set; }
            public string duration { get; set; }
            public string host_id { get; set; }
            public string id { get; set; }
            public string join_url { get; set; }
            public string start_time { get; set; }
            public string start_url { get; set; }
            public string status { get; set; }
            public string timezone { get; set; }
            public string topic { get; set; }
            public string type { get; set; }
            public string uuid { get; set; }
            public string settings { get; set; }//has more child class
        }

     protected void SubmitZoomAPIQuickTest_Click(object sender, EventArgs e)
        {
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
            var client = new RestSharp.RestClient("https://api.zoom.us/v2/meetings/22321312312321?occurrence_id=1586358000000");
            var request = new RestSharp.RestRequest(RestSharp.Method.GET);
            request.AddHeader("authorization", "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhd42342343242342340RDNKbFEiLCJleHAiOjE1ODY5MTIxNjcsImlhdCI6MTU4NjMwNzM2OH0.v3 - IKSULeXjYZGvwTeWc9Hzw - ss2L8x4qq7BxK8iAQM");
            IRestResponse response = client.Execute(request);
            #region return class 
            IRestResponse responseClass = client.Execute<Zoom>(request);
            if(responseClass.IsSuccessful)
            {
                var t1 = JsonConvert.DeserializeObject<Zoom>(response.Content);
                Response.Write("Setting:"+t1.settings+"<br>");
                Response.Write("Join URL:" + t1.join_url + "<br>"); 
            }
            #endregion 
        }
ASKER CERTIFIED SOLUTION
ste5an
Senior Developer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros