Issue with updating users presence status via API

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;
		}
	}

You have presence_status with a query param value? I do not code in this language, but it seems the PUT update is not happening in the request body. Please see our Postman workspace example:

https://www.postman.com/zoom-developer/workspace/zoom-public-workspace/request/22097587-94110f8e-5789-4e0f-aa9e-7050a14d14c6

Yes, it is passed as param to the method.

Hi @amushtaq ,

Please try in the Postman workspace. Change should be made in the request body not applied to query parameter.

The issue is resolved.
Thanks

Sent securely from Check Point Capsule Workspace

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