Get userId for Zoom Chat Message API

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?

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

Let me know if this helps!

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).
I have ensured that the required scopes are added in the Oauth scopes.

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?

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

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.


Thank you!

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

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!

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

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

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?

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

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.