/data-sources API - Limits results to 100 items
-
When running the /data-sources GET via the API the total reports the actual number of data sources we have, but the items array is limited to 100 data sources.
Is there a "limit" parameter or paging option that I'm missing?
How can I get all of the data sources returned to me via the API?
Thanks,
Chad -
Yes, limit is set to 100 by default. Same goes for datapoints. Try limit=-1 as a parameter. I believe will tell it to pull all.
Use swagger to test your api calls.
Fox
-
Thanks once again, Fox, for the help!
It took us a little bit to figure out the syntax, but got it working: /rest/v2/data-sources?limit(1000)
We tried to use -1, but that created a 500 error.
Could not write JSON: PreparedStatementCallback; bad SQL grammar [select `ds`.`id`, `ds`.`xid`, `ds`.`name`, `ds`.`dataSourceType`, `ds`.`data`, `ds`.`editPermission` from dataSources AS ds limit ?]
Not a big deal for our purposes though.
-
Bizarre, help docs used to mention using -1 as no limit. Glad you have got it sorted!
Fox