Generated database table APIs

Neptune DXP supports the automatic generation of fully functional APIs from table definitions created in your Neptune DXP database, reflecting the table’s key structural elements as API elements:

database tables

For example, let’s consider a country table with the following characteristics and its corresponding API elements:

  • The table name is used as the endpoint name, for example, a Countries table results in a /countries endpoint

  • The table fields are packaged into a definition model reflecting the name of the table, for example, a Countries table results in a {countries} JSON data model assigned to all operations

    An error model is automatically generating to hold error data for error API responses
  • Database table CRUD data operations are matched with the following API Methods:

    1. INSERT database operations are modelled as POST REST API methods

    2. SELECT database operations are modelled as GET REST API methods

    3. UPDATE database operations are modelled as PUT REST API methods

    4. DELETE database operations are modelled as DELETE REST API methods

The use of tables can be useful to rapidly create Neptune DXP microservices or endpoints associated with a specific table in the database. Rather than implementing server scripts to handle a request to CRUD data, Neptune DXP automatically generates the API operations for you without any code as well as handling the synchronisation between API requests and the database.