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:
GET /im/users/{userId}/chat/messages
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 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!
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.