Skip to main content

Webhooks setup intro

The CONVELA Cloud system can notify other systems about new events via webhooks, also called rest-hooks. In the following guide, we will show you how to start receiving rest-hooks and how useful rest-hooks can be.

What is a rest-hook and who receives it?#

TLDR

A rest-hook subscription is an intention of a user to receive data about different CONVELA Cloud events with a goal to process such data in external system or their own systems.

When an event occurs in the CONVELA Cloud system, it automatically finds users related to the event and checks if they are subscribed to it.

Let's say a consumer user placed an order for products from their agent. Now CONVELA Cloud internally emits the event bookings.created and finds users directly related to it. In this case, those are: the ordering consumer and the agent receiving the booking. Next, it checks if any of them asked to send information about new orders to a certain URL. It sends the relevant payload to all subscriptions found.

How do users subscribe to events?#

Users can subscribe to rest-hooks via direct API calls to the central endpoint, or OAuth 2 applications, that were authorized to use rest-hooks on someone's behalf, can manage these subscriptions. To start using rest-hooks using your integration, make sure you've completed the OAuth setup because you will need to pass an access token during rest-hook subscription. So if you haven't already, check the OAuth setup tutorial.

Central endpoint to manage rest-hooks subscriptions#

We have added a single, central endpoint that you can use to subscribe, unsubscribe, and test your subscriptions. Here are the requests you can perform:

Request typeEndpointDescription
POST/rest-hooksCreates a new rest-hook subscription
GET/rest-hooks?rest_hook_id=<int>Returns sample data for given rest-hook by id
GET/rest-hooks?name=<string>Returns sample data for given rest-hook by event name
DELETE/rest-hooks?id=<int>Disables the rest-hook, aka deletes the subscription

Headers required to use the endpoint#

headervalue
Content-Typeapplication/vnd.api+json
Acceptapplication/vnd.api+json
AuthorizationBearer [access token]

When you're ready, proceed to the next step!