# Using API/JWT to change user, get a 204 success but change is not done

**URL:** <https://devforum.zoom.us/t/using-api-jwt-to-change-user-get-a-204-success-but-change-is-not-done/11589>\
**Category:** API and Webhooks\
**Created:** [April 6, 2020, 4:13pm UTC](https://devforum.zoom.us/t/using-api-jwt-to-change-user-get-a-204-success-but-change-is-not-done/11589 "2020-04-06T16:13:00Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![marc.furrer](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/marc.furrer/32/5217_2.png) [@marc.furrer](https://devforum.zoom.us/u/marc.furrer)\
**Post date:** [April 6, 2020, 4:13pm UTC](https://devforum.zoom.us/t/using-api-jwt-to-change-user-get-a-204-success-but-change-is-not-done/11589/1 "2020-04-06T16:13:00Z")

</div>

**Description**

I have a python script that should just allow managing a user.

```auto
from zoomus import ZoomClient
import config
client = ZoomClient(config.API_KEY, config.API_SECRET)
user_r = client.user.get( id = args.email )
user = json.loads(user_r.content)

```

I get proper answer.

Then I modify the user and send the modification

```auto
user['dept'] = "Test"
res = client.user.update(id = user['id'], data = user)

```

**Error**

I get a 204 answer with a null body.

but data of the user is not changed.

**Which App Type (OAuth / Chatbot / JWT / Webhook)?**

Using JWT

**Which Endpoint/s?**

PATCH /v2/users/

**Other**

using python zoomus package. Enabled the urlib3 debugging and every parameters looks ok.

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [April 7, 2020, 12:47am UTC](https://devforum.zoom.us/t/using-api-jwt-to-change-user-get-a-204-success-but-change-is-not-done/11589/2 "2020-04-07T00:47:41Z")

</div>

Hey @marc.furrer,

Can you send us the link to the python zoomus package you are using?

Also do you have SSO turned on? [You may not be allowed to edit the department.](https://support.zoom.us/hc/en-us/articles/115005887566-Configuring-Zoom-with-Azure#h_4697e396-7edb-478f-be0d-b53e066f9fb4)

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![marc.furrer](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/marc.furrer/32/5217_2.png) [@marc.furrer](https://devforum.zoom.us/u/marc.furrer)\
**Post date:** [April 7, 2020, 6:57am UTC](https://devforum.zoom.us/t/using-api-jwt-to-change-user-get-a-204-success-but-change-is-not-done/11589/3 "2020-04-07T06:57:59Z")

</div>

Hi @tommy  
I am not using SSO, python package is `zoomus`, details below.  
I you have another recommandation, I am happy to hear about it, nothing much developed yet 🙂  
Best regards,  
Marc.

```auto
 pip show zoomus
Name: zoomus
Version: 1.1.1
Summary: Python client library for Zoom.us REST API v1 and v2
Home-page: https://github.com/actmd/zoomus
Author: Zoomus Contributors
Author-email: zoomus@googlegroups.com
License: Apache Software License
Location: /dev/zoom-scritps/venv/lib/python3.6/site-packages
Requires: requests, PyJWT

```

---

<div class="post-metadata">

**Author:** ![marc.furrer](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/marc.furrer/32/5217_2.png) [@marc.furrer](https://devforum.zoom.us/u/marc.furrer)\
**Post date:** [April 7, 2020, 2:39pm UTC](https://devforum.zoom.us/t/using-api-jwt-to-change-user-get-a-204-success-but-change-is-not-done/11589/4 "2020-04-07T14:39:38Z")

</div>

I have simplified my script, here is the debug form url lib:

```auto
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): api.zoom.us:443
send: b'PATCH /v2/users/xxxxxxxxxxxxxxxxxxxxxxx HTTP/1.1\r\nHost: api.zoom.us\r\nUser-Agent: python-requests/2.23.0\r\nA
ccept-Encoding: gzip, deflate\r\nAccept: */*\r\nConnection: keep-alive\r\nAuthorization: Bearer x
vS3ak\r\nContent-Type: application/json\r\nContent-Length: 73\r\n\r\n'
send: b'{"id": "xxxxxxxxxxxxxxxxxxxxxxx", "data": {"dept": "MFU-Test", "type": 1}}'
reply: 'HTTP/1.1 204 \r\n'
DEBUG:urllib3.connectionpool:https://api.zoom.us:443 "PATCH /v2/users/xxxxxxxxxxxxxxxxxxxxxxx HTTP/1.1" 204 0

```

and log from the API is :

```auto
 {
endpoint: "https://api.zoom.us/v2/users/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
response_headers: [
"Set-Cookie: zm_aid=""; Domain=.zoom.us; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/; Secure; HttpOnly"],

date_time: "2020-04-07 08:59:12",
method: "PATCH",
request_body: "{"id":"xxxxxxxxxxxxxxxxxxxxxxx ","data":{"dept":"MFU-Test","type":1}}",
response: "N/A",
request_headers: [
"accept-encoding: gzip, deflate",
"accept: */*",
"authorization: ******",
"connection: close",
"content-type: application/json",
"user-agent: python-requests/2.23.0"
],
request_params: [
],
http_status: "204"
} 

```

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [April 7, 2020, 9:07pm UTC](https://devforum.zoom.us/t/using-api-jwt-to-change-user-get-a-204-success-but-change-is-not-done/11589/5 "2020-04-07T21:07:02Z")

</div>

Hey @marc.furrer,

Thanks for sharing logs, I now see the issue. The request body is incorrect.

```json
{"id":"xxxxxxxxxxxxxxxxxxxxxxx ","data":{"dept":"MFU-Test","type":1}}

```

It should be this:

```json
{"dept":"MFU-Test","type":1}

```

Let me know if that fixes it.

-Tommy

---

<div class="post-metadata">

**Author:** ![marc.furrer](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/marc.furrer/32/5217_2.png) [@marc.furrer](https://devforum.zoom.us/u/marc.furrer)\
**Post date:** [April 8, 2020, 10:01am UTC](https://devforum.zoom.us/t/using-api-jwt-to-change-user-get-a-204-success-but-change-is-not-done/11589/6 "2020-04-08T10:01:43Z")

</div>

your right, issue with the library. did a manual patch. works thanks. 👍

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [April 8, 2020, 7:34pm UTC](https://devforum.zoom.us/t/using-api-jwt-to-change-user-get-a-204-success-but-change-is-not-done/11589/7 "2020-04-08T19:34:45Z")

</div>

Happy to hear you got it working! 🙂

-Tommy

---

<div class="post-metadata">

**Author:** ![DeveloperBot](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/developerbot/32/12632_2.png) [@DeveloperBot](https://devforum.zoom.us/u/DeveloperBot)\
**Post date:** [August 21, 2020, 8:21pm UTC](https://devforum.zoom.us/t/using-api-jwt-to-change-user-get-a-204-success-but-change-is-not-done/11589/8 "2020-08-21T20:21:39Z")

</div>

Closed on August 21, 2020, 8:21pm UTC


