Skip to main content

Data Interface

With /data/namespace/api the data of the API api in the namespace namespace can be accessed. A simple CRUD approach is used:

  • POST creates a new record. This automatically receives a unique identifier (_id) assigned by the server and some metadata (current account as owner and current timestamp)
  • PUT changes a record, whereby the metadata is updated (current account as last editor and current timestamp) — only the fields that are to be changed need to be transmitted (substructures must always be transmitted completely)
  • DELETE deletes a record
  • GET reports one or all records

With a POST to /data/namespace/api/query an extended search can be performed, which controlled via the descriptions in the POST body supports filtering and sorting as well as pagination.

For PUT, DELETE, and GET for a single record, the id is specified directly in the access: /data/ns/api/id. PUT has a special feature however — one of the following conditions must hold for it to work:

  • The id is only specified in the URI and is absent from the record
  • The id is only specified in the record, the standard access /data/ns/api is used
  • If the id is specified both ways, these must be identical, otherwise an error is reported during access

In anticipation of the future transfer of file content from client to server, the content type multipart/form-data is supported. In multi-part mode (for POST and PUT) the payload is transmitted not in the HTML body but in a variable data, which is filled like the body in standard mode with the parameters serialised as a string (JSON.stringify). Even if there is currently no implementation for further evaluation: all other variables are then file contents.