# Get userId for Zoom Chat Message API

**URL:** <https://devforum.zoom.us/t/get-userid-for-zoom-chat-message-api/97973>\
**Category:** API and Webhooks\
**Created:** [November 6, 2023, 10:00pm UTC](https://devforum.zoom.us/t/get-userid-for-zoom-chat-message-api/97973 "2023-11-06T22:00:59Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![bi.integration](https://avatars.discourse-cdn.com/v4/letter/b/da6949/32.png) [@bi.integration](https://devforum.zoom.us/u/bi.integration)\
**Post date:** [November 6, 2023, 10:01pm UTC](https://devforum.zoom.us/t/get-userid-for-zoom-chat-message-api/97973/1 "2023-11-06T22:01:00Z")

</div>

Hello,

As we were reading through the API GET: /chat/users/{userId}/messages documentation we noticed this endpoint requires userId. Where would we go to get userId for the Zoom Chat Messages API?

---

<div class="post-metadata">

**Author:** ![elisa.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/elisa.zoom/32/47836_2.png) [@elisa.zoom](https://devforum.zoom.us/u/elisa.zoom)\
**Post date:** [November 7, 2023, 8:38pm UTC](https://devforum.zoom.us/t/get-userid-for-zoom-chat-message-api/97973/2 "2023-11-07T20:38:18Z")

</div>

Hi @bi.integration  
Thanks for reaching out and welcome to our community, I am happy to help here!  
You should be able to pass the email associated with the user for userID or you could also call the Get users endpoint and use the userIds that you will get from that call

> **[Zoom Meeting API](https://developers.zoom.us/docs/api/rest/reference/zoom-api/methods/#operation/users)**
>
> API Reference for /docs/api/rest/reference/zoom-api/methods

Let me know if this helps!

---

<div class="post-metadata">

**Author:** ![bi.integration](https://avatars.discourse-cdn.com/v4/letter/b/da6949/32.png) [@bi.integration](https://devforum.zoom.us/u/bi.integration)\
**Post date:** [November 8, 2023, 4:34pm UTC](https://devforum.zoom.us/t/get-userid-for-zoom-chat-message-api/97973/3 "2023-11-08T16:34:42Z")

</div>

Hi Elisa,  
While configuring the Oauth credentials to obtain the access token, there exists two options for grant type, 1) Authorization Code and 2) Client Credentials  
Which grant type should be used?

Upon trying with Authorization Code, I am encountering " You can not Authorize the Oauth app" error.  
and when trying with Client Credentials, I am able to acquire the access token but 400 error is encountered while hitting the users API ([https://api.zoom.us/v2/users](https://api.zoom.us/v2/users)).  
I have ensured that the required scopes are added in the Oauth scopes.

---

<div class="post-metadata">

**Author:** ![elisa.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/elisa.zoom/32/47836_2.png) [@elisa.zoom](https://devforum.zoom.us/u/elisa.zoom)\
**Post date:** [November 9, 2023, 8:14pm UTC](https://devforum.zoom.us/t/get-userid-for-zoom-chat-message-api/97973/4 "2023-11-09T20:14:06Z")

</div>

Hi @bi.integration  
I see, could you please share with me the scopes that you get back in your access token?  
I will try and replicate this behavior on my end.

Just to confirm, you are working with an OAuth app, right?

> **[Integrations (OAuth apps)](https://developers.zoom.us/docs/integrations/)**
>
> The Zoom Developer Platform is an open platform that allows third-party developers to build applications and integrations upon Zoom’s video-first unified communications platform.

If so, is this a User level one or an Account level app? This will help me troubleshoot the issue you are having.  
Cheers,  
Elisa

---

<div class="post-metadata">

**Author:** ![bi.integration](https://avatars.discourse-cdn.com/v4/letter/b/da6949/32.png) [@bi.integration](https://devforum.zoom.us/u/bi.integration)\
**Post date:** [November 10, 2023, 3:59pm UTC](https://devforum.zoom.us/t/get-userid-for-zoom-chat-message-api/97973/5 "2023-11-10T15:59:05Z")

</div>

Hi Elisa,

You are right. We are creating an OAuth app (Account level).  
I have attached the snapshot of the scopes that I have added while creating the OAuth app.

 ![image](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/2/3/232906ff7494b1d787bb4633e434e08ddaa88335.png)  
Thank you!

---

<div class="post-metadata">

**Author:** ![elisa.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/elisa.zoom/32/47836_2.png) [@elisa.zoom](https://devforum.zoom.us/u/elisa.zoom)\
**Post date:** [November 13, 2023, 8:58pm UTC](https://devforum.zoom.us/t/get-userid-for-zoom-chat-message-api/97973/6 "2023-11-13T20:58:10Z")

</div>

Thanks for confirming this, I will go ahead and do some testing on my end  
Cheers,  
Elisa

---

<div class="post-metadata">

**Author:** ![bi.integration](https://avatars.discourse-cdn.com/v4/letter/b/da6949/32.png) [@bi.integration](https://devforum.zoom.us/u/bi.integration)\
**Post date:** [November 14, 2023, 5:54pm UTC](https://devforum.zoom.us/t/get-userid-for-zoom-chat-message-api/97973/7 "2023-11-14T17:54:40Z")

</div>

Thank you, Elisa. Kindly let me know whether you can retrieve the user data and also inform me of any details I may have overlooked.

Thank you!

---

<div class="post-metadata">

**Author:** ![elisa.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/elisa.zoom/32/47836_2.png) [@elisa.zoom](https://devforum.zoom.us/u/elisa.zoom)\
**Post date:** [November 14, 2023, 9:05pm UTC](https://devforum.zoom.us/t/get-userid-for-zoom-chat-message-api/97973/8 "2023-11-14T21:05:58Z")

</div>

Hi @bi.integration  
I just tested this on my end and I am able to generate an access token (using an account level app) and use it to call the endpoint Get/users

Here is the curl command so you can take a look

```auto
curl --location --request GET 'https://api.zoom.us/v2/users' \
--header 'Authorization: Bearer {myaccesstoken}' \
--header 'Content-Type: application/json' \

```

---

<div class="post-metadata">

**Author:** ![bi.integration](https://avatars.discourse-cdn.com/v4/letter/b/da6949/32.png) [@bi.integration](https://devforum.zoom.us/u/bi.integration)\
**Post date:** [November 15, 2023, 3:03pm UTC](https://devforum.zoom.us/t/get-userid-for-zoom-chat-message-api/97973/9 "2023-11-15T15:03:34Z")

</div>

Hi Elisa,

Thank you for testing out from your end.  
I am still getting the 400 error when trying hit the users API. Attaching the snapshot for your reference.  
May I know which grant type have you used to get the access token? Is it Authorization Code or Client Credentials?

 ![image](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/7/b/7beb8e197de9772441f0eaf9e1871a14a42e6e66.png)

---

<div class="post-metadata">

**Author:** ![elisa.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/elisa.zoom/32/47836_2.png) [@elisa.zoom](https://devforum.zoom.us/u/elisa.zoom)\
**Post date:** [November 15, 2023, 3:17pm UTC](https://devforum.zoom.us/t/get-userid-for-zoom-chat-message-api/97973/10 "2023-11-15T15:17:10Z")

</div>

That looks just fine to me @bi.integration  
I will send you a private message for more details

---

<div class="post-metadata">

**Author:** ![bi.integration](https://avatars.discourse-cdn.com/v4/letter/b/da6949/32.png) [@bi.integration](https://devforum.zoom.us/u/bi.integration)\
**Post date:** [December 4, 2023, 3:51pm UTC](https://devforum.zoom.us/t/get-userid-for-zoom-chat-message-api/97973/11 "2023-12-04T15:51:46Z")

</div>

Hello Elisa,

I successfully retrieved the users’ data. Currently, my objective is to obtain the chat conversations between these users. Despite attempting to use the **/chat/users/{userId}/messages** API with specified date query parameters (set from 2018 to 2023), indicating my intention to fetch data from that year, I’m consistently receiving an empty payload for all users that I have tested.

I wanted to double-check with you to ensure that I am utilizing the correct API and providing the accurate query parameters. I’ve attached a snapshot of the Postman API call for your reference.

 ![image](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/2/c/2cd21bd214448d9eb8fd9e240fa4ae5cc4768dec.png)

---

<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:** [December 7, 2024, 7:28am UTC](https://devforum.zoom.us/t/get-userid-for-zoom-chat-message-api/97973/12 "2024-12-07T07:28:27Z")

</div>

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