Developer docs

Vote Callback

When a player votes, we send a GET request to your server with their username, IP, and your secret. Validate, reward, return 200.

01

List your server

Get a callback URL and secret key from your dashboard after listing.

02

Add the endpoint

Create a route on your server that handles the incoming GET request.

03

Reward the player

Read the callback param, give in-game rewards, return HTTP 200.

PHP

php
<?php
$secret = "YOUR_SECRET_KEY";

if (!isset($_GET['secret']) || $_GET['secret'] !== $secret) {
    http_response_code(403);
    exit("Invalid secret");
}

$player = $_GET['callback'] ?? 'unknown';
$ip     = $_GET['ip']       ?? 'unknown';

// reward the player here
// giveVoteReward($player);

http_response_code(200);
echo "Vote registered for $player";
?>

Node.js (Express)

javascript
import express from "express";

const app = express();
const CALLBACK_SECRET = "YOUR_SECRET_KEY";

app.get("/vote", (req, res) => {
  const { callback, ip, secret } = req.query;

  if (secret !== CALLBACK_SECRET) {
    return res.status(403).send("Invalid secret");
  }

  // reward the player here
  console.log(`Vote from ${callback} (IP: ${ip})`);

  res.status(200).send("OK");
});

app.listen(3000);

Java (Spring Boot)

java
@RestController
public class VoteCallbackController {

    private static final String SECRET = "YOUR_SECRET_KEY";

    @GetMapping("/vote")
    public ResponseEntity<String> handleVote(
            @RequestParam String callback,
            @RequestParam String ip,
            @RequestParam String secret
    ) {
        if (!SECRET.equals(secret)) {
            return ResponseEntity.status(403).body("Invalid secret");
        }

        // reward the player here
        System.out.println("Vote from " + callback);

        return ResponseEntity.ok("OK");
    }
}

Test your endpoint

Simulate a vote from your terminal before going live:

curl
curl "https://yourdomain.com/vote?callback=TestPlayer&ip=1.2.3.4&secret=YOUR_SECRET_KEY"

Request format

GET /vote?callback=PlayerName&ip=1.2.3.4&secret=YOUR_SECRET
callbackstring

In-game username to reward.

ipstring

Voter's IP address.

secretstring

Your private key from the dashboard. Always validate this before doing anything else.

Checklist

  • Validate the secret before anything else
  • Respond with HTTP 200 so the vote is confirmed
  • Use HTTPS only
  • Log requests during initial setup
  • One callback endpoint per server

Quick facts

Method
GET
Auth
Secret key
Expected response
HTTP 200