Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

To implement processing of incoming metadata using our webhook service, we need to configure an endpoint within a controller class of our Webhook Service. In this instance ValidationWebhookRestController. The URL we define between the RequestMapping annotation of the controller class and the PostMapping annotation of the endpoint method will need to find its way into the system hook configuration of our yuuvis® Momentum system. We will also define a method for working with the incoming metadata, which we will call from within our endpoint method, the object map provided by the system hook.

Code Block
languagejava
titleController Class with Endpoint for Webhook Consumption
@RestController
@RequestMapping("/api/dms/request")
public class ValidationWebhookRestController
{
    @Autowired
    private PropertyValidationService propertyValidationService;

    @PostMapping(value = "/upsert", produces = {"application/json"})
    public Map<String, Object> validateObjectProperty (@RequestBody Map<String, Object> dmsApiObjectList,
                                                	   @RequestHeader(value = "Authorization", required = true) String authorization) throws HookException {
        this.propertyValidationService.validateObject(dmsApiObjectList, authorization);
        return dmsApiObjectList;
    }
}

...