Getting partial message when using 'List user's chat messages'

API method: List user’s chat messages
Endpoint: /chat/users/{userId}/messages
Documentation: Zoom Team Chat API

Hello,

I had a question about expected behavior for the ‘list users chat messages’ method linked above. When using the search key parameter for messages, I have been able to connect and retrieve the desired message. However, it appears to be truncated to a limited number of characters on either side of the search key. I don’t see anything in the documentation that suggests this behavior.

I know that I could get the full message by taking the message id obtained from the response and passing that to the ‘get a message’ endpoint (/chat/users/{userId}/messages/{messageId}), However I know it’s best practice to limit API calls whenever possible so I wanted to check if there was a way to retrieve the entire message in the ‘List user’s chat messages’ call, or if I’m just doing something wrong.

HEADERS-{“Authorization”: “Bearer {access_token}”

QUERY-STRING PARAMETERS- {
“to_channel”: channel_id,
“search_type”: “message”,
“search_key”: ‘string_to_search_for’,
“from”: last_week_date
}

App type: Oath

Hey @joshua.allen welcome and thanks for posting!

To specify, you’re saying the text of the message in the response is truncated, as in - the response only includes a partial message (or a list of partial messages)?

@ojus.zoom do we know if this is expected behavior?

I can imagine this being expected behavior to limit the size of the response. But we can check on this and improve the API reference if that’s the case. Agreed, Josh, we don’t want you to have to make unnecessary API requests. We’ll look into it.

1 Like

Hey Michael, Thank you for responding.

Yes, the content of the message under response[“messages”][0][“message”] is truncated. I’ve double checked to make sure the message isn’t split up in a list and have confirmed that this is not the case.

Giving an example, using the string ‘pdf’ as the search key, the message I want to retrieve is as follows,

‘florida department of emergency management, I think. As to what it actually is? I have no clue. I helped Aashish write a thing to strip the first page from dropped pdf’s. That’s the extent of my knowledge.’

and the string returned from the call is

‘…a thing to strip the first page from dropped pdf’s. That’s the extent of my knowledge.’

Additionally, if this is helpful, after doing some additional testing I found that the message returned seems to be what is displayed when searching messages in the app itself. That would make since since I assume these functions and linked somewhere in the back end. I can include a screenshot of this behavior if you would like.

Woof, sorry for the late reply @joshua.allen , I missed the response. Can you please provide that screenshot? We’re working with our chat engineering team on this. I don’t know if it’s expected yet, this might have been decided to reduce JSON size for the list message endpoint.

1 Like

No worries, I appreciate you getting back to me. and sure thing. That message is the same exact message returned in the API call. But not the full length of the message.

1 Like

@michael.zoom Just wanted to follow up and ask if you ever got a response from the chat engineering team on whether this was expected behavior or not.

Thank you.