REST API: GET /nodes with sort returns photos in random/wrong order
Greetings, We have recently implemented support for pulling images from our customers' cloud drives on a site we work on. At the moment we are pulling a flat list of images and trying to sort them, newest to oldest. Currently we are using the following query: /nodes?filters=kind:FILE AND contentProperties.contentType:image*&sort:[\"createdDate DESC\"] * you can go here and click "Amazon cloud drive": https://staging.pictli.com/orders/new?#/products/98 The order of the results changes every time. We've also tried: /nodes?filters=kind:FILE AND contentProperties.contentType:image*&sort:[\"contentDate DESC\"]" and: /nodes?filters=kind:FILE AND contentProperties.contentType:image*&sort:[\"name DESC\"]" And in all cases we don't get images back in the order that matches what we see in the cloud drive web interface. Is it possible with a single query to get newest images first? If not, why, and, can what do we need to do instead? Best, Andrew Roper
Hi Andrew, We are confident that this is not related to any current known issues, and at this stage we need more data to investigate. Can you please provide some more data about your observations? You state that it happens every time. You've already provided the requests you're trying. Can you provide the metadata of a few files that are not staying consistent? Thanks!
Thanks! The key was `sort=` as opposed to `sort:` The docs weren't super clear on this point -- would be great to see an example in there with a full URL that includes a `sort` component. Cheers. -Andrew