listFiles() does not have a sort parameter?

Below Uploadcare’s PHP API library function does not have an asc or desc parameter. How can I sort the result so newest items are shown first?

function listFiles(int $limit = 100, string $orderBy = 'datetime_uploaded', $from = null, array $addFields = [], ?bool $stored = null, bool $removed = false)

Hi @Picto, you can specify the way files are sorted in a returned list via the datetime_uploaded parameter. Use datetime_uploaded for ascending order and -datetime_uploaded for descending order.

See the REST API reference for more information about listing files:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.