Fetch all the chats at once

Hi Team,

I have a requirement in which i need to extract all the conversation of mattermost per channel for all the teams.Please note we have multiple channels in multiple teams.

I was using https://your-mattermost-url.com/api/v3/teams/{team_id}/channels/{channel_id}/posts/page/{offset}/{limit}

My question is what is the suitable value which i should use for offset and limit to fetch all the conversation.
I also tried giving a large number to “limit”(e.g.1500) as parameter but it throw IOException.

Is there anything in the API which will give total number of posts in a channel or total number of pages in the channel?

How should i fetch all the posts ?

Any suggestions are much appreciated !!

Hey @Geetika_Dwivedi,

and sorry for the delay in replying.

To clarify, are you looking to extract all conversations across your channels? Or the number of posts per channel?

There are a few APIv4 endpoints that could be useful,