Closed kael closed 2 years ago
You need to encode your query parameters correctly. Compare this command without correct encoding:
curl 'https://api.hypothes.is/api/search?limit=1&sort=created&order=desc&search_after=2021-12-01T18:44:21.321350+00:00'
With this command which does use correct URI encoding:
curl 'https://api.hypothes.is/api/search?limit=1&sort=created&order=desc&search_after=2021-12-01T18%3A44%3A21.321350%2B00%3A00'
I encoded the search_after
parameter here using encodeURIComponent('2021-12-01T18:44:21.321350+00:00')
in Node, but use the standard URL generation APIs for your programming language.
I also recommend to specify the sort field and sort order explicitly when using search_after
.
You need to encode your query parameters correctly. Compare this command without correct encoding:
Indeed, it works with encodeURIComponent
.
Thanks for the tips ! And sorry for having opened this ticket.
P.S.: I changed the fetch
client on my side and forgot to set encodeURIComponent
back.
Describe the bug When
/search
'ing for annotations with the?search_after
search parameter, the server returns non contiguous annotations.But the bug seems to happen only on the first batch (unclear yet).
Fetching after the date of the last annotation returned from the previous search returns results starting with non contiguous annotations, like if several annotations were skipped.
(Please, see the linked gists for full annotations samples).
To Reproduce
Search for 1 annotation.
Search for 2 annotations.
{ "id": "hpN4_FLQEeywQ98rkS4JVw", "created": "2021-12-01T18:00:10.429872+00:00", }
Expected behavior Paging through annotations with the
?search_after
parameter should return contiguous annotations.