Sorting the data returned when using a view
Sorting and views in API.
The API for any area which has views, allows the passing of a sort/direction of sort parameter, which will override the view's sort/direction of sort.
&dir= can be "ASC" (ascending) or "DESC" (descending)
&sort= (see below for options for the various tables)
e.g.
http://<SERVER>/jsonapi/activities.json?company=1&version=3.9&user=user&password=user&style=modeldata&modelstructure=activitylist&view=-1700&dir=DESC&sort=DATECREATED
Sort options for each area:
Activity
CONTACT
CLIENT
HANDLER (owner)
COMPLETED
DATECOMPLETE
CREATEDBY
DATECREATED
DATEDUE
JOBPHASE
DATEMODIFIED
DESCRIPTIONHEADER
STATUS
TYPE
PRIORITY
THEIRREF
UNIQUE
Attachments
UNIQUE
DESCRIPTION
TYPE
DATECREATED
CREATEDBY
Clients
CLIENT
HANDLER
UNIQUE
TELEPHONE
TYPE
Client Contacts
MOBILE
EMAIL
NAME
ROLE
Expense Sheet
SUPPLIER
STATUS
DATEIN
Job
CLIENT
HANDLER
COMPLETED
DATEDUE
DESCRIPTION
JOBPHASE
STATUS
THERM+String($nThermo)
Phase
CLIENT
HANDLER
COMPLETED
DATEDUE
DESCRIPTION
JOBPHASE
STATUS
THERM+String($nThermo)
Purchase Order
UNIQUE
HANDLER
DESCRIPTION
SUPPLYTYPE
JOBPHASE
THEIRREF
COST ACTUAL
COST ESTIMATE
COMPLETED
REQUIRED
FINALINV
CREATED
SENT
Suppliers
SUPPLIER
UNIQUE
TELEPHONE
SUPPLYTYPE
MARKUP
UNIQUE
NAME
Job Type
ID
DESCRIPTION
Activity Types
TYPE
Projects
CLIENT
NAME
Stages
CLIENT
DESCRIPTION
Purchase Invoices (not yet supported in API)
UNIQUE
THEIRREF
VALUE
VAT
GROSS
UNALLOCATED
APPROVED
TYPE
DATEFINALINV
DATEDUE