<aside> ☑️ The API functions used to access the Cires21 applications are implemented with REST philosophy. This means that the same URI can be used to retrieve the details of a resource or to change its properties. It will depend in the method used to call the API.
</aside>
The URI will determine the access to the entire collection of the resources or a particular resource in the collection identified by its id. The API only allows to get the collection of the resource, meanwhile it allows to get, add, modify or delete a particular resource.
The methods used in the API are GET, POST, PUT and DELETE. These are their actions:
The POST and PUT methods use the content body of the request to create and modify the addressed member as a JSON object. The GET, POST and PUT methods retrieves the same information in JSON plus the id of each element requested. Some resources, like Configuration, represent system objects and cannot be created or deleted.
All the functions return a defined JSON structure to specify the success of the operation and, if requested, information of the resource. This structure include a property success that define the result of the operation. If it is true, a data property will retrieve an information object (for resource members) or an array of information objects (for collections). If the success is false, a code and a message will be returned in the structure. In this case, also a data can be returned with detailed information of the problem.