Developer docs

Vote Callback

Two steps: build the right vote link, then handle the request we send your server after each confirmed vote.

1

Build your vote link

When a player clicks Vote in your game, redirect them here. Replace Zezima with their actual in-game name dynamically.

URL
https://rsps.org/server/your-server/vote/?callback=anything&username=Zezima
callbackstringrequired

Passed straight to your game server in the callback request exactly as you set it. You decide what to put here: player name, session token, or anything else your server needs to identify and reward the voter.

usernamestringrequired

The player's in-game name. This must be included for the vote to be counted.

2

Handle the callback on your server

After a vote is confirmed, rsps.org sends a GET request to the callback URL you configured in your dashboard. If you set a secret key in your dashboard, it will be included in every request so you can verify the call is genuine.

Read callback to identify the voter, reward them, and return HTTP 200.

URL
GET https://yourdomain.com/vote?callback=anything&ip=1.2.3.4&secret=YOUR_SECRET
callbackstringoptional

Whatever value you set in the vote link. Use it however your server needs to identify and reward the voter.

ipstringoptional

The voter's IP address. Useful for logging and fraud detection.

secretstringoptional

Your private key from the dashboard, included only if you configured one. If present, verify it matches before processing the vote.

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 however your server handles it
// giveVoteReward($player);

http_response_code(200);
echo "Vote registered for $player";
?>
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 however your server handles it
  console.log(`Vote from ${callback} (IP: ${ip})`);

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

app.listen(3000);
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 however your server handles it
        System.out.println("Vote from " + callback);

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

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"

Checklist

  • List your server and grab your secret key from the dashboard
  • Add username=PlayerName to your vote links
  • Set up a callback endpoint on your server
  • Validate the secret before doing anything else
  • Return HTTP 200 to confirm the vote
  • Use HTTPS only
  • Log requests during initial setup

Quick facts

MethodGET
AuthSecret key
Expected responseHTTP 200
Retry on failureYes