We're Hiring!

Mattermost, Inc.

How do I get only the messages of the date I want from the channel?

How do I get only the messages of the date I want from the channel?

“…/api/v4/channels/channelId/posts?page=0&per_page=100”

I know that this will bring you up to 100 of the latest data. looking at the api documentation, it seems that i can use the parameter ‘since’ to get the date i want.

However, I want to fetch only one day of the desired date, but I don’t know what to do even if I browse the api documentation.

Any help would be greatly appreciated.

Could this thread help Getting posts for a channel on a specific date?

1 Like

Thank you for answer.

After reading the article and replacing it with the unix timestamp value, I made a request. However, it seems that the entire value is imported instead of just the value for the entered date. I am curious to use the correct since parameter.

Hello, @Karmantez

Would you mind sharing the API call you used (remove any sensitive information such as FQDN and personal token)? The reason why I am asking is because we have a known bug with the usage of since parameter with the page and per_page parameter here which could be related:

1 Like

of course.

The api call I used is below.
https://servername.com/api/v4/channels/channel_Id/posts?page=0&per_page=100&since=Unix_Timestamp

Messages that existed after the unix timestamp were expected to be returned. However, much earlier data (ex: timestamp was May 10, 2020, but all data was imported on May 1) was returned.

And I set per page to 100, but I got a thousand data returned.

Hi, @Karmantez

Yeap, that sounds like the same bug reported. Please add yourself as a watcher to the bug report to keep yourself notified for updates from the team. Feel free to add any additional information to the ticket too.

1 Like

Thank you for answer

I hope it will be fixed as soon as possible.

1 Like

Hi, @Karmantez .

Got the confirmation from @agnivade that it is working as designed.

The since param is mutually exclusive with page and per_page. We could add pagination for since but I am guessing the app doesn’t require it, so we haven’t added it. Adding that would be a separate feature request.

If you have any questions about this, please feel free to let me know. Thanks.

1 Like

Thank you ahmaddanial!

It’s good news that the bug has been fixed.

Thank you very much for the answer. Try it as soon as possible and I will tell you if there are any problems.

Thank you.