/api/2.0/preview/sql/queries API only returning certain queries
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2024 08:40 AM
Hello,
When using /api/2.0/preview/sql/queries to list out all available queries, I noticed that certain queries were being shown while others were not. I did a small test on my home workspace, and it was able to recognize certain queries when I defined a function to take in a parent folder. The goal was to be able to see all queries within a specified "parent," but the API call only returned back under half of the query files I expected in the parent/subfolders under the parent. Is there a reason why some query files are shown while others are not? Please advise.
Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2024 04:08 PM
Hi,
How many queries were returned in the API call in question? The List Queries documentation describes this endpoint as supporting pagination with a default page size of 25, is that how many you saw returned?
Query parameters
page_size integer <= 1000
Default 25
Number of queries to return per page.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2024 07:02 AM
Hi @brockb,
The count of queries I got returned from this call was 732. What I tried to accomplish was being able to view all queries under a certain parent folder. See code below:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2024 07:58 AM
Hi @brockb,
You were correct. I was only grabbing the first page of results, so I updated my code to traverse each page to grab all queries and add each page's results into a list.
Thank you!