Skip to main content

API

This section will cover the basics of the API.

The API uses a basic CRUD model to manage the company's data.

Used API methods and functionalities:​

GET:​

Single Entity:​
Params:​
  • id: The ID of the entity to retrieve.
Response:​
  • 200: The entity with the given ID.
  • 404: The entity with the given ID was not found.
Entities List:​
Params:​
  • pageNo: The page number to retrieve.
  • pageSize: The number of entities to retrieve.
Response:​
  • 200: {items: [...entitiesList], itemsCount: the total count of entities found in the database without pagination}
  • 404: {items: [], itemsCount: 0}

POST:​

body:​

The information to create a new entity.

Response:​

The result will be the entity that was created.

PUT:​

params:​
  • id: The ID of the entity to update.
body:​

The information to update an existing entity.

NOTE: Send to the server only the fields you want to update.

Response:​

The result will be the fields that were modified.

DELETE:​

Params:​
  • id: The ID of the entity to delete.
Response:​

The result will be the entity that was deleted.

Mechanism: The server will update the deleted field of the entity to the current date and will not trully delete the entity from the database.