How Can We Help?
Sorting the results (response body) in ascending and descending.Sorting the results (response body) in ascending and descending.
What
This article explains how to sort your results (response body) in the API in both ascending and descending order
Security
Nothing risks when sorting the contents. However, be aware always in the API key settings that can expose sensitive information
How
For example, in this endpoint: /research-outputs/orderings
-
There is "modified", as one of the available orderings.
To sort the response body by descending: - precede a hyphen "-" in the desired property name. For example, "-modified"
https://PUREADMIN_URL/ws/api/research-outputs?size=10&order=-modified
- Without a hyphen "-", by default, it will sort in ascending order.
- if there is no order in your parameter (as default). IDs is the default order in the response body. (e.g. UUID or PureID).
In another words: By indicating a minus sign or hyphen ("-"), you can sort your results in descending order (for example, by "modified" or "modified date"), which will display the most recent dates first, or from newest to oldest."
Updated at January 15, 2025