Slack's files list API gives warning max_page_limit

Viewed 106

I am using below API and listing 200 files per page.

https://slack.com/api/files.list?count=200&page={{pageNumber}}

I have 60000 files in my slack account. So on first API call received 200 files with pagination response like below.

"paging": {
        "count": 200,
        "total": 60000,
        "page": 1,
        "pages": 300
    } 

We continue fetching files with increasing page number in API query parameter like 2,3,4,.......

https://slack.com/api/files.list?count=200&page=2

"paging": {
            "count": 200,
            "total": 60000,
            "page": 2,
            "pages": 300
        }

When we reached page number 101 the page parameter in paging response becomes 1 with warning max_page_limit. Can't we list all files with same pagination fashion? or Slack file list API allows us to list files till page 100 only? We didn't find anything in Slack documentation for this use case. Any help regarding this issue will be much appreciated.

https://slack.com/api/files.list?count=200&page=101

"paging": {
    "count": 200,
    "total": 60000,
    "page": 1,
    "pages": 300,
    "warnings": [
        "max_page_limit"
    ]
}
1 Answers

Here is what I got reply from slack forum.

There is indeed a page limit of 100 pages on files.list. I've contacted the documentation team to add this detail to the documentation for the method. You should be able to get your 60000 files with a highter count of 600 though.

There are other ways to filter down the expected number of results. For example, you could specify a time period for file creation date using the ts_from and ts_to arguments and do batches of calls within specified time periods, or batch your searches by channel by passing the channel argument. These techniques should always allow you to keep a batch within 100,000 files, as 1000 would be the max accepted limit.

Related