Skip to content
Aziz edited this page Feb 5, 2019 · 6 revisions

API Base

The back-end is built as a REST-api service. UI is using the API so everything you can do in UI - you can do in API. And even more.

CRUD Model

Any entity in API could be: C - Created (POST): /api/{PROJECT_ID}/{ENTITIY_TYPE} + BODY_WITH_ENTITY_WITHOUT_ID R - Read (GET): /api/{PROJECT_ID}/{ENTITIY_TYPE}/{ENTITY_ID} or R - Read (GET): /api/{PROJECT_ID}/{ENTITIY_TYPE}?filters.... U - Updated (PUT): /api/{PROJECT_ID}/{ENTITIY_TYPE} + BODY_WITH_ENTITY_WITH_ID D - Deleted (DELETE): /api/{PROJECT_ID}/{ENTITIY_TYPE}/{ENTITY_ID}

Count (GET): /api/{PROJECT_ID}/{ENTITIY_TYPE}/count?filters....

Deletion

Entities are never being deleted. On Deletion they are just being marked as deleted. This helps to restore accidentally removed entities.

Filtering and Counting

When getting entities lists and counting them - filters may apply. Filters are just query parameters that reflect entity fields.

E.g., an entity has fields: name, owner, version. It is possible to find all entities of version "1" and owner "user" performing following GET request:

/api/{PROJECT_ID}/{ENTITIY_TYPE}?version=1&owner=user

When multiple parameters of the same key are provided it will turn into an "OR" expression for the corresponding field.

E.g. - now we want to get all entities of versions "1" OR "2" and owner "user"

/api/{PROJECT_ID}/{ENTITIY_TYPE}?version=1&version=2&owner=user

Clone this wiki locally