Hello,
We’ve implemented a method to update the user’s presence status, and although we receive a 200 response, the client’s status isn’t actually being updated. It’s worth noting that the client is currently logged in. Could you kindly provide suggestions on what steps we could take to address this issue?
public async Task<bool> SetMemberPresenceStatus(Holiday member, string presenceStatus)
{
_settings ??= await _sqlDal.GetZoomSetting();
await RefreshAccessToken();
try
{
var handler = new HttpClientHandler();
using (var client = new HttpClient(new RetryHandler(handler)))
{
client.BaseAddress = new Uri("https://api.zoom.us/");
client.DefaultRequestHeaders.Clear();
client.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue("Bearer", _settings.AccessToken);
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
var endpoint = $"v2/users/{member.Email}/presence_status={presenceStatus}";
var response = await client.PutAsync(endpoint, null);
if (!response.IsSuccessStatusCode)
{
AppLog.Instance.Warn($"Code: {response.StatusCode}, Reason: {response.ReasonPhrase}");
var errorMessage = await response.Content.ReadAsStringAsync();
AppLog.Instance.WriteError(errorMessage);
return false;
}
return true;
}
}
catch (Exception exception)
{
AppLog.Instance.WriteError(exception.Message, exception);
return false;
}
}