2.7 KiB
API request format
AyaNova uses a RESTful API and supports the JSON data interchange format exclusively. No other data formats are supported, your code must supply and consume JSON formatted data.
All developer interaction with the AyaNova API is via the REST server interface only.
API documentation
Your primary source of information on how to make API requests is the API explorer console where every route is documented and can be tested manually before coding.
Date and time
All dates and times sent or retrieved from the REST interface must be in UTC / GMT time zone. It is the client's responsibility to display and accept dates in local format but interaction with the server is in UTC only.
Localization
Every User account in AyaNova has their own UserOptions object which contains their personal localization settings such as time zone offset, currency symbol and numeric formatting options you can use this value to correctly display and interpret values at a client level.
In addition every user has their own locale setting ID which can be used to fetch and display text in the correct locale by using the methods in the Locale routes.
Paging, sorting and filtering lists
Most list routes have a common method for paging sorting and filtering via query parameters provided to the route:
Offset
This parameter controls the paging offset and is expected to be an integer. If no value is specified the default is 0.
Limit
This parameter controls the number of items returned starting at the offset provided. The maximum allowed value is 1000, the default value is 25 if no value is specified.
Sort
This parameter controls the sort order of the data returned. It is expected to be a JSON array of objects that contain two fields a fld property that contains the string name of the field to be sorted by and a dir property that controls the direction of sorting and is one of two values "+" for Ascending or "-" for Descending. Multiple objects may be specified to sort by multiple columns in order from first to last specefied in the array.
For example the following Sort array will sort a list by Name first in ascending order and then by StartDate second in descending order:
[{fld:"name", dir:"+"},{fld:"startdate", dir:"-"}
To determine which field names are valid for a particular list you can make use of the /FilterOptions API route for that object which is available for any objects with sort and filterable lists.
If no sort parameter is provided the default is to sort by Id Descending so the most recently created objects appear first in the list.