@Path(value="/receiver/")
public class WebhookReceiver
extends java.lang.Object
/receiver path of this application, the methods of
this class will process the call.
This sample application only has one method,
listener(String), to handle POST calls for this
servlet. This class can be extended with more methods to handle other
scenarios.
Note that the sample application primarily attempts to demonstrate how to do certain actions. Some of the example logic is not necessarily realistic and might not be used in an actual Webhook Receiver application. In developing a real life Webhook Receiver application, feel free to remove logic that is not required.
| Constructor and Description |
|---|
WebhookReceiver() |
| Modifier and Type | Method and Description |
|---|---|
javax.ws.rs.core.Response |
listener(java.lang.String eventJson)
This is the entry point for the Webhook Receiver to receive events from
Content Platform Engine.
|
@POST @Consumes(value="application/json") public javax.ws.rs.core.Response listener(java.lang.String eventJson)
CreationEvent:
UpdateEvent instead of CreationEvent.
CreationEvent, keep track of
the object for later deletion when the Webhook Receiver sample
application shuts down.
WebhookDollarAmount, WebhookPriority, and
WebhookRiskFactor). These properties are defined on the class
definition of the subscribed custom class WebhookClaim.
WebhookRiskFactor value has not been set, update the
source object to set the property to and arbitrary value (15).
Make sure not to update the object if WebhookRiskFactor value has
already been set, or we will get stuck in an infinite loop, as each
update will trigger another event.
Note that some of the logic below might not be realistic or desirable in a real Webhook Receiver application. Some of the logic is included only for demonstration purposes as an example and can be removed if it does not make sense for an actual use case.
eventJson - JSON payload from the Content Event Webhook External Event
Action call