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_utc: 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_utc":"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_utc":"2019-02-01T03:45:27.612584Z",
    "custom_player_id":"",
    "custom_achievement_id":"",
    "points":100
}

Webhook Test

This webhook is sent from the game dashboard's webhhook settings panel and is manually initiated by any user with access. It is used to help get webhook integration up and running. In addition to the common payload data, this webhook also includes the following:

  • inspiring_quote: This serves two purposes. First, it provides additional data so that developers have a little better idea about what to expect. Second, it can serve to inspire. 😊

Here is a sample payload:

{
    "type":"webhook-test",
    "date_time_utc":"2019-02-01T03:45:27.612584Z",
    "inspiring_quote":"He who is contented is rich. - Laozi"
}

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.

Last updated