Sample | Submit Adaptive form to rest endpoint

Avatar

Avatar

Mayank_Gandhi

Employee

Avatar

Mayank_Gandhi

Employee

Mayank_Gandhi
Employee

07-02-2021

Do you know you can submit adaptive form data and attachment to third party rest endpoint?

 

https://experienceleague.adobe.com/docs/experience-manager-64/forms/adaptive-forms-basic-authoring/c...

 

Here is a simple rest controller using Spring that you can use to test and merge with your java code:

 

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/employee")
public class EmployeeController {


@RequestMapping(method = RequestMethod.POST, consumes = { "multipart/form-data" }, value = "/getData")
@ResponseBody
public void myUser(@RequestPart("jcr:data") String data ) {
System.out.println(data);
}

@GetMapping(path = "/sample")
public String myUser2() {
return "sample get";


}

}