# Issue with updating users presence status via API

**URL:** <https://devforum.zoom.us/t/issue-with-updating-users-presence-status-via-api/93784>\
**Category:** API and Webhooks\
**Created:** [August 22, 2023, 2:38pm UTC](https://devforum.zoom.us/t/issue-with-updating-users-presence-status-via-api/93784 "2023-08-22T14:38:54Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![amushtaq](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/amushtaq/32/51326_2.png) [@amushtaq](https://devforum.zoom.us/u/amushtaq)\
**Post date:** [August 22, 2023, 2:38pm UTC](https://devforum.zoom.us/t/issue-with-updating-users-presence-status-via-api/93784/1 "2023-08-22T14:38:54Z")

</div>

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

```

---

<div class="post-metadata">

**Author:** ![gianni.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/gianni.zoom/32/32523_2.png) [@gianni.zoom](https://devforum.zoom.us/u/gianni.zoom)\
**Post date:** [August 23, 2023, 4:00pm UTC](https://devforum.zoom.us/t/issue-with-updating-users-presence-status-via-api/93784/3 "2023-08-23T16:00:35Z")

</div>

> [@amushtaq](#):
>
> `var endpoint = $"v2/users/{member.Email}/presence_status={presenceStatus}"`

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](https://www.postman.com/zoom-developer/workspace/zoom-public-workspace/request/22097587-94110f8e-5789-4e0f-aa9e-7050a14d14c6)

---

<div class="post-metadata">

**Author:** ![amushtaq](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/amushtaq/32/51326_2.png) [@amushtaq](https://devforum.zoom.us/u/amushtaq)\
**Post date:** [August 24, 2023, 8:38am UTC](https://devforum.zoom.us/t/issue-with-updating-users-presence-status-via-api/93784/4 "2023-08-24T08:38:13Z")

</div>

Yes, it is passed as param to the method.

---

<div class="post-metadata">

**Author:** ![gianni.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/gianni.zoom/32/32523_2.png) [@gianni.zoom](https://devforum.zoom.us/u/gianni.zoom)\
**Post date:** [August 24, 2023, 4:55pm UTC](https://devforum.zoom.us/t/issue-with-updating-users-presence-status-via-api/93784/5 "2023-08-24T16:55:15Z")

</div>

Hi @amushtaq ,

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

---

<div class="post-metadata">

**Author:** ![amushtaq](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/amushtaq/32/51326_2.png) [@amushtaq](https://devforum.zoom.us/u/amushtaq)\
**Post date:** [August 24, 2023, 5:05pm UTC](https://devforum.zoom.us/t/issue-with-updating-users-presence-status-via-api/93784/6 "2023-08-24T17:05:55Z")

</div>

The issue is resolved.  
Thanks

Sent securely from Check Point Capsule Workspace

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [August 25, 2023, 5:06pm UTC](https://devforum.zoom.us/t/issue-with-updating-users-presence-status-via-api/93784/7 "2023-08-25T17:06:33Z")

</div>

Closed on August 25, 2023, 5:06pm UTC

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