Webhooks Overview

Webhooks are yet another way to integrate with Fans United. They allow you to subscribe to real-time events in the platform and have multiple use-cases. You can use them to source information for your notification service - maybe you want to notify your users when there's a new game available or when they earned a badge. Maybe you want to copy the data generated in Fans United to another data warehouse for further analysis. Whatever you use-cases, rest assured, Fans United's webhooks are flexible enough to allow it.

Currently, Fans United supports 3 delivery mechanisms:

  • HTTP - Classic webhook. We can send the information to a URL you have provided, protected with Basic Authentication.
  • Kafka - We can publish the events to a Kafka message queue you provide.
  • Pub/Sub - We also support Google's message queue. Similarly to Kafka, we can publish the events there for you to consume.

As for the payload, we have developed a simple and consistent payload for different events. For example, this is what the payload for a new prediction looks like:

{
  "event_category":"predictions",
  "event_id": "new",
  "prediction_id": "some-prediction-id-here-123",
  "user_id": "user-id-here-678"
}

This provides all the information necessary for you to then fetch the additional information you need. You can make a separate request for the prediction details (which match, market, etc) or the user info.

It is important to note, that you can configure multiple webhooks with differnet delivery method and different events. For example, you can send prediction events to HTTP and game events to Kafka. You can send both prediction and game IDs to Pub/Sub, or you can do everything at the same time.

Another thing to remember is that webhooks have limited number of re-tries.