How to Register a Webhook
The adapter developer can implement the logic to register a webhook in the following ways:
-
Manual
Create a webhook subscription through the user interface of the administration page of the external application or service.
-
Programmatic
Execute an API call to the external application or service.
During this process of registering a webhook, the external application or service may enforce requirements such as:
-
Respond to a ping to the endpoint that the adapter stands up to receive the message.
The response may either be a simple acknowledgment or a more specific or custom response message.
-
Store security information
For example, validate a runtime message from the external application or service.
-
Initialize the external application with information that allows it to obtain authorization and authentication to send the message successfully to Oracle Integration.
The adapter developer can use the Rapid Adapter Builder platform to design and implement all these requirements.
Ping requests are the most common requirement of registration are ping
requests. To manually register the endpoint prior to ping acknowledgment, the
integration that processes the event must be activated. Additionally, the trigger
design must include a validationRequests
logic that returns the
acknowledgment from the ping request.
The following sample code shows how to apply a condition to understand
the source of the ping. In this scenario, the acknowledgment is created if the
request has a header that contains a key of x-custom-event
and a
value of ping
. The response is created with a HTTP status code of
204
. The response can be of any content that the event producer
requires.
"validationRequests": [
{
"condition": "${.request.headers.\"x-custom-event\"==\"ping\"}",
"response": {
"status": 204
}
}
],
Additionally, in some scenarios, the registration might include additional operations. In such scenarios, the adapter developer can reference a flow to execute the additional logic. The set of objects in the validationRequests
are executed to ensure that the message is valid. If the conditions are not fulfilled, the incoming message is not executed during runtime.