Events

Introduction

Each time a given event occurs, r4nkt will notify you via a webhook. This page will list and describe the various events that can be fired.

No webhook will be called if the game's webhook URL and webhook secret properties haven't been properly set up.

Common Payload

Each webhook will contain some common data in its payload:

  • type: This value is used to indicate the webhook type.

  • date_time: This indicates the date/time for the event represented by the webhook. It will be an ISO 8601 UTC date/time representation, eg 2019-02-01T03:45:27.612584Z.

Here is what the common elements of a sample payload might look like:

{
"type":"badge-earned",
"date_time":"2019-02-01T03:45:27.612584Z",
...
}

Badge Earned

When a player earns a new badge, r4nkt will send a "badge earned" webhook. In addition to the common payload data, this webhook also includes the following:

  • custom_player_id: The custom ID for the player that earned the badge.

  • custom_achievement_id: The custom ID for the related achievement.

  • points: The number of points that were allocated to the player for having earned the badge.

Here is a sample payload:

{
"type":"badge-earned",
"date_time":"2019-02-01T03:45:27.612584Z",
"custom_player_id":"",
"custom_achievement_id":"",
"points":100,
}

Testing

In order to test and debug, you might like to use a service like RequestBin.com or webhook.site, which can show you the payload of the webhook data in real-time.