How to get total message in a list channel with Platform API?

Hi everybody,
i needing to get total message of each channel to show it in dashboard CMS.
I was found api View total number of messages in a channel
but it seem to use for a specify channel.
Any suggestion, please?

Hello,

Welcome to Sendbird community!

  1. You can first retrieve the list of channels using,
  1. Then use the API to view total number of messages in each channel iteratively.