Webhook Events & Payloads
This page details the different events sent by Fans United and the corresponding JSON payloads.
Fans United groups events in the following categories:
- Predictions
- Games
- Templates
- Profile Management
- Profile Activity
- Football Matches
Each of those categories contains a number of events, each with their own ID and context.
Prediction events
Each time the user places a new prediction, updates an existing one or deletes it, Fans United will send the following JSON payload with varying event_id:
{
"event_category":"predictions",
"event_id": "new/update/delete",
"prediction_id": "predictionId",
"user_id": "userID"
}
Game events
All types of games have their own event category. Currently, they are "top_x" and "match_quiz". The events are being sent when the game is created ("new") or updated ("update"), when the status has changed ("status_chaged") or the winners were announced ("winners_announced").
{
"event_category":"match_quiz/top_x",
"event_id": "new/update/status_chaged/winners_announced",
"game_id":"gameId"
}
Fans United also sends events for game participations for particular users that contain the user ID, the game ID and the prediction ID.
{
"event_category":"match_quiz/top_x",
"event_id": "participation",
"prediction_id": "predictionId",
"game_id":"gameId",
"user_id": "userID",
}
Leaderboard Template events
Fans United sends events when a new template has been created, and when existing one has been updated or deleted. In addition to that, we send an event when the winners for a particular template have been announced.
{
"event_category":"leaderboard_templates",
"event_id": "new/update/delete/winners_announced",
"template_id": "templateId"
}
Profile Management events
The system can notify you for anything a particular user does to their profile. This includes a new profile being created, an existing one being updated or deleted, a user updating their interests. The list of events will be expanded in the future.
{
"event_category":"profile",
"event_id": "new/update/delete/interests_updated",
"profile_id": "profileId"
}
Profile Activity events
Users can do many more things than just manage their profile. For each of those, we have an event. Let's start with badge earning.
When a user is rewarded with a new badge, the system will send out an event that looks like this:
{
"event_category":"profile_activity",
"event_id": "new_badge",
"profile_id": "profileId",
"badge_id":"badgeId"
}
A similar event is being sent when the user goes up a tier.
{
"event_category":"profile_activity",
"event_id": "tier_up",
"profile_id": "profileId",
"tier":"tierID"
}
When the user gets a new follower the event looks like this:
{
"event_category":"profile_activity",
"event_id": "new_follower",
"profile_id": "profileId",
"follower_id":"followerId"
}
Other activities can be sent as events too. Here' besides the basic data, we will also send the context attached to the event. The model looks like this:
{
"event_category":"profile_activity",
"event_id": "new_activity",
"profile_id": "profileId",
"action":"actionTypeId",
"context": {
"content": {
"id": "string",
"type": "string",
"label": "string"
},
"tags": [
{
"id": "string",
"type": "string",
"source": "string"
}
],
"campaign": {
"id": "string",
"label": "string"
}
}
Notice that depending on the context supplied to the system, some of these fields will be empty/null.
Match related events
Fans United sends events when a match has been resolved one way or another. The most important event ID here is "football_match_resolved". This is fired when a match has finished and all the points have been rewarded to all users. Depending on the match outcome (interrupted, abandoned, etc.) we've added other events as well.
{
"event_category":"football_matches",
"event_id": "football_match_resolved/football_match_postponed/football_match_deleted/football_match_canceled/football_match_abandoned",
"match_id": "matchId"
}
Updated about 1 year ago