Hi,
I'm trying to download a list of all IGSNs for a user code (https://app-sandbox.geosamples.org/samples/user_code/UKB?page_no=0). However, I have more than 50000 samples. When I increase the page number until there is no data (e.g. https://app-sandbox.geosamples.org/samples/user_code/UKB?page_no=99999), the server returns a 404 HTTP error. I believe this is incorrect, since the resource (i.e. the collection of IGSNs) has been sucessfully found, but due to the filtering criteria, is an empty set. The server should instead return HTTP response code 200 and an empty list.
StackOverflow discussion about this: https://stackoverflow.com/questions/13366730/proper-rest-response-for-empty-table
Practically, my problem is that I cannot reliably know when I have reached the end of the result set pages vs there is an error with the server. So, my suggested fixes are either:
- Change it so that a successful query with an empty resultset returns HTTP response code 200
- Add an endpoint to return the total number of samples by usercode (e.g.
/v1/igsns/total/usercode?usercode=UKB) so I can figure out how many pages with data to expect
Hi,
I'm trying to download a list of all IGSNs for a user code (
https://app-sandbox.geosamples.org/samples/user_code/UKB?page_no=0). However, I have more than 50000 samples. When I increase the page number until there is no data (e.g.https://app-sandbox.geosamples.org/samples/user_code/UKB?page_no=99999), the server returns a 404 HTTP error. I believe this is incorrect, since the resource (i.e. the collection of IGSNs) has been sucessfully found, but due to the filtering criteria, is an empty set. The server should instead return HTTP response code 200 and an empty list.StackOverflow discussion about this: https://stackoverflow.com/questions/13366730/proper-rest-response-for-empty-table
Practically, my problem is that I cannot reliably know when I have reached the end of the result set pages vs there is an error with the server. So, my suggested fixes are either:
/v1/igsns/total/usercode?usercode=UKB) so I can figure out how many pages with data to expect