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

Muliple sort

You can sort on multiple fields like that:

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

Descendant sort

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

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

Muliple sort + Descendant sort

Of course, you can combine both like that:

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