Update meetings get status code "ok" but meeting not any changes?

Update meetings get status code “ok” but meeting not any changes?

System.Net.HttpWebRequest request = System.Net.HttpWebRequest.Create("https://api.zoom.us/v2/users/me/meetings/" + rootMeetings.id) as System.Net.HttpWebRequest;

        request.Method = "PATCH";
        request.ContentType = "application/json"; //formatting the search string so that it wont give  media type error
        request.MediaType = "application/json";
        request.Accept = "application/json";
        request.KeepAlive = true;

        //request.Headers.Add("Content-type", "application/json");
        request.Headers.Add("authorization", "Bearer " + this.Token);
        DateTime startTime;
        if (DateTime.TryParse(rootMeetings.start_time, out startTime))
        {
            rootMeetings.start_time = startTime.ToString("s")+"Z";
        }
        string json = Newtonsoft.Json.JsonConvert.SerializeObject(new
        {
            topic = rootMeetings.topic,
            agenda = rootMeetings.agenda,
            start_time = rootMeetings.start_time,
            duration = rootMeetings.duration.ToString(),
            type=2
        });
        ZoomAPITracker zoomAPITracker = new ZoomAPITracker() { RequestData = json };
        AddAPITracker(zoomAPITracker);
        try
        {
            byte[] data = System.Text.Encoding.ASCII.GetBytes(json);

            request.ContentType = "application/json";
            request.ContentLength = data.Length;
            //ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
            ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072;
            System.IO.Stream newStream = request.GetRequestStream();
            newStream.Write(data, 0, data.Length);
            newStream.Close();

            // instantiate a new response object
            System.Net.HttpWebResponse response = request.GetResponse() as System.Net.HttpWebResponse;
            zoomAPITracker.MeetingId = rootMeetings.id.ToString();
            zoomAPITracker.ResponseData = response.StatusDescription;
            AddAPITracker(zoomAPITracker);
            if ((int)response.StatusCode==200)
            {
                var updateMeetings = GetMeetingById(rootMeetings.id).Data;
                return new AddUpdateDelete<ResponseRootMeetings>() { Status = true, Data = updateMeetings };
            }
           
            return new AddUpdateDelete<ResponseRootMeetings>() { Status = false};
        }
        catch (Exception ex)
        {

            return new AddUpdateDelete<ResponseRootMeetings>() { Status = false };
        }

Error
Not update meeting data

version 2

Hey @augursmail,

Can you share the request body in JSON format so I can try to reproduce the issue on my end?

Thanks,
Tommy

Hii tommy Thank you for reply!
Issue solved my side. This is solution->
try
{
var client = new RestClient($“https://api.zoom.us/v2/meetings/” + rootMeetings.id + “?occurrence_id=”);
client.Timeout = -1;
var request = new RestRequest(Method.PATCH);
//request.AddHeader(“Content-Type”, “application/json”);
request.AddHeader(“Accept”, “application/json”);
request.AddHeader(“authorization”, "Bearer " + this.Token);
DateTime startTime;
if (!DateTime.TryParse(rootMeetings.start_time, out startTime))
{
return new AddUpdateDelete() { Status = false, Message = AppSettingMessages.InvalidRequest.Message };
}
request.AddJsonBody(new UpdateMeetingRequest
{
agenda = rootMeetings.agenda,
duration = rootMeetings.duration,
start_time = startTime.ToString(“s”),
topic = rootMeetings.topic,
type = 2,
timezone = rootMeetings.timezone
});
IRestResponse response = client.Execute(request);
if ((int)response.StatusCode == 204)
{
var updateMeetings = GetMeetingById(rootMeetings.id).Data;
return new AddUpdateDelete() { Status = true, Data = updateMeetings };
}
else
{
return new AddUpdateDelete() { Status = false, Message = AppSettingMessages.InvalidRequest.Message };
}
}
catch(Exception ex)
{
new CreateLogFile(ex);
return new AddUpdateDelete() { Status = false, Message = AppSettingMessages.ErrorMessage.Message };
}

Hey @augursmail,

Glad you were able to figure it out! :slight_smile:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.