Webhooks
Webhooks
The webhook are the final step in a flow, implemented like a request HTTP to an endpoint, for sent or receive data.
Define an HTTP Method and params.
Webhooks are simple HTTP requests that contain JSON or XML formatted data relating to an event on Velosimo.

New Webhook

Every Webhook include some common fields along with the specific object data for the event, these fields are:
-
path:
It defines URL after the connection URL to do the request. Connection URL + Webhook URL, define the entire URL petition.
-
Parameters:
An array of Parameters needed to the petition. They will be part of the URL petition, usually they will be sent after: "?" character in the URL direction.
-
Headers:
An array of Headers needed to the petition.
-
Template parameters:
Values of variables to fill in the webhook path, parameters or headers defined in way. This value usually is fill via code.
Example of parameters, headers and template parameters definition
This is a webhook where there is defined a "order_id" parameter, and it will be filled by a template_parameter in some place of the integration.

How to Submit a Webhook
-
Via code:
request = Cenit.namespace('Accela').webhook('Get order').submit(template_parameters: { 'order_id' => order_id })
object = JSON.parse(request) # object has the result of the request.where:
- template_parameters: hash of template parameters defined in the webhook.
-
Submit action of webhooks:

After that, Velosimo will ask you about the connection, parameters, headers or template parameters that this request need.

And you can see the result of the request in notification list.
