Reeleezee GitHub page

Flexible Data Retrieval

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:

 

Expand System Query Option – $expand

When a request URI is specified with $expand System query option, it expands the single property mentioned along with the option.

Example:

Request to expand the Address property: /api/v1/customers?$expand=Language

Similarly, a request URI specified with $expand=* System query option, expands all the properties.

Example:

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:

$expand=*($levels=2) – Expand all properties for 2 levels

$expand=*($levels=max) – Expand all properties for all levels

$expand=*/$ref – Expand all properties, but only return the id’s

$expand=*/$ref($levels=max) – Expand all references

 

Select System Query Option ($select)

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.

Example:

Request a list of products only showing the properties Description and Purchaseprice: /api/v1/products?$select=Description,PurchasePrice

 

Expand System Query Option $expand and $select together:

A request URI can be created with multiple system query options to fetch specific data with specific level/property expansion.

Example:

Combining expand and select: /api/v1/customers?$expand=Entity($select=id,AdditionalName;$expand=Language/$ref,AddressList($select=Type))