"Search Everything" API request always response with 'totalCount' limited to 100
Hello,
Is there a limit to the total number of search results to 100? For the example, the GET request to URL:
https://api.smartsheet.com/2.0/search/sheets/{sheetId}?query=stuff
always response with "totalCount": 100 even though I know there are more than that. Is there a way to increase the search results beyond 100?
Thanks
Best Answer
-
Hi @ksngdavid,
Wel,l that wasn't easy to find. I had it stored on an old PC and have forgotten all the credentials to get in.
Anyway, I have had a look and I was wrong, the C# app I created did return all results. The code was from not long after I started coding so excuse it being untidy and not very well commented, but I have attached the code as a txt file.
I have replaced the Smartheet Token and Sheet ID for obvious reasons.
I hope this helps!
John
Answers
-
Hi @ksngdavid,
I believe that yes the first response only retrieves 100 results, but that you can page through the results. I used to use a C# app that retrieved over 3000 rows and put the results into a SQL database. I can try and dig out the code if that helps, but I would not be able to do this for a few days as I will need to search for the SSD it is on.
John
-
Hi @John_Foster
Thank you for your reply. Appreciate very much if you can locate your earlier code. That will definitely help.
David
-
Hi @ksngdavid,
Wel,l that wasn't easy to find. I had it stored on an old PC and have forgotten all the credentials to get in.
Anyway, I have had a look and I was wrong, the C# app I created did return all results. The code was from not long after I started coding so excuse it being untidy and not very well commented, but I have attached the code as a txt file.
I have replaced the Smartheet Token and Sheet ID for obvious reasons.
I hope this helps!
John
-
Thanks @John_Foster !
-
More generally, you use "Paging" to get the number of results you want. Here is the API documentation:
https://smartsheet.redoc.ly/#section/Work-at-Scale/Paging
You will typically either set:
- includeALL=true to get all of the records
- or to get a specific number of records pageSize=250 and page=4 to get a specific number of records for a give "page"
Search the API documentation for examples for your specific language's SDK and method
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 64.2K Get Help
- 419 Global Discussions
- 221 Industry Talk
- 461 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 142 Just for fun
- 58 Community Job Board
- 462 Show & Tell
- 32 Member Spotlight
- 1 SmartStories
- 299 Events
- 38 Webinars
- 7.3K Forum Archives