Publish Review Components: Gateway > Webhooks

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.

Snag_9200433

New Webhook

Snag_9201599 Snag_9202131

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.

Snag_92037b7

How to Submit a Webhook

  1. 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.
  2. Submit action of webhooks:

    Snag_9204c39

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

    Snag_9205b7b

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

![Snag_9207210](https://user-images.githubusercontent.com/53061574/80642619-ff4dd200-8a23-11ea-82a9-4a99b8dbc74e.png)