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
  • Private Leagues and 1v1
  • Discussion
  • Classic Quiz
  • Either Or
  • Player of the Match
  • Voting (Polls)
  • Leads
  • Scheduled Tasks

Each of those categories contains a number of events, each with their own ID and context.

Common fields

Every payload contains the following fields, in addition to the event-specific ones shown below:

  • event_category – the category the event belongs to.
  • event_id – the specific event within the category.
  • type – the event type. This is the value you select when subscribing a webhook to events, so it is the most reliable field to route on.
  • client_id – the ID of the client the event belongs to.

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",
  "type": "predictions",
  "event_id": "new/update/delete",
  "client_id": "clientId",
  "prediction_id": "predictionId",
  "profile_id": "profileId"
}

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_changed") or the winners were announced ("winner_announced"). Status changes include cancelling a game and the automatic status transitions driven by the matches in the game.

{
  "event_category": "match_quiz/top_x",
  "type": "game_state",
  "event_id": "new/update/status_changed/winner_announced",
  "client_id": "clientId",
  "game_id": "gameId"
}

Fans United also sends events for game participations for particular users that contain the profile ID, the game ID and the prediction ID.

{
  "event_category": "match_quiz/top_x",
  "type": "game_participation",
  "event_id": "participation",
  "client_id": "clientId",
  "prediction_id": "predictionId",
  "game_id": "gameId",
  "profile_id": "profileId"
}

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",
  "type": "template_state",
  "event_id": "new/update/delete/winner_announced",
  "client_id": "clientId",
  "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",
  "type": "profile_state",
  "event_id": "new/update/delete/interests_updated",
  "client_id": "clientId",
  "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",
  "type": "profile_activity_badge",
  "event_id": "new_badge",
  "client_id": "clientId",
  "profile_id": "profileId",
  "badge_id": "badgeId"
}

A similar event is being sent when the user goes up a tier.

{
  "event_category": "profile_activity",
  "type": "profile_activity_tier",
  "event_id": "tier_up",
  "client_id": "clientId",
  "profile_id": "profileId",
  "tier": "tierID"
}

When the user gets a new follower the event looks like this:

{
  "event_category": "profile_activity",
  "type": "profile_activity_follow",
  "event_id": "new_follower",
  "client_id": "clientId",
  "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",
  "type": "profile_activity_created",
  "event_id": "new_activity",
  "client_id": "clientId",
  "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 used in your games does not finish normally: it is postponed, deleted, canceled or abandoned.

{
  "event_category": "football_matches",
  "type": "football_match_state",
  "event_id": "football_match_postponed/football_match_deleted/football_match_canceled/football_match_abandoned",
  "client_id": "clientId",
  "match_id": "matchId"
}

Private Leagues and 1v1 events

Events are sent when private leagues or 1v1 matchups are created, updated, or deleted:

{
  "event_category": "private_league/one_vs_one",
  "type": "private_league",
  "event_id": "create/update/delete",
  "client_id": "clientId",
  "private_league_id": "asg11-g12-agssa",
  "profile_id": "profileId"
}

Events are also sent for user management within private leagues:

{
  "event_category": "private_league/one_vs_one",
  "type": "private_league_action",
  "event_id": "user_banned/user_joined/user_invited/user_left",
  "client_id": "clientId",
  "private_league_id": "asg11-g12-agssa",
  "profile_id": "profileId",
  "action_by": "profile-id-of-the-user-doing-the-action"
}

Discussion events

Events are sent when posts are created, updated, or deleted:

{
  "event_category": "discussion",
  "type": "discussion",
  "event_id": "create_post/update_post/delete_post",
  "client_id": "clientId",
  "post_id": "postId",
  "profile_id": "profileId"
}

And for post interactions:

{
  "event_category": "discussion",
  "type": "discussion_action",
  "event_id": "create_reaction/update_reaction/delete_reaction/moderate_post",
  "client_id": "clientId",
  "post_id": "postId",
  "profile_id": "profileId"
}

Classic Quiz events

Events are sent when users participate in classic quizzes:

{
  "event_category": "classic_quiz",
  "type": "classic_quiz_participation",
  "event_id": "participation",
  "client_id": "clientId",
  "classic_quiz_id": "123",
  "profile_id": "profileId"
}

And for quiz management:

{
  "event_category": "classic_quiz",
  "type": "classic_quiz_crud",
  "event_id": "create/update/delete",
  "client_id": "clientId",
  "classic_quiz_id": "123"
}

Either Or events

Events are sent when users participate in either/or choices:

{
  "event_category": "either_or",
  "type": "either_or_participation",
  "event_id": "participation",
  "client_id": "clientId",
  "either_or_id": "123",
  "profile_id": "profileId"
}

And for either/or management:

{
  "event_category": "either_or",
  "type": "either_or_crud",
  "event_id": "create/update/delete",
  "client_id": "clientId",
  "either_or_id": "123"
}

Player of the Match (POTM) events

Events are sent when users vote for a player of the match:

{
  "event_category": "football_player_of_the_match",
  "type": "football_player_of_the_match_vote",
  "event_id": "vote",
  "client_id": "clientId",
  "match_id": "fb:m:123",
  "player_id": "fb:p:321",
  "profile_id": "profileId"
}

Voting (Poll) events

Events are sent when users vote in polls:

{
  "event_category": "poll",
  "type": "poll_vote",
  "event_id": "vote",
  "client_id": "clientId",
  "poll_id": "123",
  "option_id": "456",
  "profile_id": "profileId"
}

And for poll management:

{
  "event_category": "poll",
  "type": "poll_crud",
  "event_id": "create/update/delete",
  "client_id": "clientId",
  "poll_id": "123"
}

Lead events

Events are sent when new leads are created:

{
  "event_category": "lead",
  "type": "lead_activity",
  "event_id": "create",
  "client_id": "clientId",
  "lead_id": "d2sdv2efzsasd1"
}

Scheduler events

Events are sent for scheduled task management:

{
  "event_category": "scheduled_tasks",
  "type": "scheduler_state_event",
  "event_id": "new/update/update_status/delete",
  "client_id": "clientId",
  "task_id": "taskId"
}

Did this page help you?