Webhooks

Instead of requesting our API to see the users who have voted for your bot, we now have webhooks! Webhooks will send a post request to a URL of your choice when your bot has been voted for.

Getting Started

Start by setting up your webhook URL in the edit form of your bot on this site, it can be found at https://top.gg/bot/:ID/edit once you have entered the URL you want the webhook to be sent to, you're all set! If you need help setting up webhooks inside of your bot don't be afraid to ask in our discord server in our #api channel.

Verifying the request

On the edit page you can see another input for "Authorization". Here you shall provide a "password" that you can check for.

To verify requests are coming from us, look for the value in the Authorization header and make sure it is the same as the value you provided in the form.

Data Format

The format of the data your webhook URL will receive in a POST request

JSON Params

Field

Type

Description

bot

Snowflake

ID of the bot that received a vote

user

Snowflake

ID of the user who voted

type

String

The type of the vote (should always be "upvote" except when using the test button it's "test")

isWeekend

Boolean

Whether the weekend multiplier is in effect, meaning users votes count as two

query?

String

Query string params found on the /bot/:ID/vote page. Example: ?a=1&b=2