Webhooks can be used to receive data coming from Rollee's API.

Setup

All the following calls must have the Authorization Header part correctly setup. See documentation about authentication. So this part will be omited in the example for a better readibility.

For the same reason, we will also omit Rollee's domain name and base path of the API in the examples, and will show only relative routes. Of course API's calls must integrate the https://api.getrollee.com/api/v0.3/ part ahead of the relatives routes.

Webhook configuration

You can configure webhooks through Rollee's API by making a simple POST request

Here an example:

curl -XPUT /webhooks/users -d '{"host":https://mydomain.com, "method: "POST", "headers"={"API-KEY": ...}'
curl -XPUT /webhooks/accounts -d '{"host":https://mydomain.com, "method: "POST", "headers"={"API-KEY": ...}'
curl -XPUT /webhooks/endpoints -d '{"host":https://mydomain.com, "method: "POST", "headers"={"API-KEY": ...}'

In the example above there are three important data to send to configure a webhook to receive
events from a specific entity (see section Entities).
The parts to specify are:

  • host: the fully qualified url on which you will receive events.
  • method: you can choose the method you want, but we recommend to use POST method
  • headers: you probably want to protect your handlers to received events with some mechanism. You can specify the exact headers, that rollee's API will use to send the events.

Entities

We have organized the webhooks around three entities, and events will be triggered on the creation or updated of these ones:

  • Users
  • Accounts
  • Endpoints

To have a better understanding of these entities (see Conventions documentions).

Retry policy

Since webhooks usage can fail due to network issues. Rollee's webhook implementation
have a retry policy that ensure that you will receive all events at least once. There are no limits in time or in attempts.


Did this page help you?