Versions Compared

Key

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

...

In this tutorial, we'll create a Spring Boot Service using Java, meaning the requirements for the project are derived from Spring Boot. Thus, a JDK version 1.8 or later and Maven 3.2 or later are required. 

...

Setting up the Consumer Service

To implement processing of incoming update metadata using our webhook service, we need to configure an endpoint within a controller class of our Example Webhook Service, in this instance ExampleRestController. 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 system hook configuration of our yuuvis® Momentum Systemsystem. We 'll will also define a stub method for working with the incoming metadata, which we 'll will call from within our endpoint method, the Object Map object map provided by the System Hooksystem hook

Code Block
titleController Class with Endpoint for Webhook Consumption
@RestController
@RequestMapping("/api/dms/request")
public class ExampleRestController
{
    @PostMapping(value = "/update/metadata", produces = {"application/json"})
    public Map<String, Object> updateDmsObjectMetadata(@RequestBody Map<String, Object> dmsApiObjectList, 
                                                       @RequestHeader(value = "Authorization", required = true) String authorization)
    {
        doSomething(dmsApiObjectList, authorization);
        return dmsApiObjectList;
    }
    private void doSomething(Map<String, Object> dmsApiObjectList, String authorization)
    {
        // do something with the metadata
    }
}

...