I am trying to mute/unmute the mic using the patch request using the Zoom Rest API, but getting the error that the API end point is not recongnized.
here is the code:
static async Task MuteMic(string accessToken, string meetingId, string userId)
{
string muteUrl = $"https://api.zoom.us/v2/meetings/{meetingId}/participants/{userId}/audio";
var muteData = new
{
action = "mute"
};
var jsonData = JsonConvert.SerializeObject(muteData);
var content = new StringContent(jsonData, Encoding.UTF8, "application/json");
var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "Bearer " + accessToken);
try
{
var response = await client.PatchAsync(muteUrl, content);
var responseString = await response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
Console.WriteLine("Host microphone muted successfully.");
}
else
{
Console.WriteLine($"Failed to mute the microphone. Response: {responseString}");
Console.WriteLine($"Error Code: {response.StatusCode}");
}
}
catch (Exception ex)
{
Console.WriteLine("Error occurred while muting the mic: " + ex.Message);
}
}
i have the correct client id and secret, i am able to start the meeting correctly, get the user id and meeting id, but when i call this function i get error code 2300 and that the api end is not recognized