-
Notifications
You must be signed in to change notification settings - Fork 31
API
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.
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....
Entities are never being deleted. On Deletion they are just being marked as deleted. This helps to restore accidentally removed entities.
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 _