Yet the result is always the same 3 pages of documents, and it goes until I receive an error about: “Message”: “Maximum simultaneous scrolls rate exceeded (10)”
I tried both, pass the same X-VTEX-MD-TOKEN at each 10 calls and the new ones that the api returns at each iteration, but the result was the same “Maximum simultaneous scrolls rate exceeded (10)”
Well, my goal is to scroll all the documents, so that I’m doing the following actions:
1° I’m calling the /scroll without the X-VTEX-MD-TOKEN
So I undestand that the result is the first page of documents
Then
2° My implementation looks for the token in the response headers and prepare the next call passing the token, and it continous until the 10th request, which ends with Maximum simultaneous scrolls rate exceeded (10)
So, I also tried to keep the same token across all requests, and I got the same result
What I’m doing wrong ?
Why this operation is counting as 10 operations simultaneously and not as a single one?
Why over the 10 requests I just see the same pages of results ? Is there something else that I need to send to the api, into the headers or path ?
Ok, I tried calling apis 10 times in the following intervals of 1, 3, 5 minutes. And I had the same result, passing the same token or rolling the new one but, the same result
To scroll all documents, you should pass the X-VTEX-MD-TOKEN header value as the _token query parameter in subsequent requests to retrieve the next page.
Example initial request: GET/api/dataentities/{data_entity}/scroll?_size={page_size}
Subsequent requests to retrieve additional pages: GET/api/dataentities/{data_entity}/scroll?_token={X-VTEX-MD-TOKEN}
The REST-Content-Total response header informs the total number of documents that match your query, allowing you to calculate the number of pages available based on the _size parameter.
As for date filters, the format you are trying should work, or you can try a date range like this example: /dataentities/CL/search?_where=createdIn between 2001-01-01 AND 2016-01-01