Sorting

You can sort results with querystring parameter named “sort”

Note

Examples are not urlencoded for a better readability

Example:

GET /persons?sort=name HTTP/1.1
Accept: application/vnd.api+json

Multiple sort

You can sort on multiple fields like that:

GET /persons?sort=name,birth_date HTTP/1.1
Accept: application/vnd.api+json

Descending sort

You can make desc sort with the character “-” like that:

GET /persons?sort=-name HTTP/1.1
Accept: application/vnd.api+json

Multiple sort + Descending sort

Of course, you can combine both like that:

GET /persons?sort=-name,birth_date HTTP/1.1
Accept: application/vnd.api+json