Get User chat message API

Hi,
I’m using the following API to get user’s chat messages since last 5 mins.
https://developers.zoom.us/docs/api/rest/reference/chat/methods/#operation/getChatMessages

It has query parameters ‘from’ and ‘to’. I gave the value of current time to ‘to’ paramter and current time minus 5 minutes to ‘from’ parameter. But it still returns messages of the entire current day . Is it possible to do so using this API, since the ‘date’ parameter in this API does the same thing.

Here is the over view of my Javascript code"

 let from = new Date();
  from.setMinutes(from.getMinutes() - 5);
  from = from.toISOString();
  const now = new Date().toISOString();

const response = await axios.get(`https://api.zoom.us/v2/chat/users/me/messages?to_channel=abcd123456&from=${from}&to=${now}&page_size=50&include_deleted_and_edited_message=true`, { headers });

Hi @salna.butt17
Thanks for reaching out to us.
Allow me some time to do some testing on my end and will get back to you with an update.
Cheers,
Elisa

Hi @salna.butt17
I am able to query messages from a certain period of time using the from and to parameters,
make sure to include the date in yyyy-MM-dd'T'HH:mm:ss'Z' format.