Get chat messages for a specific userId

If I have a Zoom userId, can I get all of the chat messages for this userId (including channel chat messages) ?
I notice Zoom API provides the following:

  1. GET /im/users/{userId}/chat/messages
  2. GET /chat/users/{userId}/messages

For option 2 API, it looks I must provide to_contact or to_channel as request parameter. Does it mean if I want all chat messages for this userId, I need to get all contacts (and channels) firstly and then iterate them all ?
For option 1 API, I wonder if I don’t provide chat_user and channel parameters, will it return all of the messages for this userId ?

Thanks a lot!

Hey @szhang

Thanks for posting on the Zoom Devforum! I am still learning, but I will try my best to help answer your question. :slightly_smiling_face:

Checkout these related threads that may have the answer you are looking for:

If these threads did not help, please let us know by replying back here and someone from the Developer Relations team will get back to you shortly.

Thanks,
DeveloperBot

It looks the recommended answers not apply to my case.

Thanks,

Hi @szhang,

Thanks for reaching out about this—First, I just wanted to clarify that the first endpoint you referenced (Retrieve IM Chat Messages) is being deprecated and will be removed from future versions, so I would not recommend utilizing this endpoint.

In regards to the 2nd endpoint (List User’s Chat Messages), I can confirm that you must provide either a to_contact OR a to_channel parameter. Without one of these, you will run into errors. To answer your question:

Does it mean if I want all chat messages for this userId, I need to get all contacts (and channels) firstly and then iterate them all ?

That’s correct, if you want to list all messages for a given user, you’ll either need to do so based on the to_contact or the to_channel.

I hope this helps to clarify—let me know if you have any additional questions!

Best,
Will

Thanks a lot for the clarification.

yes, I have seen Zoom API errors if I don’t provide to_contact and to_channel parameters on the 2nd endpoint which proves the API description. The same for the 1st endpoint.

Please refer to my recent post for similar questions on how to get contacts with UserIds.



I am not sure how I can get a UserId’s contacts (with to_contact parameter). It looks the endpoint can’t get contacts for each UserId.

Hi @szhang,

Thanks for clarifying! I’ll address this in this thread.

Best,
Will