What I want is to get the IM Chat messages (with specific UserId) not the meeting messages.
I wonder if there is any Zoom API that can be used based on my description.
You’re correct in that you’ll need either a to_contact or to_channel parameter to get a user’s chat messages.
But to clarify, we don’t have an endpoint specifically for querying a user’s chat message-specific contacts (to_contacts)—you will need to know who it is (contact) or which channel (to_channel) that you’re looking for (messages between the user or the contact/channel) when you query the List User’s Chat Messages endpoint.
While you could query potential contacts first, using the endpoint you’ve referenced (List Users Contacts), there is still an element of needing to know who or what they’ve been in contact with for context.
I hope this helps to clarify, but let me know if you still have questions.
The List Users Contact API will get the contacts of the owner of the access token, or in other words, whoever installed your app. Just use their access_token, no need to pass in the userID.
So once the user installs your app, use their access token to call the List Users Contact API.