to get a personalized navigation.
to get a personalized navigation.
Hi
just a question: Is the paged response from the Inventory Get Endpoint ordered by LastModifiedDateTime? Due to the performance issues we have to handle the responses by page to avoid timeouts on our site. But we have to be sure, that the responses are ordered by LastModifiedDateTime otherwise we will miss some changes in doing it that way...
best regards,
Florian
Solved! Go to Solution.
Hello,
GET - Inventory sorted based on "inventoryId" field when the "LastModifiedDateTime" parameter is not used with the pagination. Clients should use the pagination in combination with a filter on "LastModifiedDateTime" (where is available). By doing this, you will only get documents which have changed since the last GET operation was executed.
Also, clients should avoid requiring the same data all the time, so the client should store the latest received "lastModifiedDatetime" in addition to the data has been fetched. In this way, this can be used as a cursor to restart/continue the query from.
( LastModifiedDatetime=YYYY-MM-DD & LastModifiedDatetimeCondition= >= )
Yes, we are aware of that, but do I understand you right: If we use the filter on LastModifiedDatetime we get the result (which can contain many pages) ordered by LastModifiedDateTime (ascending) or would it still be ordered by inventoryId?
(
The point is that we already try to filter by lastmodifiedDateTime. But we have still so many result-pages that we decided to process it page by page to avoid timeout-conflicts.
That means that we take only the first page from the result and finish the processing. We save the max LastModifiedDateTime from the first page. And than we run a new thread using this value as filter, process the first page again, save the max lastmodified and so on - until we don't get any more pages.
)
@Florian Haase wrote:
Yes, we are aware of that, but do I understand you right: If we use the filter on LastModifiedDatetime we get the result (which can contain many pages) ordered by LastModifiedDateTime (ascending) or would it still be ordered by inventoryId?
Yes, to be able to sort the data based on "LastModifiedDateTime" you should use LastModifiedDateTime & LastModifiedDatetimeCondition query parameters together with the pagination in the GET request.
Hi,
The result should be sorted ascending on lastModifieDateTime.
Thank you, thats great.
Copyright © 2022 Visma.com. All rights reserved.