Differentiate Save and Submit in Rest API

Differentiate Save and Submit in Rest API

Question on form data saving to MongoDB using Rest API. I have three different scenario.

Question on form data saving to MongoDB using Rest API. I have three different scenario.

  1. Save and return (First time saving data partially and return id for future return).
  2. Submit the already saved data (Second time, complete the form and do final submit, so that i can trigger other work flow.)
  3. Submit directly (Submit the full form first time and return the id, and start work flow)

For above scenario, i came up with below API resource

POST --> v1/applications   (This will save data and return id)
PUT --> v1/applications/{id} (This will retrieve data using id parameter and update that data)

My confusion is how to differentiate both the API, whether it is only save or final submit call, because i have to start work flow after final submission. Can i use some query parameter like below to indicate submit or save?

POST --> v1/applications?submit=true or false   (This will save data and return id)
PUT --> v1/applications/{id}?submit=true or false (This will retrieve data using id parameter and update that data)

Or do we have any better approach to differentiate save and submit within this api?

Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

Creating a REST Web Service With Java and Spring

In this article, you'll learn how to create a REST Web Service With Java and Spring

Spring Data REST Tutorial: Developing RESTful APIs with Ease

In this article, you will learn how to develop REST APIs with ease by using Spring Data REST and Spring Boot together. Throughout the article, you will scaffold a new Spring Boot application, create a JPA entity, and use Spring Data REST to provide some basic operations over it. Besides that, you will also learn how to validate the data your API is dealing with and how to secure the application.

Java Enterprise 101: Building a REST Server with Spring Boot

Java Enterprise 101: Building a REST Server with Spring Boot