$orderBy not returning ordered data

This is my first time using SuperOffice for API calls.


$select and $filter are working as intended. However, I need to sort the data based on the latest data available, but the query returns the data in ascending order, based on what would seem to be its primary key or index.

I've tried running $orderBy = 'ticketId desc', it order to get the latest ticketId for the query, but it returns the same data in the same order no matter what is inserted into the $orderBy argument.

What may be causing this issue?


RE: $orderBy not returning ordered data

Yes, I meant ticketId, which is also the query I ran :) The post has been updated!


I am already basing my queries on the documentation you have added.


I am also using $top=5 to get the top 5 results. When I remove the $top argument, then the data is sorted descending order no matter what the $orderBy argument is.


This is the url extension I am adding on the base url:

"$select={select}&$filter=customerName is '{customerName}'&$orderBy='ticketId desc'&$top=5&$format=JSON"
Av: Samuel Berntzen 25. aug 2020