In the construction of the Reeleezee API, we followed the OData v4 specifications. Open Data Protocol (OData) is a RESTful data access protocol initially defined by Microsoft. The protocol enables the creation and consumption of REST API’s which allow resources, identified using URL’s and defined in a data model, to be published and edited by Web clients using simple HTTP messages. It is not limited to relational databases.
Following are the supported system query options in Reeleezee API to get started:
By default, when data is requested with a standard URI and without system query option specified, it only returns data of the first level. However, you can control which properties to fetch using the Select system query option and which levels are returned by using the Expand system query option. The following examples can be useful to satisfy various needs:
When a request URI is specified with $expand System query option, it expands the single property mentioned along with the option.
Request to expand the Address property: /api/v1/customers?$expand=Language
Request to expand all properties with: /api/v1/salesinvoices?$expand=*
Furthermore, there are a lot of other ways you can use depending on your requirements. Below are certain ways are specified for you to explore and experiment with:
To select a specific set of properties, use the $select system query option along with mentioning the properties to be retrieved in the request URI.
Request a list of products only showing the properties Description and Purchaseprice: /api/v1/products?$select=Description,PurchasePrice
A request URI can be created with multiple system query options to fetch specific data with specific level/property expansion.
Combining expand and select: /api/v1/customers?$expand=Entity($select=id,AdditionalName;$expand=Language/$ref,AddressList($select=Type))