/votes tells you who voted since the last time you asked. The webhook
tells you as it happens, which is what you want if voting unlocks something in
your bot.
Set it up
1
Add the URL
On your bot’s edit page, under Vote webhook. It must be
https on a
public host — loopback and private addresses are refused, because a URL we
cannot reach is a delivery queue that fills up forever.2
Copy the secret
Generated with the URL. It is both the
Authorization value we send and the
HMAC key we sign with.3
Verify, then act
Reject anything carrying neither a matching
Authorization header nor a
valid signature. Your endpoint is public; that check is the only thing
standing between it and somebody handing your bot free rewards.What we send
Verifying the signature
Compare in constant time, and hash the raw body — re-serialising the parsed JSON changes the bytes and the signature will never match.Retries
Any response outside2xx, a connection failure, or more than 10 seconds
without a reply counts as a failure. We retry four times after the first
attempt:
1
1 minute
2
5 minutes
3
30 minutes
4
2 hours
Being delivered twice is normal
A timeout on our side and a success on yours look identical to us, so the samevote.create can arrive again. Key your handling on X-Webhook-Delivery, or on
user_id plus voted_at, and make the second one a no-op.